fix(tui): prevent subagent sessions from overwriting the selected agent#18498
fix(tui): prevent subagent sessions from overwriting the selected agent#18498Haohao-end wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Updated the PR description to use the template and linked the issue with Also, the current
Those files are unrelated to this PR’s TUI-only changes. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
Fixes #18404
Prevent child/subagent sessions from mutating the globally selected primary agent in the TUI.
This change gates both:
to root sessions only (
!session.parentID).As a result, subagent sessions no longer overwrite the selected primary agent after tool activity, while existing root-session behavior remains unchanged.
Testing
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsxpackages/opencode/src/cli/cmd/tui/routes/session/index.tsxbun typecheckcurrently fails in unrelatedpackages/appfiles