Fix unreliable blocked detection for Codex tmux runs#417
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hasPrompt) is evaluated before output-change detection.esc to interrupt,working (,background terminal running) as not blocked.Use /skills to list available skills).blocked.Acceptance Criteria Evidence
1) Codex runs correctly show
blockwhen idle/waiting for inputImplemented by:
internal/agent/manager.go(GetStatuspriority + improvedIsWaitingForInput)internal/daemon/monitor.go(recordPromptSignaldebounce)Live Codex pane capture (idle/blocked signal):
(Idle state shows prompt hints and no active
esc to interruptmarker.)2) No false
blockduring active Codex executionLive Codex pane capture while active:
(
? for shortcutsis visible while active, so the new busy-marker guard prevents false blocked classification.)Unit test coverage:
TestIsWaitingForInput/codex_active_work_should_not_be_treated_as_blockedTestIsWaitingForInput/codex_background_task_should_not_be_treated_as_blocked3) Claude Code and Gemini blocked detection continue working unchanged
Prompt patterns for existing agents were preserved; existing Claude prompt tests still pass:
TestIsWaitingForInput/claude_promptTestIsWaitingForInput/claude_shortcuts_prompt4) Add Codex-specific prompt patterns based on actual pane captures
Added pattern:
use /skills to list available skillsPattern chosen from live tmux captures in this branch.
5) Add tests for new detection logic
Added/updated tests:
internal/agent/manager_test.gointernal/daemon/monitor_test.goTestRunStateRecordPromptSignalDebounce6)
hashContent()orGetStatus()handles Codex TUI layout differencesHandled in
GetStatus+ prompt detection path:Verification Commands
go test ./internal/agentgo test ./internal/daemongo test ./internal/agent -run 'TestIsWaitingForInput|TestMuxManagerGetStatus' -vgo test ./internal/daemon -run 'TestRunStateRecordPromptSignalDebounce|TestHashContentIgnoresStatusBar' -vgo build ./...make lintNote:
go test ./...currently fails in an existing unrelated test:internal/cli->TestApplyConfigDefaultsFallbacks(invalid config schema ... EOF)Issue
Refs: orch-437