Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(subagents): disclose projected results consistently #3866

MergedPixPMusic(GitHub profile, opens in a new tab)merged 4 commits intot3code/codex-turn-mapping fromrefs/pull/3866/headmerged by juliusmarminge View on GitHub

Important

This PR is stacked on #2829 and should be reviewed and merged after it.

Summary

  • Show completed subagent results in an expandable parent timeline row.
  • Keep child-thread navigation separate from result disclosure.
  • Assert Codex replay projections keep authoritative results on parent lifecycle items.

Validation

  • vp test run apps/web/src/components/chat/MessagesTimeline.test.tsx
  • vp test run apps/server/src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts -t 'runs subagent(_v2)?/codex'
  • vp check
  • vp run typecheck

Note

Low Risk Chat timeline presentation and test coverage only; no auth, persistence, or orchestration logic changes.

Overview Parent-thread subagent rows now pick summary text from result, progress, and prompt based on run status: while running, live progress wins over a partial streamed result; once terminal (including cancelled/interrupted), streamed result is preferred over stale progress; whitespace-only results are ignored.

For completed or failed subagents with a real result, V2LifecycleRow renders an expandable <details> block (data-v2-subagent-result-disclosure) for the full text, with open child thread moved to a separate overlay control so disclosure and navigation do not compete.

Codex replay fixtures now assert each parent subagent turn item’s result matches the authoritative subagent projection; MessagesTimeline tests cover the disclosure and status matrix (running with/without progress, cancelled partial output, blank result fallback).

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e439e41ff13d6d48c2f2e1c1988736a8c3fb1f0c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Disclose projected subagent results in lifecycle rows based on run status

  • V2LifecycleRow now 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.
  • RelatedThreadCard gains an optional expandedDetail prop that renders an inline <details> disclosure block with data-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.
  • Full result disclosure is shown only for completed/failed subagents; cancelled and interrupted states omit it.
  • Test fixtures for subagent and subagent_v2 assert that parent lifecycle turn items carry matching results, and MessagesTimeline tests cover the full matrix of subagent states.
Macroscope summarized e439e41.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: ba8fa451-985d-42f5-8d42-59da880ecf5b

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: 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 rolled_back status is missing from terminal status handling, causing incorrect display behavior.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/c50ac2df41d4f3d3a7dafc3b4f7b039b9e6ffe0e/apps/web/src/components/chat/V2LifecycleRow.tsx#L32

      Subagents with status set to "cancelled" or "interrupted" will display their result in an expandable "full result" section, hiding progress or prompt. The backend preserves a previously streamed partial result when a subagent is later aborted (e.g., ProviderRuntimeRecoveryService emits { ...subagent, status: "cancelled" }), so that leftover partial output is incorrectly shown as a final result. The TERMINAL_SUBAGENT_STATUSES set used to detect a final result should exclude "cancelled" and "interrupted" (or otherwise distinguish completed results from aborted leftovers).

      ✅ Resolved in d11f70a4854b4ac7d5f5195823e6fdfed5e55507

    5. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d11f70a4854b4ac7d5f5195823e6fdfed5e55507. Configure [here](https://www.cursor.com/dashboard/bugbot).
    6. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/86a63f0c9abcf36dccb2e583fe72cf260b2e2301/apps/web/src/components/chat/V2LifecycleRow.tsx#L41

      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.
    7. PixPMusic(GitHub profile, opens in a new tab)commented

      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.

    8. Sorry, I'm unable to act on this request because you do not have permissions within this repository.

    9. juliusmarminge merged this8c3675c

    10. juliusmarminge closed this

Sign in to join this conversation.