Skip to content

fix(session): prevent input window from reopening in child sessions#387

Merged
sudo-tee merged 1 commit into
sudo-tee:mainfrom
hermandavid:fix/child-session-input-visibility
May 25, 2026
Merged

fix(session): prevent input window from reopening in child sessions#387
sudo-tee merged 1 commit into
sudo-tee:mainfrom
hermandavid:fix/child-session-input-visibility

Conversation

@hermandavid
Copy link
Copy Markdown
Contributor

@hermandavid hermandavid commented May 23, 2026

Problem

In child sessions, the input window is intentionally hidden since users cannot message a child agent. However, pressing <tab> (or any keybinding that triggers focus_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.

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
@hermandavid
Copy link
Copy Markdown
Contributor Author

Failing CI is a pre-existing issue.

@sudo-tee
Copy link
Copy Markdown
Owner

Thanks for the PR. For the CI no worries. I know it was broken.

@sudo-tee sudo-tee merged commit a139cbf into sudo-tee:main May 25, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants