Repository navigation
refactor: remove in-product Relay orchestration - #987
Merged
Merged
Conversation
Pylon's bridge to the Relay Orchestrator Claude plugin was a stand-in while upstream's orchestrator was unavailable. Upstream shipped orchestrator v2, so this removes the bridge rather than carrying two delegation implementations. Deletes RelayWorkerBridge, RelayCli and relayMcpConfig, and unhooks their optional-service wiring from server.ts, ws.ts, OrchestrationReactor and ProviderRuntimeIngestion. The Claude and Codex adapters no longer inject a relay MCP server. Drops the relay-only wire fields (source, relaySequence, relayPriorUsage). cancellable and watchable stay: they are generic capability flags that Prime and native agents also use. Historical events keep decoding because Struct ignores excess properties, covered by a new fold regression test. Collapses the logic those fields carried: - ProjectionSnapshotQuery drops the relay lifecycle pinning CTEs. - ThreadBackgroundLiveness loses its relay set; no work outlives its session, so clearThreadLiveness drops the thread entry outright. - subagentRuntime loses the attempt/sequence fence and cumulative usage accounting; canCancelSessionAgent loses its detached-controls parameter. - planBackgroundAgentStop reduced algebraically to canInterruptParent once detached workers were gone, so ChatView uses that directly. The managed relay tunnels (packages/shared/src/relay*, infra/relay, apps/server/src/relay, deploy-relay.yml) are a different subsystem and are untouched. Migration 063 stays: it is registered and already applied.
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retires Pylon's bridge to the Relay Orchestrator Claude plugin. It was a stand-in while upstream's orchestrator was unavailable; upstream shipped orchestrator v2 (
de34391427), so this removes the bridge rather than carrying two delegation implementations.Removed
orchestration/RelayWorkerBridge.ts(1858 lines) andorchestration/RelayCli.ts— plugin discovery viainstalled_plugins.jsonandscripts/relay.mjsprovider/relayMcpConfig.ts—PYLON_RELAY_CLIopt-in and Codex app-server argsserver.ts,ws.ts,OrchestrationReactor,ProviderRuntimeIngestionClaudeAdapterandCodexAdapterdocs/user/thread-sidebar.mdWire contract
Drops the relay-only fields
source: "relay",relaySequence,relayPriorUsage.cancellableandwatchablestay — they are generic capability flags that Prime and native agents also use, with!== falsedefaults.No data migration: these were all
Schema.optional, andSchema.Structignores excess properties on decode, so events persisted before this change still decode. A newsubagentRuntimetest folds a legacy relay-shaped payload and asserts it becomes an ordinary agent row.Migration
063_ClearUnprojectedRelayOutagesis kept — it is registered at index 63 and already applied, so it stays immutable.Logic that collapsed
ProjectionSnapshotQuery— removed therelay_lifecycle/active_relay_lifecycleCTEs and their pinned-activity unionThreadBackgroundLiveness— dropped therelayset. No work outlives its session now, soclearThreadLivenessdeletes the thread entry outright andhasNativeBackgroundWorkis a size checksubagentRuntime— deleted the attempt/sequence fence (acceptRelayEvent), per-attempt reset, cumulative usage accounting and the now-deadaddUsage;canCancelSessionAgentlost its thirddetachedControlsAvailableparameterChatView.logic—planBackgroundAgentStopreduced algebraically tocanInterruptParentwith no detached workers, so it is deleted andChatViewuses a plaincanStopBackgroundWorksession-logic+ mobilethreadActivity— removed therelay.binding/relay.activationskips, the origin-backfill, the resulting deadtoolOriginsmaps, andrelay-panel:spawn-group keysOut of scope
The managed relay tunnels are a different subsystem from June 2026 and are untouched:
packages/shared/src/relay*,packages/contracts/src/relay*,packages/client-runtime/src/relay/,apps/server/src/relay/,infra/relay/,deploy-relay.yml, and therelay:read/relay:writescopes.Pair mode needed no work here — it was already removed by
eb73be4a27(#673) on 2026-09-19.Verification
t3,@t3tools/contracts,@t3tools/client-runtime,@t3tools/web,@t3tools/mobile(run per package;vp run -F/--filtersilently skipped some)vp test rungreen on the changed scope: 12 files, ~560 tests, includingThreadBackgroundLiveness,ProjectionSnapshotQuery,subagentRuntime,session-logic,AgentsPanel,threadActivity,sessionAgentMenu, both adapters, and migration 063ChatView.tsxwarnings are pre-existing)ClaudeAdapter.test.tsfails ifCLAUDE_CODE_ENABLE_TODO_TOOLSis set in the ambient environment — pre-existing, unrelated; 192/192 pass with it unsetNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.