Skip to content

feat(batch): BatchExec tool for Anthropic Message Batches API - #245

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

feat(batch): BatchExec tool for Anthropic Message Batches API#245
Patel230 merged 1 commit into
mainfrom
feat/batch-exec

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

Adopts Orca's batch-execution pattern for low-cost (50% discount) async runs: the BatchExec tool submits prompts to the Anthropic Message Batches API via fixed HTTP calls (no shell, no eyrie/client import — boundary-guarded).

  • submit — sends N prompts as independent requests with configurable model/max_tokens; returns batch ID
  • poll — checks batch status; returns the full response
  • Reads ANTHROPIC_API_KEY; fixed API host; 5-min timeout; no shell interpolation

Registered in chat_tools.go with safety capabilities (NetworkAccess) + permission aliases.

Note: the tool implements its own minimal HTTP calls rather than importing eyrie/client, because hawk's boundary guard forbids production imports of eyrie's raw client package from internal/tool.

Testing

5 new tests green (API-key gate, prompt validation, batch-id requirement, invalid action); tool/cmd/safety/testaudit suites pass; golangci-lint 0 issues.

Adopts Orca's batch-execution pattern for low-cost (50% discount) async
runs. Submits prompts to the Anthropic Message Batches API via fixed
HTTP calls (no shell, no eyrie/client import — boundary-guarded).

Two actions:
- submit: sends N prompts as independent requests with configurable
  model and max_tokens; returns the batch ID.
- poll: checks batch status; returns the full response.

Uses fixed HTTP calls against the Anthropic REST endpoint with proper
headers; no shell interpolation; 5-minute client timeout. Registered in
chat_tools.go with safety capabilities (NetworkAccess) + permission
aliases.

The eyrie/client import was avoided because hawk's boundary guard
forbids production imports of eyrie's raw client package from
internal/tool; the tool implements its own minimal HTTP calls instead.

Verification: 5 new tests green (API-key gate, prompt validation,
batch-id requirement, invalid action); tool/cmd/safety/testaudit suites
pass; golangci-lint 0 issues; gofmt clean; go build ./... clean.
@Patel230
Patel230 merged commit bbcd64c into main Aug 24, 2026
26 checks passed
@Patel230
Patel230 deleted the feat/batch-exec branch August 24, 2026 01:14
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