Skip to content

Add orch wait command for run status changes#440

Open
proboscis wants to merge 1 commit into
mainfrom
issue/ISSUE-ORCH-WAIT-PR/run-20260412-222005
Open

Add orch wait command for run status changes#440
proboscis wants to merge 1 commit into
mainfrom
issue/ISSUE-ORCH-WAIT-PR/run-20260412-222005

Conversation

@proboscis
Copy link
Copy Markdown
Owner

Summary

  • add orch wait <RUN_REF> --until <status> [--timeout N]
  • add a daemon-side WaitForStatus proto RPC that resolves the run once, polls daemon-owned run state, and returns when the target status is observed
  • add CLI/daemon/orchapi tests plus regenerated Go/Python protobuf bindings

Flow

orch wait
  -> orchapi.WaitForStatus(...)
    -> daemon proto WaitForStatus
      -> resolve run ref in daemon
      -> poll store.GetRun(...) until target / timeout / impossible terminal state
      -> return matched run

Evidence

  • go build ./...
    • passed
  • architecture lint
    • uv tool run semgrep --error --config .semgrep/ ./internal/cli/ ./internal/monitor/ ./internal/daemon/ --exclude='*_test.go'
    • passed with 0 findings
  • targeted tests
    • go test ./internal/cli -run 'Test(ParseWaitUntilStatus|RunWaitWithDeps|NewWaitCmdRequiresUntilFlag)'
    • go test ./internal/daemon -run 'TestHandleProtoWaitForStatus|TestGetAttachInfoResponseMapping|TestProtoClientDialTarget'
    • go test ./internal/orchapi
    • go test ./internal/query
    • all passed
  • live command verification with an isolated temp repo/issues store and daemon
    • dynamic pr_open wait:
      {
        "issue_id": "orch-wait-demo",
        "ok": true,
        "run_id": "20260412-130000",
        "status": "pr_open"
      }
    • immediate waiting match:
      {
        "issue_id": "orch-wait-demo",
        "ok": true,
        "run_id": "20260412-130100",
        "status": "waiting"
      }
    • immediate done match:
      {
        "issue_id": "orch-wait-demo",
        "ok": true,
        "run_id": "20260412-130200",
        "status": "done"
      }
    • immediate failed match:
      {
        "issue_id": "orch-wait-demo",
        "ok": true,
        "run_id": "20260412-130300",
        "status": "failed"
      }
    • timeout path:
      • command: orch wait orch-wait-timeout#20260412-140000 --until done --timeout 1
      • stderr: daemon error: timeout waiting for orch-wait-timeout#20260412-140000 to reach status done (last status: running)
      • exit code: 10

Notes

  • go test ./... still fails in this branch on an unrelated existing CLI test outside this change:
    • internal/cli/TestBuildAgentPromptCustomTemplate
    • failure: expected fallback prompt to include issue reference, got: "Issue: orch-3 - Custom"

Ref: ISSUE-ORCH-WAIT-PR

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