fix(session): prevent input window from reopening in child sessions#387
Merged
sudo-tee merged 1 commit intoMay 25, 2026
Merged
Conversation
Pressing <tab> or triggering focus_input in a child session could re-show the input window that was intentionally hidden on session switch. The root cause was that toggle_pane, ui.focus_input, and input_window._show had no awareness of child session state. Add child-session guards at three layers: - input_window._show(): safety net at the lowest level, prevents the window from ever being recreated during a child session - ui.focus_input(): early return so service-layer callers (agent_model, session_runtime) cannot accidentally reveal the input - ui.toggle_pane(): early return so <tab> stays on the output pane
Contributor
Author
|
Failing CI is a pre-existing issue. |
Owner
|
Thanks for the PR. For the CI no worries. I know it was broken. |
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.
Problem
In child sessions, the input window is intentionally hidden since users cannot message a child agent. However, pressing
<tab>(or any keybinding that triggersfocus_input/toggle_pane) while viewing a child session reopens the input window.Solution
Add child-session guards at three layers, enforcing the invariant closer to where the input window is actually shown:
input_window._show()— safety net at the lowest level. Since_show()is the only function that physically recreates the input window, this single guard prevents all current and future callers from accidentally revealing input during a child session.ui.focus_input()— early return so service-layer callers (agent_model,session_runtime) don't attempt to focus a window that should not exist.ui.toggle_pane()— early return so<tab>in the output pane stays on the output instead of trying to show and focus the hidden input.