Repository navigation
llm: /responses wire format, copilot provider, window from the model list - #420
Merged
Merged
Conversation
…list
- wire_api ("chat" | "responses" | "auto") picks the request format per
connection. /responses requests carry the conversation whole (store:false):
leading system text as instructions, past calls as function_call items
without the server's item id, outputs by call_id, tools flattened with
strict off, max_output_tokens, reasoning_effort moved to reasoning.effort.
The stream is complete only at response.completed/incomplete; failed and
error events go through the chat path's transient/permanent split.
- "auto" reads the model list once per client and uses /responses for a
model listed as served only there (supported_endpoints).
- Built-in "copilot" provider: api.githubcopilot.com, key from
`gh auth token` — attached at resolve time, only for the template's own
address, only when gh is installed and no key is set; never saved.
- The model list's capabilities.limits (max_prompt_tokens) gives the
window. When the key comes from api_key_cmd, no probe can read it before
the first task, so the client reads it before its first request and the
run trims against it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
- Calls are kept by call_id; argument events without one find their call by item id, then output_index, then the call streaming now — a server that gives an item a new id per event no longer splits one call into several. - A finished item or done event without arguments keeps the streamed ones; done arguments may come as an object. - The finished response's output fills in calls and text the events left out; with calls streamed, it never adds one they don't match. - The model-list read is retried (up to 3 tries) instead of pinning an auto client to chat after one failure; a cancelled request doesn't count. - Body and path come from one read of the wire format. - The runaway cap follows a window found in the model list. - copilot's key command names github.com, so another default gh host's token isn't sent; its base URL matches with a trailing slash too. - An unknown wire_api value stops the config from loading. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r's file only - A call streamed with no call_id takes it (and its name) from an unmatched item in the finished response, in order — the same call under new ids. - A done event naming a call_id not seen yet finishes the call streaming now when that call had none, instead of starting a second one. - An arguments event matched only to the call streaming now no longer records its ids as that call's, so a call announced after it isn't merged. - Calls with no ids at all stay separate. - An unknown wire_api in a workspace's .agent/config.json no longer stops the run: those connection settings are discarded anyway. The user's own file is still checked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- An arguments event with an output_index nothing has claimed belongs to a call not announced yet; only an event with no index falls back to the call streaming now. - A call_id shown late goes to the one call still without one, and is never guessed among several. - The finished response names a streamed call only when exactly one lacks a call_id. - A call left without a name or call_id stops the turn instead of running. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A call kept under its item id or output_index that later showed a call_id was not found by that call_id: the finished response listing it under a new item id could hand its call_id to another, unnamed call, and both ran. Calls are now looked up by call_id through a map of their own; a finished-response call that matches nothing is logged and not run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What
wire_apiper connection:chat(default),responses, orauto./responsesrequests send the whole conversation each turn (store: false); tool calls round-trip bycall_id; the stream is complete only atresponse.completed/response.incomplete, andresponse.failed/errorevents get the same retry treatment as chat-stream errors.autoreads the server's model list once per client and uses/responsesfor a model listed as served only there.copilotbuilt-in:https://api.githubcopilot.com, key fromgh auth token(attached when resolving, only for that address, only withghinstalled and no key set; never written to the config file).COPILOT_GITHUB_TOKENalso works.capabilities.limits.max_prompt_tokenstoo. Withapi_key_cmd, the client reads it before its first request so a one-shot run trims against it instead of running with no window.Verified
-m copilot:staying off disk, and the agent trimming against the client-found window. Each fix checked by breaking it (25/25 caught).-m copilot:gpt-4.1 -read-onlyon a clean config — window 64000 found before the first request, tool call, answer, config file untouched./responsesagainst llama-server with a local reasoning model — two tool rounds and a correct answer./responseswith tool rounds (no access from the test account).🤖 Generated with Claude Code