Skip to content

fix(web): Lineage shows threads an agent launched - #15031

Closed
t3dotgg wants to merge 3 commits into
mainfrom
t3code/fix-missing-subagent-status
Closed

t3dotgg wants to merge 3 commits into
mainfrom
t3code/fix-missing-subagent-status

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 3, 2026

Copy link
Copy Markdown
Member

When an agent starts threads with t3_thread_launch or create_threads, the thread that started them showed nothing in its Lineage panel. Six launched threads were running, but the launcher looked like no agents were active.

The launched threads were fine. They just had no link back to the thread that started them.

Now a launch records the caller as lineage.launchedByThreadId. Lineage lists those threads like subagents: running ones are expanded and counted in the header, and finished ones go under "Previous agents". The launched thread shows its launcher as "Parent thread". The field is optional, so older servers and clients still decode. The thread stays top-level: no parent, no merge-back, still in the sidebar. MCP t3_thread_list and t3_thread_read return the field too.

Threads launched before this change are not backfilled.

Before After
Before: six launched threads running, Lineage shows only Previous agents (4) After: Lineage shows 2 running launched threads and Previous agents (1)

Mobile has no Lineage view, so it is not affected.

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol on xhigh.

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

Threads started with t3_thread_launch or create_threads had no link to the
thread that started them, so the launcher's Lineage panel showed nothing
while they ran. Launches now record the caller as the optional
lineage.launchedByThreadId, and Lineage lists those threads like subagents,
with running ones counted in its header.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 3, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 3, 2026
Comment thread packages/contracts/src/orchestrationV2.ts
@macroscopeapp

macroscopeapp Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 696eedd

Macroscope's review found this PR approvable — This is a focused, backward-compatible fix that records which agent launched a top-level thread and displays that relationship in Lineage. It adds targeted coverage without changing thread execution, defaults, deployment behavior, or security-sensitive code.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
docs/internals/effect-services.md — configured

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 1d440a8c-fce5-4ac0-9a0c-dcc7a1b1afcf
📥 Commits

Reviewing files that changed from the base of the PR and between 736130c and 696eedd.

📒 Files selected for processing (18)
  • apps/server/src/mcp/OrchestratorMcpService.ts
  • apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts
  • apps/server/src/mcp/toolkits/project/handlers.test.ts
  • apps/server/src/mcp/toolkits/project/handlers.ts
  • apps/server/src/orchestration-v2/Orchestrator.ts
  • apps/server/src/orchestration-v2/ThreadLaunchService.test.ts
  • apps/server/src/orchestration-v2/ThreadLaunchService.ts
  • apps/server/src/orchestration-v2/ThreadManagementService.test.ts
  • apps/server/src/orchestration-v2/ThreadManagementService.ts
  • apps/web/src/components/chat/ThreadRelationshipsControl.agents.test.tsx
  • apps/web/src/components/chat/ThreadRelationshipsControl.tsx
  • docs/orchestration-v2/core-graph-and-data-model.md
  • docs/orchestration-v2/orchestrator-mcp-server.md
  • docs/orchestration-v2/thread-lineage-and-context-transfer.md
  • packages/client-runtime/src/state/threadRelationships.test.ts
  • packages/client-runtime/src/state/threadRelationships.ts
  • packages/contracts/src/orchestrationV2.ts
  • packages/contracts/src/orchestratorMcp.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Thread creation paths now record the launching thread in lineage. Runtime relationship data derives launch edges, and the chat relationship control displays launched threads according to status.

Changes

Launcher lineage

Layer / File(s) Summary
Record and expose launcher lineage
packages/contracts/src/orchestrationV2.ts, apps/server/src/orchestration-v2/ThreadLaunchService.ts, apps/server/src/mcp/toolkits/project/handlers.ts, apps/server/src/mcp/OrchestratorMcpService.ts, apps/server/src/orchestration-v2/Orchestrator.ts, apps/server/src/orchestration-v2/ThreadManagementService.ts, packages/contracts/src/orchestratorMcp.ts, apps/server/src/orchestration-v2/*test.ts, apps/server/src/mcp/*test.ts, apps/server/src/mcp/toolkits/project/handlers.test.ts, docs/orchestration-v2/*
The lineage and thread.create contracts accept an optional launchedByThreadId. Launch paths pass the caller’s thread ID, and the orchestrator stores it without setting parent lineage. Creation provenance removes client-supplied launcher IDs. MCP thread list items and details expose the ID or null. Tests and documentation cover these changes.
Derive and display launch relationships
packages/client-runtime/src/state/threadRelationships.ts, packages/client-runtime/src/state/threadRelationships.test.ts, apps/web/src/components/chat/ThreadRelationshipsControl.tsx, apps/web/src/components/chat/ThreadRelationshipsControl.agents.test.tsx
The relationship graph derives launch edges and uses activity-run status, or thread status when absent. The chat control groups started-agent relationships by status, counts running launch edges, and displays launched-thread rows with agent icons and provider drivers.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Caller as Calling agent thread
  participant ProjectHandler as Project handler
  participant ThreadLaunchService
  participant Orchestrator
  participant RelationshipGraph as Thread relationship graph
  participant ChatControl as Thread relationships control
  Caller->>ProjectHandler: Call t3_thread_launch
  ProjectHandler->>ThreadLaunchService: Pass launchedByThreadId
  ThreadLaunchService->>Orchestrator: Dispatch thread.create
  Orchestrator->>Orchestrator: Store launcher ID in lineage
  RelationshipGraph->>RelationshipGraph: Derive launch edge and status
  ChatControl->>RelationshipGraph: Read thread relationships
  ChatControl->>ChatControl: Group and display launched thread
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 696ee

The launcher lineage change is mergeable after normal checks; no concrete issue remains that requires a fix before merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem and change, and includes before-and-after screenshots. It omits the required scope and approval information and does not report focused tests or their results. Add the linked issue or maintainer approval and explain why the change qualifies for any scope exemption. Describe the focused tests or manual checks performed and their observed results. State anything that could not be checked; if tests w…
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 15 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: showing threads an agent launched in the Lineage view.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Resolution

Add the linked issue or maintainer approval and explain why the change qualifies for any scope exemption. Describe the focused tests or manual checks performed and their observed results. State anything that could not be checked; if tests were not run, say so.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 15 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Client-dispatched thread.create commands already get their createdBy
re-stamped at the WS boundary. Drop launchedByThreadId there too, so only
the server's agent launch paths can name a launcher thread.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 4.9 KiB 4.9 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.7 KiB 3.7 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.4 KiB 20.4 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 4.9 KiB 4.9 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.7 KiB 3.7 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 20.8 KiB 20.8 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 736130c · PR result: 696eedd · Source CI: success

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@juliusmarminge

Copy link
Copy Markdown
Member

i dont agree with this. this was a deliberate decision to not show.

spawning new threads and delegating task should be differnet. i expect threads in the sidebar and subagents in the lineage panel... agents spawns top level threads as a more detached option to delegated tasks, and thus they should not be in the lineage panel.

that's my 2 cents

@t3dotgg t3dotgg closed this Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants