Skip to content

fix: support reusing field-input components in event-driven flows#249

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/feat-improve-component-reusability
Draft

fix: support reusing field-input components in event-driven flows#249
Copilot wants to merge 8 commits intomainfrom
copilot/feat-improve-component-reusability

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Summary

Components like FileWriter could not be reused in event-driven models by subclassing and adding event handlers, because process validation still required connector-backed field inputs and shutdown could replay the last event-populated value. This change allows inherited field inputs to be satisfied by events and closes the event-driven path cleanly once producers are exhausted.

Changes

  • Validation

    • Allow components with non-system input_events to have unconnected field inputs.
    • This enables subclasses that populate inherited fields from event handlers instead of field connectors.
  • Runtime behavior

    • Treat components with no connected field-input channels as event-driven for producer-graph exhaustion.
    • Exit the wrapped step before rebinding inputs when IO closes, preventing stale event-populated values from being replayed on shutdown.
  • API surface

    • Expose IOController.has_connected_field_inputs and use it for the runtime check instead of reaching into internal channel state.
  • Coverage

    • Add a focused integration test showing a FileWriter subclass consuming events to populate message.
    • Add a validation test covering the same reuse pattern.
class EventReaderFileWriter(FileWriter):
    io = IO(input_events=[MessageEvent])

    @MessageEvent.handler
    async def handle_message(self, event: MessageEvent) -> None:
        self.message = event.data.message

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • metadata.google.internal
    • Triggering command: /home/REDACTED/work/plugboard/plugboard/.venv/bin/python3 /home/REDACTED/work/plugboard/plugboard/.venv/bin/python3 /home/REDACTED/work/plugboard/plugboard/.venv/lib/python3.13/site-packages/ray/dashboard/dashboard.py --host=127.0.0.1 --port=8265 --port-retries=50 --temp-dir=/tmp/ray --log-dir=/tmp/ray/session_2026-04-08_20-39-05_496118_4173/logs --session-dir=/tmp/ray/session_2026-04-08_20-39-05_496118_4173 --logging-rotate-bytes=536870912 --logging-rotate-backup-count=5 --gcs-address=127.0.0.1:37769 --cluster-id-hex=12135458e388ceb3b846ca782e5dd938de9648ae360cbb7d94ee0423 --node-ip-address=127.0.0.1 --stdout-filepath=/tmp/ray/session_2026-04-08_20-39-05_496118_4173/logs/dashboard.out --stderr-filepath=/tmp/ray/session_2026-04-08_20-39-05_496118_4173/logs/dashboard.err cal/bin/git (dns block)
    • Triggering command: /home/REDACTED/work/plugboard/plugboard/.venv/bin/python3 /home/REDACTED/work/plugboard/plugboard/.venv/bin/python3 /home/REDACTED/work/plugboard/plugboard/.venv/lib/python3.13/site-packages/ray/dashboard/dashboard.py --host=127.0.0.1 --port=8265 --port-retries=50 --temp-dir=/tmp/ray --log-dir=/tmp/ray/session_2026-04-08_20-42-25_298805_5295/logs --session-dir=/tmp/ray/session_2026-04-08_20-42-25_298805_5295 --logging-rotate-bytes=536870912 --logging-rotate-backup-count=5 --gcs-address=127.0.0.1:46503 --cluster-id-hex=7cdaee0fa9731bdb3741caecaaa16ea30c42dd0e00066412731da5bb --node-ip-address=127.0.0.1 --stdout-filepath=/tmp/ray/session_2026-04-08_20-42-25_298805_5295/logs/dashboard.out --stderr-filepath=/tmp/ray/session_2026-04-08_20-42-25_298805_5295/logs/dashboard.err p/bin/git r (dns block)
    • Triggering command: /home/REDACTED/work/plugboard/plugboard/.venv/bin/python3 /home/REDACTED/work/plugboard/plugboard/.venv/bin/python3 /home/REDACTED/work/plugboard/plugboard/.venv/lib/python3.13/site-packages/ray/dashboard/dashboard.py --host=127.0.0.1 --port=8265 --port-retries=50 --temp-dir=/tmp/ray --log-dir=/tmp/ray/session_2026-04-08_20-50-35_693193_6522/logs --session-dir=/tmp/ray/session_2026-04-08_20-50-35_693193_6522 --logging-rotate-bytes=536870912 --logging-rotate-backup-count=5 --gcs-address=127.0.0.1:43549 --cluster-id-hex=7a8906b6756dbfd8332941da89ea5d811afa31c7de1ee6047d690f01 --node-ip-address=127.0.0.1 --stdout-filepath=/tmp/ray/session_2026-04-08_20-50-35_693193_6522/logs/dashboard.out --stderr-filepath=/tmp/ray/session_2026-04-08_20-50-35_693193_6522/logs/dashboard.err k/_temp/ghcca-node/node/bin/git 3 /home/REDACTED/wfile (dns block)
  • releases.astral.sh
    • Triggering command: /home/REDACTED/.local/bin/uv uv venv .venv --python python3.13 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 7 commits April 8, 2026 20:59
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/b2d74c52-309e-40c7-bdd3-5880ba403b35

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/b2d74c52-309e-40c7-bdd3-5880ba403b35

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/b2d74c52-309e-40c7-bdd3-5880ba403b35

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/b2d74c52-309e-40c7-bdd3-5880ba403b35

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve reusability of components in event-driven simulations fix: support reusing field-input components in event-driven flows Apr 8, 2026
Copilot AI requested a review from toby-coleman April 8, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Improve reusability of components in event-driven simulations

2 participants