Skip to content

fix(clients): Open question on a linked-environment subagent opens its thread, not a new one - #26492

Open
RealDoc06 wants to merge 1 commit into
pingdotgg:mainfrom
RealDoc06:fix/open-question-linked-environment
Open

RealDoc06 wants to merge 1 commit into
pingdotgg:mainfrom
RealDoc06:fix/open-question-linked-environment

Conversation

@RealDoc06

@RealDoc06 RealDoc06 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A subagent delegated to a linked environment asked a question. The parent thread showed "Subagent needs input", but clicking Open question opened a blank New thread page instead of the subagent's thread.

The child-input list gathers children from every connected environment, but the banner passed only the child's thread id, and the open handler scoped it to the parent's environment. That route doesn't exist on the parent's server, so it fell back to a new-thread draft. Mobile had the same bug.

Fix

  • Web: the banner hands over the child's full ref (environmentId + threadId), and onOpenRelatedThread accepts either a bare id (same environment, as before) or a ref. The banner's callback is typed as ScopedThreadRef, so it can't pass a bare id again.
  • Mobile: the child-input pill opens the child in its own environment.

Local subagents behave as before because their environment is the parent's. The remote-child "Open" in timeline rows already navigates this way (V2LifecycleRow).

Checks: vp run check:changed passes (format, lint, knip, typecheck for web and mobile). No test added: the type on the callback now guarantees the environment is passed.

Before / after

Before (current release): Open question on a subagent that runs on a linked environment lands on a blank New thread page.

before

After (this branch): the same click opens the subagent's thread on its own environment, with the question ready to answer.

after

How the after capture was made: two dev servers from this branch with Linked environments on, A linked to B and B added to A's web client. A Haiku thread on A ran delegate_task targeting B with the Replay (dev) question scenario. When the parent showed "Subagent needs input", I clicked Open question. Not checked: the mobile pill on a device.

Scope

Submitted without a prior issue under the small, focused fix exception: the button visibly does the wrong thing, the intended behavior is unambiguous, and the fix only passes the subagent's environment through on web and mobile.

Council review

Rounds: 1

Delegate Round 1
Claude Opus 9/10
GPT Sol 9/10
Muse Wonder 8/10

All three: merge, no blocking issues.

Created with Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running in T3 Code.

…s thread

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 28, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b615419

Macroscope's review found this PR approvable — Child-input actions now open the subagent thread in its own environment on web and mobile. This is a contained navigation correction that preserves existing same-environment behavior and availability safeguards.

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

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5211acf and b615419.

Files selected for processing: 3
  • apps/mobile/src/features/threads/ThreadDetailScreen.tsx
  • apps/web/src/components/chat/ThreadActivityBanners.tsx
  • apps/web/src/components/chat/useThreadLifecycle.tsx

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

Walkthrough

Child-thread navigation now preserves the child’s environment in web and mobile actions. Web lifecycle handling resolves bare thread IDs against the current environment and checks scoped references against their own environment.

Changes: Child thread navigation

Layer / File(s) Summary
Pass child environment when opening threads
apps/web/src/components/chat/ThreadActivityBanners.tsx, apps/web/src/components/chat/useThreadLifecycle.tsx, apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Web child links and actions pass scoped thread references, and liveness checks use the resolved reference’s environment. Mobile child actions pass the child’s environment when opening linked threads.

Priority: Normal

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

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#23795: Updates mobile linked-thread navigation in ThreadDetailScreen; this change also preserves the child environment when opening a linked thread.
  • pingdotgg/t3code#24985: Updates linked child-thread handling in ThreadDetailScreen; this change also modifies child-thread navigation to retain the child environment.
  • pingdotgg/t3code#25401: Defines the child-input open action that this change updates to pass a scoped thread reference.

Suggested labels: size:XS

Suggested reviewers: juliusmarminge

Merge Risk: Low · up to b6154

Some mobile notifications for linked child threads may open the wrong or blank thread, but the impact is limited to that navigation path.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title names the main change: the Open question action on a subagent in a linked environment now opens that subagent's thread instead of a new thread. It follows the conventional commit format and …
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.
Description check Passed The description clearly explains the problem, the web and mobile changes, the small-fix approval exception, verification results, limitations, and before/after UI evidence. It uses "Fix" and "Scope" i…
Full details: Title check

Explanation

The title names the main change: the Open question action on a subagent in a linked environment now opens that subagent's thread instead of a new thread. It follows the conventional commit format and uses plain language. The changeset matches it: the banner passes the child's environmentId with its thread id, and mobile opens the child in its own environment.

Full details: Description check

Explanation

The description clearly explains the problem, the web and mobile changes, the small-fix approval exception, verification results, limitations, and before/after UI evidence. It uses "Fix" and "Scope" instead of the template headings "Change" and "Scope and approval," but all required information is present.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants