fix(session): restore subagent mode from messages - #397
Merged
Conversation
Collaborator
Author
jensenojs
marked this pull request as draft
June 1, 2026 03:52
jensenojs
force-pushed
the
fix/restore-subagent-mode
branch
from
June 1, 2026 04:46
244f4b3 to
6f9fdd1
Compare
jensenojs
marked this pull request as ready for review
June 1, 2026 04:46
Hidden subagents are filtered out of the visible primary-agent list so primary agents cannot discover them by default. That visibility rule should not affect restoring an existing session's agent type. When restoring a session, the tabbar/footer and subsequent message routing should use the agent type recorded on the session messages. Filtering msg.info.mode through the visible primary-agent list caused hidden subagent sessions to keep a stale primary mode in state.current_mode.
jensenojs
force-pushed
the
fix/restore-subagent-mode
branch
from
June 1, 2026 04:52
6f9fdd1 to
dfaa72e
Compare
Owner
|
This one is related to #382. This will make primary session inherit hidden subagent if they are the last message in that session. I don;t know if there is a check we could do here for this ? The #382 fixed an issue where mode was set to COMPACTION when reading a compacted session with no way to actually get out of that mode. Maybe only do this set_mode when the current session is a child ? What do you think ? |
Collaborator
Author
Owner
|
Thanks for the fix |
disrupted
pushed a commit
to disrupted/opencode-native.nvim
that referenced
this pull request
Jul 23, 2026
* fix(session): restore subagent mode from messages Hidden subagents are filtered out of the visible primary-agent list so primary agents cannot discover them by default. That visibility rule should not affect restoring an existing session's agent type. When restoring a session, the tabbar/footer and subsequent message routing should use the agent type recorded on the session messages. Filtering msg.info.mode through the visible primary-agent list caused hidden subagent sessions to keep a stale primary mode in state.current_mode. * fix(session): scope hidden mode restore to child sessions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Hidden subagents are filtered out of the visible primary-agent list so primary agents cannot discover them by default. That visibility rule should not affect restoring an existing session's agent type.
When restoring a session, the tabbar/footer and subsequent message routing should use the agent type recorded on the session messages. Filtering msg.info.mode through the visible primary-agent list caused hidden subagent sessions to keep a stale primary mode in state.current_mode.