Skip to content

refactor(core): extract broker transport port - #47

Open
kjgbot wants to merge 3 commits into
mainfrom
refactor/broker-transport-port-0825
Open

refactor(core): extract broker transport port#47
kjgbot wants to merge 3 commits into
mainfrom
refactor/broker-transport-port-0825

Conversation

@kjgbot

@kjgbot kjgbot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • introduce BrokerTransportPort and a published-package-backed HarnessBrokerTransport
  • move broker start/connect/recovery/events, agent lifecycle/input, Relaycast operations, and shared lock/lease ownership out of runner.ts
  • preserve legacy default behavior and selector precedence: injected port > per-run mode > RELAYFLOWS_INTEGRATION_TRANSPORT
  • keep ProcessBackend selection independent, retain the direct Slack fallback, and leave mutator receipt discipline unchanged
  • add selector/preference coverage and adapt broker lifecycle tests to the extracted boundary

Validation

  • npm ci — exit 0
  • npm run build:primitives — exit 0
  • npm test — exit 0 (61 files, 1,018 tests)
  • npm run typecheck — exit 0
  • substitute single-step Relayflows/Codex non-interactive smoke workflow — exit 0 (CODEX_WORKFLOW_OK, DONE); this was not Native autopilot-tick and exercised 0/9 Native deterministic steps

Runner LOC

packages/core/src/runner.ts: 11,832 → 11,241 lines (−591 in PR-1), progressing toward the ≤7,900 four-PR end-state budget.

PR-1 of the signed-off stage-2 sequence only. No merge requested.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 819eba38-2940-4d7e-b787-4cb8da26cc8e


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/core/src/runner.ts Outdated
Comment thread packages/core/src/broker-transport.ts
Comment thread packages/core/src/__tests__/broker-transport.test.ts Outdated
- injectAnswerToAgent awaits the transport with a bounded ack window: a
  rejected message-fallback delivery now throws instead of being logged as
  injected, and PTY dispatches log confirmed-vs-best-effort honestly
- HarnessBrokerTransport merges caller-configured relay.env as the base of
  the spawned broker environment so embedders without resolveRelayEnv keep
  their credentials and runtime settings
- the defaults-to-legacy test pins RELAYFLOWS_INTEGRATION_TRANSPORT so it
  cannot depend on the invoking shell

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/core/src/runner.ts Outdated
…ocess exit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant