Skip to content

fix(tui): keep the subagent activity filter across navigation - #53318

Merged
nexxeln merged 2 commits into
v2from
subagent-inactive-toggle
Oct 5, 2026
Merged

nexxeln merged 2 commits into
v2from
subagent-inactive-toggle

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

What

ctrl+a in the subagents composer is now a pure toggle: choosing a subagent with enter keeps the active/inactive filter instead of snapping back to "active".

Why

The session route is keyed by sessionID, so navigating to a subagent remounts the composer and SubagentsTab recreated its store with active: true. Closing the composer also explicitly reset the filter.

How

  • Keep the filter in useStorage().memory("subagents-filter") so it survives the route remount for the life of the TUI process (not persisted to disk).
  • Only composer.subagent.toggle-activity changes it; closing the composer still resets the selection, but no longer the filter.

Verification

  • New test in composer-keymap.test.tsx mounts the composer keyed by route session like the app does, toggles to inactive, presses enter, and checks that the child session still shows inactive subagents, then toggles back. It fails on origin/v2 and passes with this change.
  • bun test test/cli/tui/composer-keymap.test.tsx (7 pass) and bun run typecheck in packages/tui.
  • End-to-end opencode-drive run against origin/v2 (4fb8007) and this branch, with one finished and one running background subagent: before, enter on the finished subagent reopens the picker on "Running" only. After, the picker stays on inactive and ctrl+a still flips it back. The demo video is in the requesting Slack thread, because the GitHub App token can't upload PR attachments.

Requested by: @nexxeln (nexxel via Slack)

@nexxeln
nexxeln merged commit eb2f0d5 into v2 Oct 5, 2026
8 of 9 checks passed
@nexxeln
nexxeln deleted the subagent-inactive-toggle branch October 5, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant