fix(orchestration): Preserve Claude subagent attribution after settle - #5388
fix(orchestration): Preserve Claude subagent attribution after settle#5388mwolson wants to merge 207 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Effect Service Conventions review: one convention issue found in the newly added test module's service imports. Everything else in the changed Effect code (subpath namespace imports, layer construction, dependency acquisition via yield* Service, error modeling) matches the conventions.
Posted via Macroscope — Effect Service Conventions
ApprovabilityVerdict: Needs human review Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
38aefa4 to
f1d3119
Compare
f1d3119 to
7370ca6
Compare
7370ca6 to
1a18bba
Compare
There was a problem hiding this comment.
Reviewed the changed Effect service code against the service conventions. One import-shape issue in the new server test; everything else (namespace imports from effect/* subpaths, Context.Service shapes, error modelling, and dependency acquisition in the touched orchestration/adapter code) looks consistent with the conventions.
Posted via Macroscope — Effect Service Conventions
1a18bba to
f80ad36
Compare
f80ad36 to
38e7184
Compare
38e7184 to
49162a7
Compare
49162a7 to
fe0878f
Compare
fe0878f to
8e4dc09
Compare
8e4dc09 to
905b5a1
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
The turn item materialized when a queued run is promoted was emitted with inputIntent "turn_start", but the deterministic replay driver (and the recorded queued_turn fixtures) expect "queued_turn" — the mismatch stalled replay before the queued run could start, leaving run 1 waiting and run 2 queued forever in all five queued_turn fixtures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Effect service conventions: ThreadManagementThreadNotSendableError carried an Archived/NoSteerableRun reason union and switched on reason._tag inside the message getter. Modelled as two error classes (ThreadManagementThreadArchivedError, ThreadManagementNoSteerableRunError); both still map to the MCP thread_not_sendable failure code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Prevent the title row from shifting when output is revealed - Preserve panel and compact button sizing
…ingdotgg#5309) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
- Schema.UnknownFromJsonString -> Schema.fromJsonString(Schema.Unknown) - SchemaIssue.InvalidValue single-argument form in checkpointDiff - McpServerClient requires protocolVersion Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Required for follow-up requests by the 2025-06-18 MCP HTTP transport that effect beta.103 enforces. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The thread-panel mapping change replaced the compact className on the Run and Add controls with the isPanel conditional and dropped the non-panel icon-compact classes that the responsive test asserts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ports the deleted v1 ProviderCommandReactor title coverage onto the v2 service: marker arming/clearing via thread.metadata.update, superseded requestId no-ops, digest-driven regeneration, the "New thread" and unchanged-title fallbacks, generation failure, and missing initial messages, plus unit tests for formatThreadTitleContext. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Hoist inline Schema compiles to module scope, drop unused imports/vars, stabilize react-markdown component identities via a module-scope factory, remove useless spreads, and use data-derived keys for release-note bullets. No behavior changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The codex resume test was the only replay scenario without a runtimePolicyOverride, so its checkpoint scope cwd fell back to process.cwd() and baseline capture ran real git over the entire checkout. Locally the capture short-circuits on checkpoint refs left behind by earlier runs; on a fresh CI checkout it is a cold multi-second capture that outlives the scenario wait budget, failing await_thread_idle while the run is still mid-checkpoint. Point the fixture's turn/start frames at the <workspace> placeholder and checkpoint a throwaway git workspace like every other replay test. Scenario waits are also wall-clock-bounded now: the iteration budget counts event-loop turns, which burn at full speed while git/fixture IO is in flight, so exhaustion additionally requires a 60s real-time deadline to pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r's scope (pingdotgg#5406) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
- Keep the git action control disabled when the branch is up to date - Omit open PR menu entries and remove their link-opening behavior - Update logic tests for the new states
…sPinned Main owns migration numbering: 036_ProjectionThreadsPinned landed on main, so the v2 migrations shift from 036-044 to 037-045. Release path runs all of main's migrations first, then the v2 stack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Port thread pinning (pingdotgg#5312) into the orchestration-v2 command pipeline: thread.pin/unpin commands, thread.pinned/unpinned events, pinnedAt on the v2 thread state and projected shells, promotion semantics (pin clears settle/snooze, settle clears pin) matching the v1 decider, and client pin/unpin operations in the v2 dispatch style. - Port the regenerated-title context anchoring (pingdotgg#5365) into ThreadTitleRegenerationService: pin the first user message ahead of the retained tail when the digest is truncated. - Re-apply the right-panel controls positioning from pingdotgg#5260 to the v2 ChatView title bar controls. - Repair merge artifacts: committed conflict markers in BranchToolbar, duplicate capability keys, duplicate CommandPalette import, v1 turn naming in DiffPanel's focus-refresh effect, onSend signature merge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
e24b59c to
4213ac5
Compare
905b5a1 to
48f545d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 48f545d. Configure here.
48f545d to
f223029
Compare
25de21d to
0af2a6e
Compare

Summary
and fresh buffered continuations.
threads without changing ordinary root assistant text.
generic Claude prompt, preserve other providers' requested detail, and hide
automatic provider entries from queue controls.
Problem and Fix
task_notification.summarywas used as the provider-owned Claude continuation input and could render as raw child text labelled as another agent's message. A shared override would also erase Codex background-command context.Background task completed., while preserving provider-specific continuation detail for Codex. Omit provider-owned automatic entries from visible queue controls.task_started.tool_use_idby arrival order.task_startedregisters their alias. A structuredagentIdcan also appear in ordinary root tool output.agentIddata.Defensive Fixes
failIfCurrent, where a live-buffer rescan pulled the sibling into the failed cohort.running.tool_use_result, then incorrectly apply that shared structured result when one buffered block replayed.Validation
client-runtime set passed 189 tests with 1 skipped.
vp check: passed all 2,690 files.vp run typecheck: passed all 15 packages.passed the exact packaged Grok post-settlement subagent, Claude
post-settlement subagent, and Codex background-command wake scenarios. Claude
projected one generic provider-owned root input while keeping raw child
output on the child; Grok and Codex retained their provider-specific
behavior.
agentIdcollision. Theregression was fixed and covered. Fresh Grok 4.5 high-reasoning source and deliberate-integration reviews
returned SHIP after verifying teardown ordering, exactly-once terminals,
semaphore safety, independent batched-result lineage, and fail-closed pending-launch overflow.
Note
High Risk
Changes orchestration routing for Claude native tasks, continuations, and session teardown; mis-attribution or drain bugs could leak child output to the root or drop completions.
Overview
Fixes Claude subagent frames arriving after a root turn settles being mis-attributed to the root thread when continuation turns no longer have launch-time tool-use maps.
Durable native-thread session state now holds task identity, launch/resume aliases, bounded pre-registration buffering, and resume metadata so every child frame resolves through the same lineage. Child narration, tools, results, and distinct terminal output stay on child threads; ordinary root assistant text is unchanged.
Continuation input for provider-owned Claude root wakes uses fixed text (
Background task completed.) instead of rawtask_notification.summary, while Codex keeps its provider-specific detail. Automatic provider entries are omitted from visible queue controls.Adds fail-closed behavior for unknown lineage (bounded buffer until registration; overflow dropped child-side), single unambiguous launch-alias inference when
task_started.tool_use_idis missing, routing for early Agent results/approvals, and defensive handling for failed continuation cohorts, sibling completions, rejected approvals in inference queues, session teardown, and split multi-result SDK frames so siblings replay independently without shared frame-level results.Reviewed by Cursor Bugbot for commit f223029. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve Claude subagent attribution after settlement in orchestration v2
ClaudeAdapterV2to be keyed per native thread, replacing a single global registry withClaudeNativeThreadSubagentState/ClaudeSessionSubagentStatestructures that support alias resolution, bounded history, and generation tracking.Semaphorepermit to eliminate race conditions in concurrent subagent/approval flows.approvalsCanOriginateFromSubagents: true), with tool calls routed to the correct child thread viaparentToolUseId/subagentTaskId.PROVIDER_CONTINUATION_MESSAGE_TEXTas the canonical default continuation message text, used inProviderContinuationServiceand filtered from the visible queue inthreadWorkflows.Macroscope summarized f223029.