feat(batch): BatchExec tool for Anthropic Message Batches API - #245
Merged
Conversation
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.
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
Adopts Orca's batch-execution pattern for low-cost (50% discount) async runs: the
BatchExectool submits prompts to the Anthropic Message Batches API via fixed HTTP calls (no shell, noeyrie/clientimport — boundary-guarded).submit— sends N prompts as independent requests with configurable model/max_tokens; returns batch IDpoll— checks batch status; returns the full responseANTHROPIC_API_KEY; fixed API host; 5-min timeout; no shell interpolationRegistered in
chat_tools.gowith safety capabilities (NetworkAccess) + permission aliases.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.