terminal ui state detection - #228
Conversation
agent-era-ai
commented
Apr 26, 2026
- tracker: seed item files for terminal-ui-state-detection
- fix(ai-status): drive detector from real terminal captures
Replaces inline synthetic fixtures with a fixture-driven test loader and patches three detector bugs that real captures surfaced: - Claude `… (` substring matched transcript lines like `Reading 1 file… (ctrl+o to expand)`, false-positiving idle/waiting frames as working. Tightened to require the `(\d+s` duration only the live spinner shows. - Codex `▌ && !⏎ send` heuristic was dead on modern v0.125+ (uses `›` for the prompt cursor) and conflated working with waiting on older builds (the streaming spinner also lacks the send hint). Replaced with the canonical "Press enter to confirm" / "Would you like to run" markers. - Waiting now takes precedence over working: a permission picker is the user-actionable state and the spinner can render alongside it. Adds a `.claude/skills/capture-ai-states/` skill that drives each (tool × state) cell automatically (3 tools × 3 states), writes plain-text captures to `tests/fixtures/ai-states/<tool>/<state>.txt`, and a fixture loader test that asserts each fixture classifies to its directory name. Gemini's per-project oauth picker can't be auto-dismissed; the script errors out clearly and the gemini fixtures are realistic curated snapshots — see SKILL.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #228: terminal-ui-state-detectionOverviewThis PR ships three things together: an automated capture skill that scripts each AI CLI into each state, a set of real fixture files replacing the old inline strings, and targeted detector fixes validated against those fixtures. The approach is sound — fixture-driven tests against real captures are strictly better than hand-written strings, and the bugs found (Claude working false-positive, Codex waiting heuristic on modern UI) prove the value. Detector fixes —
|
| Area | Status |
|---|---|
| Detector logic | ✅ correct, well-justified |
| Test coverage | ✅ good, two gaps noted |
Dead code (statusPatterns.working for claude) |
|
default: return false in isWorking |
|
| Gemini fixture provenance |
The core work is solid. The two
- Drop dead `AI_TOOLS.claude.statusPatterns.working` constant; claude detection lives in AIToolService.isWorking via CLAUDE_WORKING_RE. - Comment the `default` arm of isWorking's switch so adding a new tool surfaces the gap loudly. - Note minute-scale brittleness on CLAUDE_WORKING_RE. - Add explicit mixed-state test: working spinner + permission picker visible together must classify as waiting (motivating bug for the waiting-before-working order swap). - Add README in tests/fixtures/ai-states/gemini/ explaining the curated-not-live provenance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #228: terminal ui state detectionOverviewThis PR ships three things together: a capture skill to snapshot real AI terminal states, a fixture tree ( What's Good
Issues / Concerns1.
|