Skip to content

fix(chat): link agent attribution to its source thread - #12971

Merged
juliusmarminge merged 3 commits into
t3code/codex-turn-mappingfrom
fix/agent-message-source-link
Sep 22, 2026
Merged

juliusmarminge merged 3 commits into
t3code/codex-turn-mappingfrom
fix/agent-message-source-link

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Agent-created threads show "Sent by another agent" as plain text, so users cannot return to the thread that sent the prompt.

Store an optional sending thread ID on agent messages and expose the attribution as a source-thread button on web, desktop, and mobile. Track the source for MCP thread creation and sends, delegated tasks, and native subagent prompts, and preserve it through queueing and steering. Older messages without a sender ID retain their existing attribution.

Validation: 262 focused tests passed after rebasing, including native subagent coverage. Server, web, contracts, and mobile typechecks passed. The built-in Browser panel verified navigation to the source in the current environment using disposable synthetic data. Lint and React Doctor reported existing issues outside the additions. Native mobile UI was not exercised.

Final head: 22442fb0e27, based on t3code/codex-turn-mapping at 72a0226be4a. Both UI review threads are resolved. Macroscope declined automatic approval because the source metadata spans runtime and multiple clients; human review is needed.

CI blocker: Test Server 2 fails in SelectionRestart.integration.test.ts, “restarts selection as a new attempt and retries after old-session cleanup.” The identical failure reproduces on untouched base revision 72a0226be4a, with baseline server code and contracts. The final CI run has the same sole test failure; the other executed validation jobs passed. This PR does not change that retry behavior. After the review fix, all 66 timeline tests, web typecheck, and targeted lint passed; source navigation was verified again.

Before, actual base revision. The attribution is plain text.

Before: plain agent attribution

After, PR head with the same fixture, viewport, and scroll. The attribution is a button; its appearance changes on hover or keyboard focus.

After: attribution links to the sending thread

Recording: open the sending thread

Model: GPT-6. Harness: Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 22, 2026
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
@macroscopeapp

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

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

Baseline: unavailable · PR result: 22442fb · Source CI: failure

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.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 22, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This change adds source-thread attribution as a new interactive capability and propagates new metadata across MCP, delegation, native subagents, queueing, provider adapters, web, and mobile. The additive contract shape is backward compatible, but the cross-cutting runtime and user-interface impact exceeds a narrowly self-contained fix.

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

@macroscopeapp
macroscopeapp Bot dismissed their stale review September 22, 2026 01:07

Dismissing prior approval to re-evaluate 783c352

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
@macroscopeapp

This comment has been minimized.

1 similar comment
@macroscopeapp

This comment has been minimized.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 22, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 22, 2026 01:11

Dismissing prior approval to re-evaluate 22442fb

@juliusmarminge
juliusmarminge merged commit 7ed0d88 into t3code/codex-turn-mapping Sep 22, 2026
26 of 27 checks passed
@juliusmarminge
juliusmarminge deleted the fix/agent-message-source-link branch September 22, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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.

1 participant