Repository navigation
feat(proxy): prefix asker for Chat Completions - #1036
Merged
Merged
Conversation
Part of #1030. The sweep can now ask its question on a Chat route over the stashed sent body. The adjudicate gate is not changed. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Part of #1030. A Chat Completions request through a pipeline with extract_llm_sweep now carries context_guru_adjudicate, the same rule as Anthropic and Responses. The Chat prefix asker can then read the verdicts. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
amiddavid
commented
Nov 10, 2026
amiddavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | e68686b64831 |
blocking |
Verdict: blocking
Findings
- cheapmodel/openai_prefixed.go:109-113 — the ask adds
max_tokenswhen the client sent no token budget field, and reasoning models reject that field- What fails: a Chat client on a reasoning model (o-series, gpt-5 class) that sends neither
max_tokensnormax_completion_tokens— the OpenAI SDK default — gets an ask body withmax_tokens: 16000. Those models answer400 Unsupported parameter: 'max_tokens'. Every ask on such a route fails, so the sweep this PR exists to enable never runs there. Fail-open holds (gatesweep_ask_failed, the plain ping goes out), so no user-visible harm — but the feature is silently inert on a whole model family, and the only signal is a warn log. - Proof:
field := "max_tokens"(line 109) is the default when neither field exists inprefixBody; line 113 then sets it. The code comment ("Reasoning models reject max_tokens; keep the field name the client used") handles only the field NAME, not the case where the client used no field at all.TestCompletePrefixedChatUsesMaxTokensByDefaultpins this: its body has no budget field and it assertsmax_tokens == 77. The Anthropic twin (cheapmodel/anthropic.go:248) may always setmax_tokensbecause that API requires the field; the Chat API does not, so adding it is a choice, not a necessity. - Fix: when the client sent neither field, set
max_completion_tokens(OpenAI accepts it on reasoning and non-reasoning chat models), or set no budget field and keep the server default. Update the test to pin the new default.
- What fails: a Chat client on a reasoning model (o-series, gpt-5 class) that sends neither
Non-blocking
- Chat SSE stray leak, inherited from expand. With the tool now declared on Chat, a model that calls
context_guru_adjudicatein a streamed Chat response reaches the client raw:serve's Chat SSE case (proxy/proxy.go:2335) inspects no Chat stream unless tool search is on, so the in-band answer atproxy/proxy.go:2497never runs. The request-path backstop covers the Chat wire (adjudicate.AnswerStrayCalls,internal/adjudicate/tool.go:275), so the cost is one agent turn — the same documented gap class as expand (proxy/proxy.go:1590). That comment names expand only; consider naming adjudicate too. No test pins the Chat-SSE stray path. contentas a parts array reads as raw JSON.msg.Get("content").String()(cheapmodel/openai_prefixed.go:137) returns the raw JSON array when a gateway answers with content parts, so the reply parses as nothing and the sweep declines. Fail-open; low rate. Extracting[].textparts would match the Anthropic twin.- Test capture without the mutex the same file says is required.
TestChatPrefixAskerAsksOverStashedSession(proxy/prefixask_test.go:373) writesgoton the handler goroutine and reads it in the test, whilecapturePrefixedin the same file exists because "the HTTP round trip is not a happens-before edge". ThechatServerhelper incheapmodel/openai_prefixed_test.gouses the same bare pattern (pre-existing style in that file).-racepassed per the PR, so this is consistency, not a known failure. - IBM Bob ask fails by construction (wrong path
/v1/chat/completions, Bearer vs Apikey). Documented in the code comment and the PR body, fails open, and #1029/#1030 item 4 own it. No action here.
What I checked
- Full diff
d058b339..HEAD, both commits, and the code around every change. CompletePrefixedChatagainst its two twins (CompletePrefixed,CompletePrefixedResponses): message append, budget field,stream/stream_optionsdelete, tool-call read, usage tiers viaproviderusage.Parse(chat shape:prompt_tokensminuscached_tokens→ Fresh — matches the test's 1200/1100/100).PrefixUsagefield-for-field conversioncheapmodel.PrefixUsage→components.PrefixUsage(identical names, types, order, includingCacheWrite1h).- Routing:
prefixAskerForAPIand the inject gate atproxy/proxy.go:1646agree —WireForreturns the provider unless the API is Responses, sowire == WireOpenAImeans the OpenAI Chat route exactly; Anthropic keeps its asker; every other provider gets nil and no injection. - The ask runs over the stashed FORWARDED body (
h.sent.putatproxy/proxy.go:2186, afteradjudicate.Inject), so the tool the ask offers is the one the prefix declared; tools andtool_choicestay untouched, which is what the OpenAI cache key needs. - Fail-open paths: no dispatcher, non-200, non-JSON, no messages array, empty choices, missing stash (
ErrNoPrefix), stale span (ErrStalePrefix) — all decline, none corrupt the request. The sweep's cache gate (prefixAskCacheOK) is wire-generic. - Response-path stray handling for the Chat wire:
ResponseCallIDsandAnswerStrayCallsboth parsechoices…message.tool_calls; the JSON response loop answers in band; the SSE gap is noted above. - Tests read in full: the four new
CompletePrefixedChattests, the two new asker tests, the rewritten Chat injection tests (control-arm strip logic checks out: expand at n-2, adjudicate at n-1, against a no-offload[format]control), and the two tooldefer expectation updates (ultrahigh carries the sweep, so the tool belongs there). - PR process: the behavior change is named at the top of the PR with approval date 2026-11-10, an off switch, and the data-dependence claim (no change; the sweep's row is already provider-agnostic) matches
docs/data-dependence.md. - No Go builds or tests were run (not approved; Go is not on this machine).
amiddavid
commented
Nov 10, 2026
amiddavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | e68686b64831 |
blocking |
Verdict: blocking
Findings
- proxy/prefixask.go:365 — the chat asker also arms cache_aware_summarizer's prefix-ask fallback on Chat Completions, a behavior change the PR does not name
- What fails: a Chat Completions route where cache_aware_summarizer is configured with
model.source: configand no static cheap model exists (always so in hosted mode,serverKeyreturns "" there). Before this PR the summarizer declined every turn with theno_modelgate. After it,usePrefixAskis true and the summarizer sends its summary instruction to the caller's own model through the chat asker, and compacts. The operator pinnedconfigto spend the operator's model; the call now spends the caller's, silently. - Proof: before,
prefixAskerForAPI(OpenAI, "", …)fell through toprefixAskerFor, which returns nil for every non-Anthropic provider (proxy/prefixask.go:342-344), soc.PrefixAskwas nil on Chat. Now it returnschatPrefixAsker(proxy/prefixask.go:365-366). In cache_aware_summarizer.go:776-788,model = c.Model.For("config")returnsStaticonly (components/component.go:462-464);staticModel()is nil in hosted mode (proxy/proxy.go:1101-1108);mmis then nil andusePrefixAsk := mm == nil && c.PrefixAsk != nilturns true. Shipped presets pinmodel.source: incoming(config/config_test.go, TestPresetLadderSummarizerModes), so only a custom config is hit — an edge case, which is exactly what the repo's behavior-change rule covers. The PR's behavior-change section names only the tool declaration and the sweep's question. - Fix: name this change at the top of the PR and get a human developer's yes (CLAUDE.md, RELEASING.md), or keep the summarizer off the chat asker until then. Add a test either way: today no test covers the summarizer's prefix-ask fallback on the Chat wire.
- What fails: a Chat Completions route where cache_aware_summarizer is configured with
Non-blocking
- cheapmodel/openai_prefixed.go:109-113 — the ask invents
max_tokenswhen the client sent neither field. A reasoning model on Chat Completions (o-series, gpt-5 on some gateways) rejectsmax_tokens. The comment's mitigation ("keep the field name the client used") only helps a client that sent one. Such a client's asks all fail with a non-200, the sweep declines, and the request goes on (fail open holds) — but the sweep never works for that client, visible only assweep_ask_failed. Consider declining to send a budget when the client sent none, or documenting the limit. - A stray adjudicate call on a streaming Chat response reaches the client raw. The response loop inspects Anthropic SSE and OpenAI SSE only when the search tool is on (proxy/proxy.go:2273); plain Chat SSE is teed through (proxy/proxy.go:2335). Before this PR the tool was never declared on Chat, so a stray was impossible there. The request-path repair answers it on the next turn (adjudicate.AnswerStrayCalls works on the OpenAI wire), so the cost is one agent turn — the same pinned gap as
context_guru_expandon this dialect. Measured stray rate is 0, but the wire is newly exposed. - components/component.go:165 — the PrefixAsker doc still says nil on "a non-Anthropic route". Stale since the Responses asker, staler now. One-line fix.
- Bob pays the ~945-byte tool declaration on every sweep-pipeline request while the ask cannot work there until #1029 (wrong path and auth scheme, documented in the PR). Fail open holds; only the prefix cost is new.
What I checked
- The full diff of both commits (7570d23, e68686b) line by line, and the code around each change:
CompletePrefixedChatagainst its Responses and Anthropic siblings,chatPrefixAskeragainstresponsesPrefixAsker, the inject gate in proxy.go,adjudicate.Inject/HasTool/ResponseCallIDs/AnswerStrayCallson the OpenAI wire, the sentStash put/get/snapshotCovering path,apply.NormalizeMessages,providerusage.Parseon chat usage, the dispatcher'sincoming/Do(base + path, Bearer auth), the sweep's ask path andprefixAskCacheOK, and the summarizer'susePrefixAskfallback. - Consistency of the two gate halves: injection fires for exactly the wires that get an asker (
WireForreturns the provider string, sowire == WireOpenAImeans provider OpenAI). - Fail open on every new error path: no messages array, non-200, non-JSON reply, empty choices, no dispatcher, missing stash, stale span — each returns an error the sweep counts and declines on.
- The cache-key claim: the ask changes only the trailing message,
max_tokens/stream/stream_options; tools andtool_choicestay as forwarded, so the prefix the provider holds is read, not rewritten. - The changed tests read in full (adjudicatetool, prefixask, openai_prefixed, tooldefer_search), including the byte-identity control comparison and the mutation coverage the PR claims.
- CLAUDE.md duties: the PR names the behavior change and its approval, and states data dependence (no change; agreed — the stash row already covers the mechanism).
- Live tests were not run (not approved). I read the PR description for the behavior-change statement; I did not read any review or comment on it.
…parts Part of #1030. Round 1 fixes: set max_completion_tokens when the client sent neither field, join content parts, test the summarizer fallback on Chat, and fix two stale comments and the summarize docs. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Collaborator
Author
|
Round 1 fixed at the new head. Findings:
Box 1: |
amiddavid
commented
Nov 10, 2026
amiddavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | 93342d96063a |
approve |
Verdict: approve
Findings
None. Every round-1 finding is fixed, and the fix commit introduces no new defect.
Round-1 findings, re-checked
- Mine, proxy/prefixask.go:365 — the chat asker also arms the summarizer's prefix-ask fallback, unnamed in the PR. Fixed.
- The PR body now carries a "Second behavior change (approved by the owner 2026-11-10)" section: who is hit (
model.source: config, no static cheap model), old and new behavior, and how to turn it off. That is the human's yes the repo rule requires. - New test
proxy/chat_summarizer_prefixask_test.godrives a real handler on/openai/v1/chat/completionswithmodel.source: configand no static model, and proves the fallback ran three ways: a summary landed (WaitForSummaryForTest),CacheAwareSummarizerPrefixAskUsedgrew, and the[OPERATOR INSTRUCTION]text reached the caller's model. I checked the test's plumbing:bearerKey("")returns nil, soCallerKeysupplies the incoming client; the summarizer's deferred commission runs after the turn's own body is stashed, so the coverage check passes on the second post; the reply shape matches the<summary>formatsummarize.go:968expects. docs/components/summarize.mdnow states the fallback applies on Chat since #1030.
- The PR body now carries a "Second behavior change (approved by the owner 2026-11-10)" section: who is hit (
- Reviewer 1, cheapmodel/openai_prefixed.go:109 — the ask invented
max_tokens, which reasoning models reject. Fixed. Agree with reviewer 1, finding 1; checked myself. The default is nowmax_completion_tokens; the client's ownmax_tokensis kept when it sent only that. Three tests pin the default, the kept field, and the both-sent case. - Reviewer 1 non-blocking, content parts read as raw JSON. Fixed.
chatContentTextjoins thetextparts of a content array, same read as the Anthropic twin, with a test. A string or null content behaves exactly as before. - Reviewer 1 non-blocking, SSE stray-gap comment named expand only. Fixed. The comment at proxy/proxy.go:1590 now names
context_guru_adjudicatenext to expand. - Reviewer 1 non-blocking, test capture without a mutex. Fixed for
TestChatPrefixAskerAsksOverStashedSession, which now captures under a mutex. ThechatServerhelper in cheapmodel tests keeps the bare pattern — pre-existing style there,-racepassed. - Mine and reviewer 1 non-blocking, stale
PrefixAskerdoc. Fixed.components/component.gonow says nil means no asker for the wire, no incoming client, or the feature off. - Bob (both reviews, non-blocking): no action, as both reviews expected. The PR body still documents the fail-open and the #1029 follow-up.
Non-blocking
- cheapmodel/openai_prefixed.go:108-110 — the new
max_completion_tokensdefault is verified only against fake upstreams. OpenAI accepts it on reasoning and non-reasoning chat models, so the claim holds there. Third-party OpenAI-compatible upstreams that parse onlymax_tokens(some gateway and vLLM versions) will refuse the ask; it fails open and the sweep declines, same as before the fix but on a different backend family. Worth one live check on the GLM/Kimi gateways before relying on the sweep there. - The both-fields test (
TestCompletePrefixedChatPrefersMaxCompletionTokensWhenBothAreSent) pins a shape no stashed body can have — OpenAI refuses a request carrying both fields, so it never returns 200 and is never stashed. Harmless as a unit pin of the choice.
What I checked
- Last review: round 1, e68686b, 2026-11-10T11:23:40Z.
- New commits read: 1 — 93342d9 "fix(proxy): Chat asker keeps the client's token field, reads content parts".
- Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files).
- New items since my last review: the fix commit (diff read line by line, code around each change) and the author's comment at 2026-11-10T11:59:08Z. I checked each of its six claims against the code; all six hold. Reviewer 1's round-1 review (posted before my last review) I read now for the first time and re-checked its findings myself, as reported above.
- The fix commit's diff: field selection (both branches and the both-sent edge),
chatContentTextagainst the Anthropic twin, the new integration test's config keys (keep_last_turns,min_tokens,trigger.*all exist in cache_aware_summarizer's schema), the mutex rewrite of the stash test, the component doc, the summarize doc, and the proxy.go comment. - The PR body's second behavior-change section, read back from the server.
- No new commits touch the asker routing, the inject gate, or the stash; round 1's verification of those stands.
- Live tests were not run (not approved).
amiddavid
commented
Nov 10, 2026
amiddavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | 93342d96 |
approve |
Verdict: approve
Findings
None. Every round-1 finding is fixed, and the one fix commit introduces no defect I can prove.
Round-1 findings: status
- Mine,
max_tokensinvented when the client sent neither field — fixed.cheapmodel/openai_prefixed.go:109-113now defaults tomax_completion_tokensand keeps the client'smax_tokensonly whenmax_completion_tokensis absent. Three tests pin the cases: neither field (TestCompletePrefixedChatDefaultsToMaxCompletionTokens), clientmax_tokensonly (TestCompletePrefixedChatKeepsTheClientsMaxTokens), both fields (TestCompletePrefixedChatPrefersMaxCompletionTokensWhenBothAreSent). I checked the logic on all four input combinations; the both-present case leaves the client'smax_tokensin place, which is safe because a stashed body implies the provider already accepted both fields. - Reviewer 2's, the summarizer prefix-ask fallback on Chat is a behavior change the PR did not name — fixed by process, and I checked it myself. The PR body now has a "Second behavior change" section with the owner's approval (2026-11-10), who it affects, the old and new behavior, and how to turn it off. The code path is what reviewer 2 traced:
cache_aware_summarizer.go:786(usePrefixAsk := mm == nil && c.PrefixAsk != nil) now turns true on Chat whenmodel.source: configresolves to no static model. Presets withsource: incomingkeep the messages path (cheapmodel.OpenAIimplementsCompleteMessages, sommis non-nil there) — the PR body says exactly that. The new real-handler test (proxy/chat_summarizer_prefixask_test.go) drives a real proxy on/openai/v1/chat/completionsand shows the instruction reaching the caller's model;docs/components/summarize.mdnow names Chat. Accepted. - Non-blocking, all fixed: the SSE gap comment names
context_guru_adjudicate(proxy/proxy.go:1590);contentparts are joined (chatContentText, withTestCompletePrefixedChatJoinsContentParts);TestChatPrefixAskerAsksOverStashedSessionuses the mutex capture; thePrefixAskerdoc (components/component.go:165) now states the real nil conditions.
Non-blocking
chatServerincheapmodel/openai_prefixed_test.gostill captures the request body without a mutex. I flagged this in round 1 as pre-existing style in that file; the author fixed the proxy test only.-racepasses per the author's comment. No action required.- When the client sends BOTH
max_tokensandmax_completion_tokens, the ask setsmax_completion_tokensand leavesmax_tokensat the client's value rather than deleting one. Harmless (the provider accepted the stashed body with both), and the case needs an already-ambiguous client. Noted only for the record.
What I checked
- Last review: round 1, e68686b, 2026-11-10T11:19:29Z.
- New commits read: 1 —
93342d96"fix(proxy): Chat asker keeps the client's token field, reads content parts". - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files; both reviews are round 1, the comment is the author's fix summary at 2026-11-10T11:59:08Z).
- New items since my last review: the author's comment (each claim checked against the code — all six hold), the fix commit (full diff and the code around every change), and the updated PR body (second behavior change verified present and accurate).
- The fix commit's changed files around the changes: the new field logic against all four field-presence combinations;
chatContentTextagainst the Anthropic twins' part reads; the rewritten and new tests;components/component.godoc;docs/components/summarize.md; theproxy.gocomment. - The new summarizer test's wiring:
config.LoadBytes/Build,New(pipe, store, agg, Options{OpenAIUpstream}),Options.OpenAIUpstream,offload.CacheAwareSummarizerPrefixAskUsed,offload.WaitForSummaryForTest(primary thread = bare session id), theOPERATOR INSTRUCTIONframing inask_role.go, the<summary>reply parse incache_aware_async.go, and the summarizer config keys (keep_last_turns,min_tokens,trigger.*). - The summarizer's Chat path is wire-generic:
NoCacheBreakpointis set byapplyper provider (apply/apply.go:729), so the tool-exchange retreat is skipped on OpenAI as its comment requires; the stale-prefix guard andAskCoveredrun throughchatPrefixAsker, which implementsPrefixCoveredAsker. - No Go builds or tests were run (not approved; Go is not on this machine). The author's comment states
-race, lint andmkdocs build --strictpass on the box; taken as stated.
Collaborator
Author
|
Merged
|
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Collaborator
Author
|
Merged
|
vz-ibm
added a commit
that referenced
this pull request
Nov 11, 2026
Bring in main (with #1036, the Chat Completions prefix asker), so the A2 stack can build on it. No conflicts. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
vz-ibm
added a commit
that referenced
this pull request
Nov 11, 2026
Bring in main (with #1036, the Chat Completions prefix asker), so the A2 stack can build on it. No conflicts. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
vz-ibm
added a commit
that referenced
this pull request
Nov 11, 2026
Bring in main (with #1036, the Chat Completions prefix asker), so the A2 stack can build on it. No conflicts. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
amiddavid
pushed a commit
that referenced
this pull request
Nov 11, 2026
On IBM Bob's route, Context Guru's own model calls (the summary call and the sweep's question, #1036) now go to Bob's model path with Bob's auth, behind the agent extension point (#1029). Step A2.4, #1030 item 4. - agent: a new method, ModelTarget() (chat Path and AuthScheme). Base returns the zero target: the host default (/v1/chat/completions, Bearer), so every other route is unchanged. The agent never sees the key; the host builds the header. - agent/bob: Bob.ModelTarget returns {bob.ModelPath, "Apikey"}. - cheapmodel: OpenAI gets a Path field. Complete and CompletePrefixedChat post to it. Behavior change, Bob route only. Who: Bob users with a preset that makes model calls (bob-ultrahigh); today's Bob presets (off, lossless) make none. Old: the calls went to /v1/chat/completions with Bearer, failed, and the request went on unchanged. New: they go to /inference/v1/chat/completions with "Authorization: Apikey <caller's key>". Security fix on the same route: a Bob request with no key of its own no longer falls back to the operator's --openai-key, so that key is not sent to Bob's server. The OpenAI route keeps its fallback. Turn it off: use a preset without model calls. Owner's yes, 2026-11-11, in the integrator session: "yes I approve it since we dont have Bob users yet". Data dependence: none changed. Reviews: 3 offload review rounds (Claude backend). Round 3: both approve at b94582a. After it, the integrator merged main (423936e) and retargeted the PR from #1029's branch to main. The PR's own added and removed lines are identical to the approved change (14 files, +492/-12); the hand resolutions in agent/ and docs/design.md keep the branch side. Signed-off-by: Vitaly Zabershinsky <[email protected]> Signed-off-by: DAVID AMID <[email protected]> Assisted-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.
Behavior change (approved 2026-11-10)
extract_llm_sweep(xhigh, ultrahigh, housellm). Plain OpenAI and IBM Bob.context_guru_adjudicatetool, and the sweep could not ask its question.extract_llm_sweep.warm: true. Anthropic and Responses do not change.Second behavior change (approved by the owner 2026-11-10)
cache_aware_summarizeronmodel.source: configand no static cheap model (for example hosted mode). Shipped presets useincomingand are not affected.no_model).model.source: incoming.Summary
Part of #1030 (item 1). The sweep can now ask its question on Chat Completions.
What changed
cheapmodel.OpenAI.CompletePrefixedChat: adds one user message to the stashed body. Tools andtool_choicestay as sent. It dropsstreamandstream_options. It keeps the client'smax_tokensormax_completion_tokens, and setsmax_completion_tokensif it sent neither. It joinscontentparts whencontentis an array. It reads the verdicts from the adjudicate tool call, or frommessage.contentif there is none.chatPrefixAskerinproxy/prefixask.go, chosen inprefixAskerForAPIfor the OpenAI Chat wire. No Bob code.proxy/proxy.gonow includes the Chat wire.prompt_tokens_details.cached_tokens. Both Bob backends report cache reads (feat(proxy): label each Bob reply with the IBM backend that served it #975 captures, 158 requests, 2026-11-10).IBM Bob
The ask fails open on Bob for now. The incoming client uses
/v1/chat/completionsand a Bearer header. Bob needs/inference/v1/chat/completionsandApikey. #1030 item 4 and #1029 add those. Until then Bob gets a non-200, the sweep declines, and the request goes on unchanged.Data dependence
No change. The ask uses the same stashed body as the Anthropic and Responses askers.
docs/data-dependence.mdneeds no edit.How it was tested
[client tool, expand, adjudicate], and the rest of the body is byte-identical to the no-sweep request.max_completion_tokensname,stream_optionsdelete,ViaTool, JSON check, routing branch, inject gate (both halves), no-prefix refusal.-raceoncheapmodel,components/offload,internal/adjudicateandproxy,go vet,gofmt,mkdocs build --strict.docs/components/summarize.mdsays it applies on Chat.