Validate call_tools up front and report every batch in one envelope (0.1.1-dev.1) #105
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/batch-envelope"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
A
corn_call_toolsrequest today came back as a raw pydantic error because the caller had copied response fields (succeeded,total_ms) into its request. While reproducing it I found a worse, silent bug:BatchCallItemdrops unknown keys, so{"tool": "coder_workspace_bash", "args": {...}}runs the tool with empty arguments.What changes
extra="forbid"on the item and the whole request; this also shows in the published input schema asadditionalProperties: false)._BatchArgumentErrors, innermost middleware so auth and timing still wrap it). A rejected batch has the same shape as an accepted one:Problems with the batch itself go in
error.errors, for example"succeeded": "response field copied from a previous corn_call_tools result; remove it". Rejections are flaggedisErrorand carry the envelope as both structured and text content. Submitted values are never echoed (include_input=False), and more than 20 calls are never listed back.status: completed|partial,executed,invalid,not_run, and a per-callstatus: ok|error|invalid. They are never flaggedisError, because some clients drop the structured content of error-flagged results.Behaviour change for reviewers
Unknown-tool and recursive calls never ran, so they now count as
invalid, notfailed.failednow means a call ran and returned an error. All existing fields (results,ok,succeeded,failed,total_ms) are kept.Version
0.1.1-dev.1, the next dev version after stable0.1.0(release.py next dev). Notes:deploy/releases/0.1.1-dev.1.md.Verification (sprite, head
5152380)pytest: 530 passed (test_batch.py now has 17 tests: response-field echo for both entry names, theargs/nametypos, per-call type errors, more than 20 calls, a missingcalls,max_concurrency11, timing logs a rejection astool_error, and the published schema forbids extra keys)deploy/hostunittest 12 OK;browser_web.py,browser_picker.pypassed; wheel built;scripts/verify_yawn.shOK;release.py checkOKcode-review 0.1.0-dev.1 diff a099d62..5152380: Python-only change insrc/corn/batch.pyplus tests, no diagnostics. The changed path isregister→_BatchArgumentErrors.on_call_tool→BatchRequest.model_validate/rejected_batch→_field_message,_summary; andcorn_batch→_summary. No other module's call graph changed.