Skip to content

fix(clients): a thread comes back when its subagent needs approval - #19630

Merged
t3dotgg merged 2 commits into
mainfrom
t3/subagent-approval-parent
Oct 14, 2026
Merged

t3dotgg merged 2 commits into
mainfrom
t3/subagent-approval-parent

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 14, 2026

Copy link
Copy Markdown
Member

Problem

When a delegated subagent waits on an approval, its parent thread stays in Working. You get no alert and no badge. You can't tell anything is waiting unless you open the subagent.

Subagent rows are hidden in the sidebar, and only the subagent's own thread summary carries its pending request. So the parent's status, the Working section, notifications, and the mobile list all say "working". #16634 already put a subagent's question in the parent's composer banner, but only questions, and only inside the open parent.

Fix

Each thread above a live subagent now carries what that subagent waits on (pendingSubagentRequest: approval or user_input). client-runtime works this out from the shell summaries clients already have, so nothing new goes over the wire.

  • Working section (web and mobile): the parent goes back to the active list.
  • Status (web sidebar and pill, mobile list): shows Pending Approval / Awaiting Input.
  • Notifications (web and desktop): "Approval needed" / "Input needed" fire on the parent.
  • Snooze: a snoozed parent wakes. A parent can't be snoozed while its subagent waits, the same as for its own requests.
  • Composer banner (web and mobile): "Subagent needs approval" with "Open approval", in addition to questions.

Nested subagents pass the request up to the visible thread. An approval outranks a question. Provider-native subagents are skipped, because they already ask on their parent. Each environment computes this once per shell change, and unchanged summaries keep their identity, so lists don't re-render.

Not included: mobile push and Live Activity alerts. They come from the server's agent-awareness relay, which also skips subagent threads. That is a separate server change.

Verification

  • threadShell.test.ts: a parent leaves Working when a nested subagent asks for a command approval, and goes back when the request clears. Fails without the fix.
  • ThreadNotificationCoordinator.test.tsx: the parent alerts "Approval needed" while its own summary object does not change. Fails without the fix.
  • threadSnoozed.test.ts: canSnooze refuses a parent whose subagent waits.
  • Tests for the touched files pass. Typecheck passes for client-runtime, web, and mobile.
  • Live check by the original author in a dev client: a Codex parent delegated a task with runtimeMode: "approval-required", and the child asked for a command approval. Only the client files were swapped between main and this change.
Before (main) After
Before: parent stays in Working After: parent shows Approval and the banner
"Open approval" opens the child's request Alert while another thread is open
Open approval goes to the child's approval card Approval needed toast for the parent

Credit

Takes over #19614 by @LovelyCodeMonkey. Their commit is kept as is. I added the snooze guard on top.

Reviewed with sol-loop: 1 round with GPT-6.1-Sol.

Written by Claude Opus 5.5 in Claude Code, run from T3 Code.

🤖 Generated with Claude Code

LovelyCodeMonkey and others added 2 commits October 14, 2026 14:20
A delegated subagent waiting on an approval left its parent in the
Working section with no alert, because subagent rows are hidden and
only the subagent's own shell carried the request. Threads above a live
subagent now carry what it waits on: the Working section returns the
thread, the sidebar and mobile list show the approval or question, web
alerts fire on the parent, a snoozed parent wakes, and the parent's
banner covers approvals as well as questions.
Snoozing it would wake it again at once, because a subagent's request
raises the parent's hand.

Co-Authored-By: lovelycodemonkey <ghassemimahyad@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 14, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 14, 2026
@github-actions github-actions Bot added the size:L 100-499 changed lines (additions + deletions). label Oct 14, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This change propagates hidden subagent approval/input state into shared client runtime behavior, affecting inbox placement, statuses, notifications, banners, and snooze behavior across web and mobile. The intent is clear and tested, but the breadth of existing-path changes and nontrivial shared-state logic warrant human review.

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

