feat(subagents): disclose projected results consistently#3866
feat(subagents): disclose projected results consistently#3866PixPMusic wants to merge 4 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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. This PR introduces new user-facing behavior for subagent result disclosure, and has an unresolved review comment identifying a bug where You can customize Macroscope's approvability policy. Learn more. |
Only surface the expandable result card once the subagent reaches a terminal status (completed/failed/cancelled/interrupted); running subagents keep the live-progress summary even when the projection carries a partial result. Normalize the trimmed result-presence check once so whitespace-only results fall back to progress/prompt in both the summary line and the disclosure.
Cancelled and interrupted subagents keep whatever result text streamed before the abort, so only completed/failed results get the full-result disclosure. Running or aborted subagents now surface the streamed result as the live detail line when no progress text exists.
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 d11f70a. Configure here.
Cancelled and interrupted subagents showed the stale progress line even when partial result text was available. Terminal statuses now prefer the streamed result; running subagents keep live progress first.
There was a problem hiding this comment.
🟡 Medium
A subagent in rolled_back status takes the non-terminal branch when computing detail, so item.progress is preferred over item.result. Users see a stale in-progress line for a stopped subagent instead of its final output. TERMINAL_SUBAGENT_STATUSES is missing "rolled_back", which the server treats as terminal during rollback.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/chat/V2LifecycleRow.tsx around line 41:
A subagent in `rolled_back` status takes the non-terminal branch when computing `detail`, so `item.progress` is preferred over `item.result`. Users see a stale in-progress line for a stopped subagent instead of its final output. `TERMINAL_SUBAGENT_STATUSES` is missing `"rolled_back"`, which the server treats as terminal during rollback.
There was a problem hiding this comment.
rolled_back is a run status (OrchestrationV2RunStatus), not a turn-item status: OrchestrationV2TurnItemStatus in packages/contracts/src/orchestrationV2.ts has no rolled_back member, so item.status here can never hold it (adding it to the set would not typecheck against Set<OrchestrationV2TurnItem["status"]>). Items belonging to rolled-back runs are excluded by the projection layer (r.status <> 'rolled_back' in ProjectionStore.ts) rather than surfaced with a rolled-back item status.
There was a problem hiding this comment.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.

Important
This PR is stacked on #2829 and should be reviewed and merged after it.
Summary
Validation
vp test run apps/web/src/components/chat/MessagesTimeline.test.tsxvp test run apps/server/src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts -t 'runs subagent(_v2)?/codex'vp checkvp run typecheckNote
Low Risk
Chat timeline presentation and test-only orchestration assertions; no auth, data, or API changes.
Overview
Completed/failed subagent rows in
V2LifecycleRownow pick detail text by status: live progress while running (even if a partialresultis streaming), then result/progress/prompt when terminal; only completed/failed with non-blank trimmedresultget a collapsible full result disclosure (expandedDetailonRelatedThreadCard), with open child thread as a separate control when expanded.Behavioral tweaks: cancelled/interrupted rows show streamed partial output instead of stale progress; whitespace-only final results fall back to progress and skip disclosure.
Tests: Codex replay fixtures assert each subagent’s parent lifecycle
turnItemsentry matchessubagent.result;MessagesTimelinetests cover disclosure, running partials, cancel, and blank-result cases.Reviewed by Cursor Bugbot for commit 86a63f0. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Disclose projected subagent results in lifecycle rows based on run status
V2LifecycleRownow selects detail text based on subagent status: running subagents prefer progress over streamed result, terminal statuses prefer streamed result, and whitespace-only results are ignored.RelatedThreadCardgains an optionalexpandedDetailprop that renders an inline<details>disclosure block withdata-v2-subagent-result-disclosure,data-v2-subagent-result, and an aria-label; when present, opening the thread uses a dedicated overlay button instead of the whole card.subagentandsubagent_v2assert that parent lifecycle turn items carry matching results, andMessagesTimelinetests cover the full matrix of subagent states.Macroscope summarized 86a63f0.