Skip to content

bug(tui): shell footer count can become stale #35816

Closed

Description

@kitlangton

Problem

The V2 TUI footer can report more running shells than actually exist. This was observed on 0.0.0-next-15038, where a session showed 3 shells while only one command was still running.

Current behavior

The footer counts every entry returned by data.shell.list(currentLocation()) whose metadata.sessionID matches the current session. This includes all currently running shell-tool processes, whether the tool call is foreground or background. It does not count interactive session shell commands created without metadata.sessionID.

The client inventory is populated from /api/shell and updated by shell.created, shell.exited, and shell.deleted events. A shell-list response can race a lifecycle event and restore an already-exited shell to the client cache.

Open decisions

  • Should the footer represent all running shell-tool processes, only explicitly backgrounded shells, or another category?
  • Should foreground shell calls be shown separately from background jobs?
  • What ordering/reconciliation contract should inventory snapshots and lifecycle events provide?

PR #35814 contains one minimal race fix, but is being closed while these semantics are decided.

Activity

  1. kitlangton commented on Jul 11, 2026

    @kitlangton
    ContributorAuthor

    Reproduced again on 0.0.0-next-15329 at 2026-07-11T18:29:53Z (macOS 25.5.0, Warp). Session ses_0ae7c8e39ffeO1qHj9kTB5sVoj showed 5 shells in the footer after no shell commands remained.

    This instance matches the non-default-location lifecycle problem in #36185. The session location is /Users/kit/code/open-source, while the TUI was launched from the nested packages/opencode checkout. The footer reads the active session location's shell cache, but bootstrap/reconnect refreshes only the startup/default location. The server's canonical shell list for /Users/kit/code/open-source now returns [], while the attached TUI retained five cached entries.

    No fix attempted here. A focused TDD probe also confirmed that activating a non-default LocationProvider does not hydrate that location's shell inventory on current origin/v2 (66b9cc7931).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions