Skip to content

fix(client): "Subagent needs input" no longer sticks after the subagent finishes - #18996

Merged
shivamhwp merged 5 commits into
pingdotgg:mainfrom
shivamhwp:t3android/issue-18978
Oct 14, 2026
Merged

shivamhwp merged 5 commits into
pingdotgg:mainfrom
shivamhwp:t3android/issue-18978

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #18978

Problem

A subagent can leave an async question pending after its run ends (Codex does this on purpose so the question stays answerable). The parent's "Subagent needs input" pill counted any pending question on a child, so after the subagent finished, the parent kept showing the pill forever, even when it was just waiting on a plain reply from the user.

Fix

The shared childThreadInputsAtom now only counts a subagent's question while that subagent still has a live run (its activityRunStatus is set). A finished subagent stops lighting up the parent. A follow-up queued behind a run that is blocked on a question doesn't hide it. Older servers that don't send activityRunStatus fall back to the latest run's status. The question is still on the subagent's own thread if someone opens it.

This is in packages/client-runtime, so web, desktop and mobile all get it. It's client-only, so it also clears questions that are already stuck in existing databases.

Related: #18459 closes these questions on the server when a Codex task ends. That helps going forward, but questions that are already stuck stay pending. This PR fixes the pill either way.

Evidence

Android, POCO F4, dev client. Test data: a parent Claude thread delegated a tiny task, the subagent finished, and the parent ended with a plain question. A pending async question was left on the finished subagent (what a Codex subagent leaves behind).

Before (main) After (this PR)
Full video Full video

Before: the subagent shows Completed, but "Subagent needs input" still shows. After: no pill.

Testing

  • vp test run src/state/threadShell.test.ts in packages/client-runtime: new test covers running, queued-behind-a-blocked-run, completed and older-server shells. It fails without the fix, and the queued case fails with a status-only check.
  • Lint and typecheck for packages/client-runtime pass.

Fixed with Claude Opus 5.5 in Claude Code, run through T3 Code.

🤖 Generated with Claude Code

…nt finishes

A subagent's async question stays pending after its run ends, so the
parent kept showing the badge forever. Only count a subagent question
while that subagent's run is still live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 13, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 13, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at f726d1c

Macroscope's review found this PR approvable — The change is a narrowly scoped client-side bug fix that removes a stale “Subagent needs input” indicator while preserving active and queued-question cases. It adds targeted coverage and has no schema, server-processing, product-default, or static-analysis implications.

No code changes detected at afe50db. Prior analysis still applies.

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

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 496c0053-254f-45cb-ab26-0b957b1fafa8
📥 Commits

Reviewing files that changed from the base of the PR and between afe50db and 62c88e2.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b79d7e19-4ae8-4295-812b-8bfcf1c86bfd
📥 Commits

Reviewing files that changed from the base of the PR and between a53e4a8 and f726d1c.

📒 Files selected for processing (2)
  • packages/client-runtime/src/state/threadShell.test.ts
  • packages/client-runtime/src/state/threadShell.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

Child-thread input summaries now include pending user-input requests only when the child run is live and the child is not a provider-native subagent. The live-status check uses activityRunStatus when present and overall status for legacy snapshots.

Changes: Child-thread input summaries

Layer / File(s) Summary
Live child-run filtering
packages/client-runtime/src/state/threadShell.ts, packages/client-runtime/src/state/threadShell.test.ts
The child-input list now filters pending user-input requests by whether the child run is live. Tests cover running and queued children, completed children, and a completed legacy snapshot without activityRunStatus.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to f726d

The parent badge should clear when a subagent finishes while still appearing for live pending questions. No merge-blocking issue is identified.

### Architecture Summary

Architecture risk: 🟡 Medium · up to f726d

The change affects 1 system.

