You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Wait tool: command condition returns condition_met immediately when gh run view exits 0 for still-running jobs #816
The Wait tool's command condition returns condition_met immediately when the check command exits 0, even if the underlying process is still running. This makes it unusable with commands like gh run view --exit-status that exit 0 for both "still running" and "completed successfully".
Steps to Reproduce
Dispatch a workflow run that takes >30s (e.g. migrate-infer.yml)
Observe that Wait returns condition_met in ~2s even though the run is still in progress
Expected Behavior
The tool should keep polling until the run actually finishes (or fails), not return immediately on exit 0. The pending_exit_codes mechanism should handle commands that don't have a dedicated "still pending" exit code.
Actual Behavior
pending_exit_codes is designed for commands like gh pr checks that return exit code 8 while pending. But gh run view --exit-status exits 0 for both "still running" and "completed successfully" — it only exits non-zero on failure. So the Wait tool sees exit 0 and thinks the condition is met, returning immediately instead of polling.
Workaround: Use sleep + gh run view in a loop instead.
changed the title [-]Wait tool: command condition returns condition_met immediately when gh run view exits 0 for still-running jobs[/-][+][BUG] Wait tool: command condition returns condition_met immediately when gh run view exits 0 for still-running jobs[/+]on Jul 9, 2026
Added a new pending_exit_codes_include_zero boolean parameter to the Wait tool's command condition that, when true, treats exit code 0 as "still pending, keep polling" instead of condition_met, fixing the bug where commands like gh run view --exit-status that exit 0 for both "still running" and "completed successfully" would cause the wait to return immediately.
Tokens: 4,275,711 in · 17,389 out · 4,293,100 total (47 requests)
Tool calls: 53 total · 92% success rate
⚠️ 4 failed tool call(s)
Edit: old_string not found in file /home/runner/work/cli/cli/internal/agent/tools/wait.go
Possible matches found:
Near line 219:
if err := validatePendingExitCodes(args); err != nil {
return err
}
}
return nil
}
// validatePendingExitCodes checks that pending_exit_codes, when present, is
// an array of numbers.
func validatePendingExitCodes(args map[string]any) error {
Hint: Ensure exact whitespace and indentation match. Use the Read tool to see the current file content.
Bash: exit status 1: --- FAIL: TestWaitTool_Execute_CommandPendingIncludeZero (10.00s)
wait_test.go:780: Execute() should succeed once the check output changes, got error: timed out after 10s waiting for condition 'command'
wait_test.go:787: Execute() reason = "timeout", want "condition_met"
FAIL
FAIL github.com/inference-gateway/cli/internal/agent/tools 14.052s
FAIL
Bash: exit status -1: �[32mtask: [precommit:run] pre-commit run --all-files
�[0m[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check json...............................................................Passed
check toml...............................................................Passed
check for merge conflicts................................................Passed
check for added large files..............................................Passed
mixed line ending........................................................Passed
Go mod tidy..............................................................Passed
Format code..............................................................Failed
hook id: fmt
files were modified by this hook
�[32mtask: [fmt] go fmt ./...
�[0minternal/agent/tools/wait.go
internal/agent/tools/wait_test.go
Activity
[-]Wait tool: command condition returns condition_met immediately when gh run view exits 0 for still-running jobs[/-][+][BUG] Wait tool: command condition returns condition_met immediately when gh run view exits 0 for still-running jobs[/+]edenreich commentedon Jul 9, 2026
@infer Can you fix this?
inference-gateway-maintainer commentedon Jul 9, 2026
Model:
ollama_cloud/deepseek-v4-flash· View JobTodos
Pull Request
#819
✅ Infer Result: Success
Added a new
pending_exit_codes_include_zeroboolean parameter to the Wait tool's command condition that, when true, treats exit code 0 as "still pending, keep polling" instead ofcondition_met, fixing the bug where commands likegh run view --exit-statusthat exit 0 for both "still running" and "completed successfully" would cause the wait to return immediately.Model:
ollama_cloud/deepseek-v4-flash· Exit Code:0· Duration: 13m 20sTokens: 4,275,711 in · 17,389 out · 4,293,100 total (47 requests)
Tool calls: 53 total · 92% success rate
Possible matches found:
Near line 219:
if err := validatePendingExitCodes(args); err != nil {
return err
}
}
}
// validatePendingExitCodes checks that pending_exit_codes, when present, is
// an array of numbers.
func validatePendingExitCodes(args map[string]any) error {
Hint: Ensure exact whitespace and indentation match. Use the Read tool to see the current file content.
wait_test.go:780: Execute() should succeed once the check output changes, got error: timed out after 10s waiting for condition 'command'
wait_test.go:787: Execute() reason = "timeout", want "condition_met"
FAIL
FAIL github.com/inference-gateway/cli/internal/agent/tools 14.052s
FAIL
wait_test.go:809: Execute() error = "check command failed with exit code -1 (not in pending_exit_codes)", want containing "timed out"
FAIL
FAIL github.com/inference-gateway/cli/internal/agent/tools 5.050s
FAIL
�[0m[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check json...............................................................Passed
check toml...............................................................Passed
check for merge conflicts................................................Passed
check for added large files..............................................Passed
mixed line ending........................................................Passed
Go mod tidy..............................................................Passed
Format code..............................................................Failed
�[32mtask: [fmt] go fmt ./...
�[0minternal/agent/tools/wait.go
internal/agent/tools/wait_test.go
Lint.....................................................................Passed
Generate mocks...........................................................Passed
Triggered by edenreich · Infer Action
fix(wait): add pending_exit_codes_include_zero parameter for commands…
inference-gateway-releaser commentedon Jul 10, 2026
🎉 This issue has been resolved in version 0.141.0 🎉
The release is available on:
Your semantic-release bot 📦🚀