Skip to content

test(drive): add running-indicator gauntlet and reconnect family probe - #105

Merged
kitlangton merged 1 commit into
mainfrom
stale-running-gauntlet
Oct 4, 2026
Merged

kitlangton merged 1 commit into
mainfrom
stale-running-gauntlet

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Why

A V2 TUI showed a session as running in the open picker hours after the session and all of its subagents had gone idle. The picker's spinner depends on a client store fed by live execution events plus a /api/session/active snapshot on reconnect, and no probe exercised that contract against subagents, interrupts, and connection faults.

What Changes

Two manual TUI regression probes:

Probe Shape Invariant
stale-running.ts Seeded state machine Once the server's active set is stable, each root's picker spinner equals "root or a descendant is in /api/session/active"
reconnect-child-family.ts Deterministic reduction of seed 5 A background child started while the TUI is offline still marks its root as running after reconnect

The gauntlet creates roots and prompts through the clean SDK, so the TUI only observes. Its transitions are:

  • foreground and background subagents, each child streaming a short reply or held (with or without output) until released
  • SDK interrupts of children and roots, and double Escape in the TUI
  • latency, blackhole, and connection-kill windows on TUI traffic only

Each passing verification prints the observed spinner map, so a seed that never checked a running root is visible.

Picker Rows Only. The parser reads only rows below the picker's filter input. The tab strip behind the dialog also draws titles with spinners, but its busy state includes queued inbox items. An earlier draft of the parser read the tab strip and reported false divergences on seeds 4 and 8.

Findings

Seed 5 found a real divergence on current V2. A connection kill landed 7ms before a background child was created, so the TUI missed session.created. The reconnect snapshot restored active[child] = "running", but the child never joined its root's family, so the root row stayed idle while the child ran. The OpenCode fix is anomalyco/opencode#53012. The deterministic probe fails on V2 d1f8f5b35e and passes with that fix.

Scope

These are test-only additions under test/manual/tui-regressions, plus README sections. A follow-up should add file-backed service restarts as gauntlet transitions; the original stale-spinner report happened in an environment with frequent managed-service restarts, which this gauntlet does not exercise yet.

Verification

bun run check
bun run --cwd packages/drive drive check test/manual/tui-regressions/stale-running.ts
bun run --cwd packages/drive drive check test/manual/tui-regressions/reconnect-child-family.ts

# 40-step gauntlet seeds
OPENCODE_DRIVE_SEED=$seed OPENCODE_DRIVE_STEPS=40 \
  bun run --cwd packages/drive drive start --daemon --name stale-running-$seed \
  --script test/manual/tui-regressions/stale-running.ts --dev "$OPENCODE_DEV"

# Deterministic probe against the base and the fix
OPENCODE_DRIVE_LABEL=BEFORE ... reconnect-child-family.ts --dev <opencode d1f8f5b35e>
OPENCODE_DRIVE_LABEL=AFTER  ... reconnect-child-family.ts --dev <opencode fix branch>
  • bun run check passes.
  • Against V2 d1f8f5b35e, seeds 1–4 and 6–12 passed; seed 5 failed twice at the same checkpoint with the divergence above. Seeds 6, 7, 8, 9, and 11 verified running roots as well as idle ones.
  • Against the fix branch, seeds 4, 5, and 8 passed; seed 5 verified a running root at the checkpoint that previously failed.
  • reconnect-child-family.ts failed on d1f8f5b35e (rootRowRunning: false) and passed on the fix (rootRowRunning: true).

@kitlangton
kitlangton merged commit 8feac04 into main Oct 4, 2026
1 check passed
@kitlangton
kitlangton deleted the stale-running-gauntlet branch October 4, 2026 03:46
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.

1 participant