Changed systems: packages/client-runtime

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/client-runtime (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/client-runtime/src/state/threadShell.test.ts: The test adds the RuntimeRequestId import.
  • observed — Modified behavior in packages/client-runtime/src/state/threadShell.test.ts: The test adds the v2Now fixture import.
  • observed — Modified behavior in packages/client-runtime/src/state/threadShell.test.ts: A test is added for parent child-input aggregation: a running subagent with a pending user-input request is included, remains included when queued, and is excluded when completed. The test also checks exclusion for a completed legacy snapshot without activityRunStatus.
  • observed — Modified behavior in packages/client-runtime/src/state/threadShell.ts: Adds isChildRunLive: when activityRunStatus is defined, only a non-null value counts as live; otherwise, the helper checks whether status is preparing, starting, running, or waiting.

Reliability and maintainability

  • inferred — Risk-relevant change factors for packages/client-runtime: blast_radius_1; direct_dependents_1
Pre-merge checks: Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Issue #18978 requires the “Subagent needs input” badge to appear only while a subagent is waiting. childThreadInputsAtom now requires a pending user_input request and a live child run. It treats a…
Out of Scope Changes check Passed The pull request changes only the client-runtime child-input filter and its focused test. The live-run filter directly addresses issue #18978. The test supports that behavior and no unrelated change i…
Title check Passed The title clearly and concisely describes the main fix: preventing the “Subagent needs input” indicator from remaining after a subagent finishes.
Description check Passed The description explains the problem, expected behavior, implementation, scope, linked issues, evidence, focused tests, lint, typecheck, and manual verification. It uses “Fix” and “Testing” headings i…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 13, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 13, 2026 09:21

Dismissing prior approval to re-evaluate a53e4a8

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 13, 2026
… behind it

A queued follow-up becomes the child's latest run, so `status` read as
"queued" while the blocked run still waited on the answer. Check the
activity run instead and fall back to `status` for older servers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 13, 2026 09:22

Dismissing prior approval to re-evaluate f726d1c

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Oct 13, 2026
AdEx-Partners-DE added a commit to AdEx-Partners-DE/t3code that referenced this pull request Oct 13, 2026
…nt finishes (adopts upstream pingdotgg#18996)

Own diff of pingdotgg#18996 at f726d1c, applied on stark/main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shivamhwp
shivamhwp merged commit 109aaae into pingdotgg:main Oct 14, 2026
28 checks passed
aorwall added a commit to aorwall/t3code that referenced this pull request Oct 14, 2026
Merges `pingdotgg/t3code` up to `6002c5c68c` (42 commits, base
`5070a83a32`), using a merge commit. No open merge PR to stack on; this
branches from `main` at `882bb0a638`.

## Resolution

- **`package.json`** (conflict): dropped upstream's `tsc-rs` 0.6.0 bump
(pingdotgg#19187). The fork removed `tsc-rs`, and the `tsc-rs` tripwire holds
that. New path-policy entry: `root-package-json` (`decide`).
- **`pnpm-lock.yaml`** (conflict, `theirs`): took upstream's copy. Its
seven `tsc-rs@0.6.0` entries fail `minimumReleaseAge` before resolution
can prune them, so I stripped them and let `install.mjs` re-derive the
rest. The fork edges (`moatless-api`, `mermaid`) are back, and `verify
--only lockfile` passes.
- 14 other files that both sides touched merged without conflict.
`duplicate-adds` and `resolution-check` are both clean.
`FilePreviewPanel.tsx` (`decide`) took upstream's `threadRef` prop and
kept both fork deltas. The two unlisted files now have `converged`
entries: `terminal-drawer-open-in-editor` and `thread-shell-subtasks`.
In `threadShell.ts`, upstream's `isChildRunLive` and the fork's listing
filter merged together correctly.
- File counts: 136 files landed, against 136 in the upstream range. The
only differences are `package.json` (missing, because its one upstream
change was the dropped bump) and `docs/fork/inventory.json` (extra,
fork-only). The fork delta is 809 files.
- **Script fix:** Moatless replaced its dispatch match arms with a
`MethodTable` (moatless#1138). Because of that,
`unsupported-methods.mjs` found no arms and exited 2. It now reads
`.detached`/`.session`/`.stream` registrations and follows handlers
passed by name. Result: ADD 0, DROP 0, KEEP 2 (`vcs.switchRef`,
`git.preparePullRequestThread`), which matches `gaps.md`.

## Verification

`verify.mjs`: these checks pass: duplicate-adds, tripwires,
resolution-check, unsupported-methods (after the fix), lockfile, fmt,
lint, typecheck, build. `test` fails. Each of the failing files also
failed when run alone, and they are the same five files as in the
2026-10-13 merge, all caused by the sandbox: shared `AgentScope`, server
`ServerBrowserPage` (no Playwright browser), `AcpAdapterV2`,
`OrchestratorReplayFixtures`, and `OpenCodeServerLedger`.

## Usable as-is

- Full-screen visual replies with zoom (pingdotgg#17561). Links inside HTML
renders open the way chat links do (pingdotgg#18897). App shortcuts keep working
after you click into an HTML render (pingdotgg#18898).
- Touch-scrolling in terminal output (pingdotgg#11305). Fixed: answering a
question reset the editor caret (pingdotgg#11337). Links in agent questions are
now clickable (pingdotgg#19197).
- Fixed: "Subagent needs input" stayed after the subagent finished
(pingdotgg#18996). This is client-side and uses `activityRunStatus` with a
fallback to `status`.
- Slash skill search now works mid-message (pingdotgg#19107). Fixed: removing a
project opened a new thread for it (pingdotgg#15864). Settings now warn when an
environment silently drops a setting (pingdotgg#18334).
- Smaller fixes: context handoff details use the available width
(pingdotgg#19098), pace icon alignment (pingdotgg#18580), tool-call collection perf
(pingdotgg#18853), git file paths keep whitespace in the contract schema
(pingdotgg#12465), Android beta links (pingdotgg#18955).
- Pending context-handoff preview when you pick a model (pingdotgg#18369). It is
computed on the client from `server.providers`
(`requiresNewThreadForModelChange`, `continuation.groupKey`). If
Moatless does not report those fields, the preview shows a handoff on
every provider switch.

## Unsupported in Moatless / needs implementation

- Delegated tasks in separate worktrees (pingdotgg#19102): `isolation:
"worktree"` on the orchestrator MCP `delegate_task`, and
`workspaceStrategy` on the child-launch command. Moatless does not
create worktrees (`FEATURES.worktreeSelection`).
- These land behind flags that are already gated: scheduled-task dialog
fix (pingdotgg#18940, `scheduledTasks`), PR merge/auto-merge button sizing
(pingdotgg#18478, pingdotgg#19111, `pullRequestSurface`), remembering editor selections
(pingdotgg#19078, `openInEditor`), device tool startup failures (pingdotgg#18502,
`deviceHub`), npm "update everything" (pingdotgg#18709, `serverUpdateBanner`),
clone folder names in the welcome wizard (pingdotgg#12474), Cmd+Enter
create-project in the palette (pingdotgg#18901).
- No new RPC methods (ADD 0).

## Backend behavior to consider reproducing in Moatless

I added these to the "Runtime fixes upstream made to its own server"
entry in `docs/fork/gaps.md`:
- Worktree isolation for delegated tasks (pingdotgg#19102).
- Snoozed threads still take queued automatic wakes (pingdotgg#19099).
- Indexed failed-thread error lookup (pingdotgg#18628).
- SQLite: no fsync on every commit, and planner stats collected on open
(pingdotgg#19205, pingdotgg#18471).
- Distinct CI checks with overlapping names (pingdotgg#19162).
- Bitbucket short-hash heads in review guides (pingdotgg#18900).
- Webhook template backtracking (pingdotgg#19160).
- OpenCode timeout formatting (pingdotgg#12469).
- Pi tool schemas and turn-start queueing (pingdotgg#18643, pingdotgg#18639).
- Usage hubs without a host, and Antigravity accounts deduplicated
(pingdotgg#11368, pingdotgg#19207).
- Haiku 5.5 as the default for background text generation (pingdotgg#18781).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
Moatless task:
https://moatless.soaplabstest.com/tasks/db18f6dc-70c1-4d89-ada7-cd4b4f19a247
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 14, 2026
## What's Changed
* fix(claude): default background text generation to haiku 5.5 by @maria-rcks in pingdotgg/t3code#18781
* chore(typecheck): bump tsc-rs to 0.6.0 by @t3dotgg in pingdotgg/t3code#19187
* fix(server): keep OpenCode timeouts from crashing the error formatter by @tachytelicdetonation in pingdotgg/t3code#12469
* feat(server): run delegated tasks in separate worktrees by @Bil0000 in pingdotgg/t3code#19102
* fix(git): preserve whitespace in file paths (#12464) by @Defmon3 in pingdotgg/t3code#12465
* fix(server): stop fsyncing SQLite on every commit so slow disks no longer drop clients by @t3dotgg in pingdotgg/t3code#19205
* fix(chat): make links in agent questions clickable by @t3dotgg in pingdotgg/t3code#19197
* fix(usage): show one Antigravity account once, not once per machine by @t3dotgg in pingdotgg/t3code#19207
* fix(web): Android beta links point to the APK release, not the banned Google group by @shivamhwp in pingdotgg/t3code#18955
* fix(client): "Subagent needs input" no longer sticks after the subagent finishes by @shivamhwp in pingdotgg/t3code#18996
* fix(web): stop question answers from resetting the editor caret by @shivamhwp in pingdotgg/t3code#11337
* fix(web): app shortcuts keep working after clicking into an HTML render by @maria-rcks in pingdotgg/t3code#18898
* fix(source-control): keep distinct CI checks with overlapping names by @Lucenx9 in pingdotgg/t3code#19162
* fix(server): avoid excessive backtracking in webhook templates by @Lucenx9 in pingdotgg/t3code#19160
* fix(web): auto-merge button fits its label and animates width changes by @flamboh in pingdotgg/t3code#19111
* fix(web): scroll terminal output with touch gestures by @shivamhwp in pingdotgg/t3code#11305
* feat(web): view visual replies full screen with zoom by @Bil0000 in pingdotgg/t3code#17561
* fix(web): removing a project no longer opens a new thread for it by @shivamhwp in pingdotgg/t3code#15864
* fix(server): usage hubs with a host-less URL no longer vanish from Limits by @shivamhwp in pingdotgg/t3code#11368
* fix(mobile): search bar animates in on iOS 26+ instead of popping by @juliusmarminge in pingdotgg/t3code#19209

## New Contributors
* @Defmon3 made their first contribution in pingdotgg/t3code#12465

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261013.3080...v0.0.46-nightly.20261014.3093

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261014.3093
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 14, 2026
## What's Changed
* fix(claude): default background text generation to haiku 5.5 by @maria-rcks in pingdotgg/t3code#18781
* chore(typecheck): bump tsc-rs to 0.6.0 by @t3dotgg in pingdotgg/t3code#19187
* fix(server): keep OpenCode timeouts from crashing the error formatter by @tachytelicdetonation in pingdotgg/t3code#12469
* feat(server): run delegated tasks in separate worktrees by @Bil0000 in pingdotgg/t3code#19102
* fix(git): preserve whitespace in file paths (#12464) by @Defmon3 in pingdotgg/t3code#12465
* fix(server): stop fsyncing SQLite on every commit so slow disks no longer drop clients by @t3dotgg in pingdotgg/t3code#19205
* fix(chat): make links in agent questions clickable by @t3dotgg in pingdotgg/t3code#19197
* fix(usage): show one Antigravity account once, not once per machine by @t3dotgg in pingdotgg/t3code#19207
* fix(web): Android beta links point to the APK release, not the banned Google group by @shivamhwp in pingdotgg/t3code#18955
* fix(client): "Subagent needs input" no longer sticks after the subagent finishes by @shivamhwp in pingdotgg/t3code#18996
* fix(web): stop question answers from resetting the editor caret by @shivamhwp in pingdotgg/t3code#11337
* fix(web): app shortcuts keep working after clicking into an HTML render by @maria-rcks in pingdotgg/t3code#18898
* fix(source-control): keep distinct CI checks with overlapping names by @Lucenx9 in pingdotgg/t3code#19162
* fix(server): avoid excessive backtracking in webhook templates by @Lucenx9 in pingdotgg/t3code#19160
* fix(web): auto-merge button fits its label and animates width changes by @flamboh in pingdotgg/t3code#19111
* fix(web): scroll terminal output with touch gestures by @shivamhwp in pingdotgg/t3code#11305
* feat(web): view visual replies full screen with zoom by @Bil0000 in pingdotgg/t3code#17561
* fix(web): removing a project no longer opens a new thread for it by @shivamhwp in pingdotgg/t3code#15864
* fix(server): usage hubs with a host-less URL no longer vanish from Limits by @shivamhwp in pingdotgg/t3code#11368
* fix(mobile): search bar animates in on iOS 26+ instead of popping by @juliusmarminge in pingdotgg/t3code#19209

## New Contributors
* @Defmon3 made their first contribution in pingdotgg/t3code#12465

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261013.3080...v0.0.46-nightly.20261014.3093

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261014.3093
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:S 10-29 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.

[Bug]: "Subagent needs input" badge shows when no subagent is waiting (iOS)

2 participants