Skip to content

feat(batch): BatchExec wait action with backoff + Retry-After - #246

Merged
Patel230 merged 1 commit into
mainfrom
feat/batch-exec-wait
Aug 24, 2026
Merged

feat(batch): BatchExec wait action with backoff + Retry-After#246
Patel230 merged 1 commit into
mainfrom
feat/batch-exec-wait

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

Adds a wait action to BatchExec so CI/scripted users can block until a batch completes, mirroring eyrie's WaitUntilDone but inlined to stay boundary-compliant (no eyrie/client import from internal/tool).

  • batchWait polls /v1/messages/batches/{id} with exponential backoff + jitter capped at 30s, honoring Retry-After on 429/5xx, bounded by timeout_seconds (default 600)
  • batchStatus single fetch; treats 429/5xx as transient (keep polling)
  • Params refactored to a named batchExecParams type shared by submit/poll/wait; batchBaseURL is now a var for testability

Testing

6 new tests: polls-until-terminal, Retry-After honored on 429 (timing-verified), timeout, wait-requires-id, terminal-state classification, backoff Retry-After override. Full tool/testaudit/cmd/safety suites pass; golangci-lint 0 issues.

Adds a wait action to BatchExec that polls until the batch reaches a
terminal state, mirroring eyrie's WaitUntilDone but inlined to stay
boundary-compliant (no eyrie/client import from internal/tool):

- batchWait polls /v1/messages/batches/{id} with exponential backoff +
  jitter capped at 30s, honoring Retry-After on 429/5xx, bounded by
  timeout_seconds (default 600).
- batchStatus performs one fetch and treats 429/5xx as transient.
- Refactored params to a named batchExecParams type so submit/poll/wait
  share a single shape; batchBaseURL is now a var so the loop is testable
  against an httptest server.

New tests (6): polls-until-terminal, Retry-After honored on 429,
timeout, wait-requires-id, terminal-state classification, backoff
Retry-After override. tool/testaudit/cmd/safety suites pass;
golangci-lint 0 issues; gofmt clean.
@Patel230
Patel230 merged commit 16c9679 into main Aug 24, 2026
26 checks passed
@Patel230
Patel230 deleted the feat/batch-exec-wait branch August 24, 2026 01:48
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