@github-actions

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 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 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.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB −7 B (−0.1%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB −7 B (−0.6%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 348f217 · PR result: 7d0f426 · 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: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

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

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 02d00fbc-c6aa-4b3b-9de0-96b608c92db4
📥 Commits

Reviewing files that changed from the base of the PR and between 348f217 and 7d0f426.

📒 Files selected for processing: 13
  • apps/mobile/src/features/home/useThreadListActions.ts
  • apps/mobile/src/features/threads/ThreadDetailScreen.tsx
  • apps/mobile/src/features/threads/threadListV2.ts
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/Sidebar.logic.ts
  • apps/web/src/components/ThreadNotificationCoordinator.test.tsx
  • apps/web/src/components/ThreadNotificationCoordinator.tsx
  • packages/client-runtime/src/state/models.ts
  • packages/client-runtime/src/state/threadInbox.ts
  • packages/client-runtime/src/state/threadSettled.ts
  • packages/client-runtime/src/state/threadShell.test.ts
  • packages/client-runtime/src/state/threadShell.ts
  • packages/client-runtime/src/state/threadSnoozed.test.ts

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

📝 Walkthrough

The runtime now derives pending approval and input requests from eligible subagents and propagates them to parent thread shells. Thread state, notifications, and mobile and web interfaces use these requests to update working status, snooze eligibility, alerts, and displayed labels.

Changes: Subagent request handling

Layer / File(s) Summary
Derive and propagate subagent requests
packages/client-runtime/src/state/models.ts, packages/client-runtime/src/state/threadShell.ts, packages/client-runtime/src/state/threadShell.test.ts
The runtime classifies eligible subagent requests, propagates them through parent threads, and includes them in presented shells and child-input lists. Tests cover nested subagent approval state.
Apply requests to working and snooze state
packages/client-runtime/src/state/threadInbox.ts, packages/client-runtime/src/state/threadSettled.ts, packages/client-runtime/src/state/threadSnoozed.test.ts, apps/mobile/src/features/home/useThreadListActions.ts, apps/mobile/src/features/threads/threadListV2.ts
Pending subagent requests affect working status, snooze eligibility, and thread-list status. Snooze tests cover pending approval requests.
Show requests in notifications and thread interfaces
apps/web/src/components/ThreadNotificationCoordinator.tsx, apps/web/src/components/ThreadNotificationCoordinator.test.tsx, apps/web/src/components/ChatView.tsx, apps/web/src/components/Sidebar.logic.ts, apps/mobile/src/features/threads/ThreadDetailScreen.tsx
The notification coordinator detects changed requests and emits an approval alert. Mobile and web interfaces display request-specific labels, icons, and status.

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ThreadNotificationCoordinator
  participant RequestMap
  participant ThreadShell
  participant InAppAlert
  ThreadNotificationCoordinator->>RequestMap: derive pending requests by parent thread
  RequestMap-->>ThreadNotificationCoordinator: return request kinds
  ThreadNotificationCoordinator->>ThreadShell: present parent with its request
  ThreadNotificationCoordinator->>InAppAlert: emit approval alert when request changes
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 7d0f4

Parent threads can surface delegated approval and input requests across the affected status and notification paths. No issue identified here blocks merging after normal checks.

Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title is concise, uses the conventional commit format, and clearly identifies the main fix: restoring parent-thread visibility when a subagent needs approval.
Description check Passed The description clearly covers the problem, implementation, scope boundaries, verification, and UI evidence. It uses a “Fix” heading instead of the template’s “Change” heading and does not include a s…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@t3dotgg
t3dotgg merged commit f4df794 into main Oct 14, 2026
34 checks passed
@t3dotgg
t3dotgg deleted the t3/subagent-approval-parent branch October 14, 2026 22:53
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 15, 2026
## What's Changed
* fix(server): only Claude progress updates before a tool call show as text by @maria-rcks in pingdotgg/t3code#18923
* fix(pr): keep known state in sync across controls by @maria-rcks in pingdotgg/t3code#18408
* fix(web): review summary only says optional when it is by @flamboh in pingdotgg/t3code#18451
* fix(web): subagent lists in the composer banner no longer start lines with a comma by @flamboh in pingdotgg/t3code#19170
* fix(web,mobile): pull request filters no longer offer the Scratch folder by @flamboh in pingdotgg/t3code#19179
* fix(web,mobile): pull request project filter follows the sidebar order by @flamboh in pingdotgg/t3code#19180
* feat(settings): inactivity auto-settle can keep threads with a PR by @tris203 in pingdotgg/t3code#14642
* fix(server): Claude works next to an enterprise managed-mcp.json by @SunkenInTime in pingdotgg/t3code#18706
* fix(web,mobile): muse code uses meta's official blue logo by @maria-rcks in pingdotgg/t3code#19562
* fix(desktop): import CA trust variables from the login shell by @maria-rcks in pingdotgg/t3code#19604
* fix(server): preview copy only forwards text from the viewer's copy keys by @maria-rcks in pingdotgg/t3code#19561
* fix(muse): Supervised threads ask before commands again by @maria-rcks in pingdotgg/t3code#19558
* fix(server): restarts no longer stall on old subagent result deliveries by @t3dotgg in pingdotgg/t3code#19631
* fix(clients): a thread comes back when its subagent needs approval by @t3dotgg in pingdotgg/t3code#19630
* fix(usage): cold usage scans no longer stall the server by @t3dotgg in pingdotgg/t3code#19446
* fix(server): "Always allow this session" stops Codex asking for every command by @t3dotgg in pingdotgg/t3code#19635
* fix(web): keep vertical cursor stops outside styled markers by @Yash-Singh1 in pingdotgg/t3code#19651
* fix(web): mermaid code toggle stays in place when switching views by @maria-rcks in pingdotgg/t3code#19601


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261014.3118...v0.0.46-nightly.20261014.3132

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261014.3132
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 15, 2026
## What's Changed
* fix(server): only Claude progress updates before a tool call show as text by @maria-rcks in pingdotgg/t3code#18923
* fix(pr): keep known state in sync across controls by @maria-rcks in pingdotgg/t3code#18408
* fix(web): review summary only says optional when it is by @flamboh in pingdotgg/t3code#18451
* fix(web): subagent lists in the composer banner no longer start lines with a comma by @flamboh in pingdotgg/t3code#19170
* fix(web,mobile): pull request filters no longer offer the Scratch folder by @flamboh in pingdotgg/t3code#19179
* fix(web,mobile): pull request project filter follows the sidebar order by @flamboh in pingdotgg/t3code#19180
* feat(settings): inactivity auto-settle can keep threads with a PR by @tris203 in pingdotgg/t3code#14642
* fix(server): Claude works next to an enterprise managed-mcp.json by @SunkenInTime in pingdotgg/t3code#18706
* fix(web,mobile): muse code uses meta's official blue logo by @maria-rcks in pingdotgg/t3code#19562
* fix(desktop): import CA trust variables from the login shell by @maria-rcks in pingdotgg/t3code#19604
* fix(server): preview copy only forwards text from the viewer's copy keys by @maria-rcks in pingdotgg/t3code#19561
* fix(muse): Supervised threads ask before commands again by @maria-rcks in pingdotgg/t3code#19558
* fix(server): restarts no longer stall on old subagent result deliveries by @t3dotgg in pingdotgg/t3code#19631
* fix(clients): a thread comes back when its subagent needs approval by @t3dotgg in pingdotgg/t3code#19630
* fix(usage): cold usage scans no longer stall the server by @t3dotgg in pingdotgg/t3code#19446
* fix(server): "Always allow this session" stops Codex asking for every command by @t3dotgg in pingdotgg/t3code#19635
* fix(web): keep vertical cursor stops outside styled markers by @Yash-Singh1 in pingdotgg/t3code#19651
* fix(web): mermaid code toggle stays in place when switching views by @maria-rcks in pingdotgg/t3code#19601


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261014.3118...v0.0.46-nightly.20261014.3132

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261014.3132
coreybain pushed a commit to SpiritDevs/pathway that referenced this pull request Oct 15, 2026
Subagent rows are hidden from the threads list, and only a subagent's own
shell summary carried its pending approval or question. A parent whose
delegated subagent was blocked on the user stayed in Working, kept its
snooze or explicit settle, and gave no sign that anything waited.

client-runtime now derives, per environment, what a live subagent below
each thread waits on (`pendingSubagentRequest`: approval or user_input)
from the shell summaries clients already hold, so no child transcript is
subscribed and nothing new crosses the wire. Nested subagents pass the
request up the same-environment parent chain; an approval outranks a
question; non-blocking questions and requests left on a finished
subagent run don't count. The derived map keeps its identity while
unchanged, presentations are cached per source and request, and the
roster key includes the field, so unrelated rows keep their identity.

The field drives the web/desktop sidebar status and pill, the Working
shelf, Needs attention sorting, the workspace overview, snooze wake and
the snooze guard, and the settled blockers. iOS derives the same state
in its lifecycle partition for the status badge, snooze/settle sections,
the Needs attention filter, and the snooze menu. Alerts already fire on
the subagent's own thread from the server's attention events.

Ported from pingdotgg/t3code#19630.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sandscooling pushed a commit to sandscooling/t3code that referenced this pull request Oct 15, 2026
Sync 1014d: 15 upstream commits, including pingdotgg#19630 (a thread comes back
when its subagent needs approval), pingdotgg#19656 (Reveal in File Explorer works
on Windows again) and pingdotgg#19675 (busy-thread command perf). The fork's
completion alert rules (Wait hold, quiet crew completions, PR watch
re-arm) keep working beside the subagent approval alert. A fork browser
test casts the screencast listener upstream retyped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adampeterhiggins added a commit to adampeterhiggins/t3code that referenced this pull request Oct 15, 2026
* fix(server): only Claude progress updates before a tool call show as text (pingdotgg#18923)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

* fix(pr): keep known state in sync across controls (pingdotgg#18408)

* fix(web): review summary only says optional when it is (pingdotgg#18451)

* fix(web): subagent lists in the composer banner no longer start lines with a comma (pingdotgg#19170)

* fix(web,mobile): pull request filters no longer offer the Scratch folder (pingdotgg#19179)

* fix(web,mobile): pull request project filter follows the sidebar order (pingdotgg#19180)

* feat(settings): inactivity auto-settle can keep threads with a PR (pingdotgg#14642)

Co-authored-by: maria-rcks <maria@kuuro.net>

* fix(server): Claude works next to an enterprise managed-mcp.json (pingdotgg#18706)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web,mobile): muse code uses meta's official blue logo (pingdotgg#19562)

* fix(desktop): import CA trust variables from the login shell (pingdotgg#19604)

* fix(server): preview copy only forwards text from the viewer's copy keys (pingdotgg#19561)

* fix(muse): Supervised threads ask before commands again (pingdotgg#19558)

* fix(server): restarts no longer stall on old subagent result deliveries (pingdotgg#19631)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(clients): a thread comes back when its subagent needs approval (pingdotgg#19630)

A delegated subagent waiting on an approval or question now shows on its parent thread: Working section, status badge, notifications, snooze, and the composer banner on web and mobile. Takes over pingdotgg#19614.

Co-authored-by: lovelycodemonkey <ghassemimahyad@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(usage): cold usage scans no longer stall the server (pingdotgg#19446)

Co-authored-by: Victor Vogel <263261067+only21mil@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): "Always allow this session" stops Codex asking for every command (pingdotgg#19635)

After "Always allow this session", the Codex adapter answers later command (or file change) approvals in that thread for the rest of the session. A turn in another runtime mode, or the thread unloading, ends it. Takes over pingdotgg#19598.

Co-authored-by: lovelycodemonkey <ghassemimahyad@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): keep vertical cursor stops outside styled markers (pingdotgg#19651)

* fix(web): mermaid code toggle stays in place when switching views (pingdotgg#19601)

* fix(server): Reveal in File Explorer and browser launches work on Windows again (pingdotgg#19656)

Windows PowerShell started with detached: true exits 0 without running its command. Native Windows PowerShell launches (reveal and browser) now start attached, unref'd, with ignored stdio.

Takes over pingdotgg#10387. Fixes pingdotgg#11780.

Co-authored-by: doubletwisted <118005273+doubletwisted@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): GitHub App tokens can merge and use other write actions (pingdotgg#19103)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* perf(server): commands on busy threads stop decoding thousands of finished tool nodes (pingdotgg#19675)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): use workspace-scoped Bitbucket permissions API (pingdotgg#10984)

Co-authored-by: RealDoc06 <73218979+RealDoc06@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(composer): read dropped threads across environments (pingdotgg#15210)

* test(web): remove duplicate change request parser tests (pingdotgg#13591)

Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>

* fix(server): a delegated task's question ends the parent's blocking wait (pingdotgg#19538)

Co-authored-by: maria-rcks <maria@kuuro.net>

* fix(server): a delegated task's question now wakes its parent agent (pingdotgg#19521)

Co-authored-by: maria-rcks <maria@kuuro.net>

* fix(server): a cancelled delegated task no longer shows its child's question (pingdotgg#18459)

Co-authored-by: maria-rcks <maria@kuuro.net>

* feat(storage): clean up settled thread worktrees (pingdotgg#15208)

Co-authored-by: maria-rcks <maria@kuuro.net>

* feat(web,mobile): waiting status shows a dot-dashed icon and a timer (pingdotgg#19617)

* feat(pr): delete branches after merge or close (pingdotgg#19257)

---------

Co-authored-by: maria <maria@kuuro.net>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: oliver <97427849+flamboh@users.noreply.github.com>
Co-authored-by: Tristan Knight <admin@snappeh.com>
Co-authored-by: Dara Adedeji <76637177+SunkenInTime@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: lovelycodemonkey <ghassemimahyad@gmail.com>
Co-authored-by: Victor Vogel <263261067+only21mil@users.noreply.github.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
Co-authored-by: doubletwisted <118005273+doubletwisted@users.noreply.github.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Sebastian Pugliese <73218979+RealDoc06@users.noreply.github.com>
Co-authored-by: Bilal Bakr <62337003+Bil0000@users.noreply.github.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
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: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.

3 participants