Skip to content

feat(proxy): prefix asker for Chat Completions - #1036

Merged
amiddavid merged 6 commits into
mainfrom
feat/chat-prefix-asker
Nov 10, 2026
Merged

amiddavid merged 6 commits into
mainfrom
feat/chat-prefix-asker

Conversation

@amiddavid

@amiddavid amiddavid commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Behavior change (approved 2026-11-10)

  • Who: Chat Completions users of a preset with extract_llm_sweep (xhigh, ultrahigh, housellm). Plain OpenAI and IBM Bob.
  • Old: no context_guru_adjudicate tool, and the sweep could not ask its question.
  • New: the tool (about 945 bytes) is on every request, and the cold sweep can ask at the keep-alive ping.
  • Turn off: use a preset without extract_llm_sweep.
  • Not affected: warm stays off unless a config sets warm: true. Anthropic and Responses do not change.

Second behavior change (approved by the owner 2026-11-10)

  • Who: Chat Completions routes with cache_aware_summarizer on model.source: config and no static cheap model (for example hosted mode). Shipped presets use incoming and are not affected.
  • Old: the summarizer declined every turn (no_model).
  • New: it sends its summary instruction to the caller's own model through the chat asker, as it already does on Anthropic and Responses.
  • Turn off: configure a static cheap model, or use 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 and tool_choice stay as sent. It drops stream and stream_options. It keeps the client's max_tokens or max_completion_tokens, and sets max_completion_tokens if it sent neither. It joins content parts when content is an array. It reads the verdicts from the adjudicate tool call, or from message.content if there is none.
  • chatPrefixAsker in proxy/prefixask.go, chosen in prefixAskerForAPI for the OpenAI Chat wire. No Bob code.
  • The inject gate in proxy/proxy.go now includes the Chat wire.
  • The cache-read check (fix(cheapmodel): move the trailing breakpoint onto the appended question #725) is unchanged. It reads 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/completions and a Bearer header. Bob needs /inference/v1/chat/completions and Apikey. #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.md needs no edit.

How it was tested

  • Fake upstream tests only, no live calls.
  • Success (text and tool call), refusals (no messages, 401, not JSON, no dispatcher, empty choices, no stashed prefix, stale span).
  • Chat with a sweep: the tools are [client tool, expand, adjudicate], and the rest of the body is byte-identical to the no-sweep request.
  • Chat without a sweep: no tool added. Anthropic and Responses routes keep their askers.
  • Mutations killed: message position, max_completion_tokens name, stream_options delete, ViaTool, JSON check, routing branch, inject gate (both halves), no-prefix refusal.
  • Box 1: -race on cheapmodel, components/offload, internal/adjudicate and proxy, go vet, gofmt, mkdocs build --strict.
  • Summarizer fallback on Chat: a real-handler test shows the summary instruction reaches the caller's model. docs/components/summarize.md says it applies on Chat.
  • Two existing tooldefer tests now expect the adjudicate tool in the Chat tools list.

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 amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. cheapmodel/openai_prefixed.go:109-113 — the ask adds max_tokens when 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_tokens nor max_completion_tokens — the OpenAI SDK default — gets an ask body with max_tokens: 16000. Those models answer 400 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 (gate sweep_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 in prefixBody; 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. TestCompletePrefixedChatUsesMaxTokensByDefault pins this: its body has no budget field and it asserts max_tokens == 77. The Anthropic twin (cheapmodel/anthropic.go:248) may always set max_tokens because 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.

Non-blocking

  • Chat SSE stray leak, inherited from expand. With the tool now declared on Chat, a model that calls context_guru_adjudicate in 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 at proxy/proxy.go:2497 never 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.
  • content as 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 [].text parts would match the Anthropic twin.
  • Test capture without the mutex the same file says is required. TestChatPrefixAskerAsksOverStashedSession (proxy/prefixask_test.go:373) writes got on the handler goroutine and reads it in the test, while capturePrefixed in the same file exists because "the HTTP round trip is not a happens-before edge". The chatServer helper in cheapmodel/openai_prefixed_test.go uses the same bare pattern (pre-existing style in that file). -race passed 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.
  • CompletePrefixedChat against its two twins (CompletePrefixed, CompletePrefixedResponses): message append, budget field, stream/stream_options delete, tool-call read, usage tiers via providerusage.Parse (chat shape: prompt_tokens minus cached_tokens → Fresh — matches the test's 1200/1100/100).
  • PrefixUsage field-for-field conversion cheapmodel.PrefixUsage → components.PrefixUsage (identical names, types, order, including CacheWrite1h).
  • Routing: prefixAskerForAPI and the inject gate at proxy/proxy.go:1646 agree — WireFor returns the provider unless the API is Responses, so wire == WireOpenAI means 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.put at proxy/proxy.go:2186, after adjudicate.Inject), so the tool the ask offers is the one the prefix declared; tools and tool_choice stay 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: ResponseCallIDs and AnswerStrayCalls both parse choices…message.tool_calls; the JSON response loop answers in band; the SSE gap is noted above.
  • Tests read in full: the four new CompletePrefixedChat tests, 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 amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. 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: config and no static cheap model exists (always so in hosted mode, serverKey returns "" there). Before this PR the summarizer declined every turn with the no_model gate. After it, usePrefixAsk is true and the summarizer sends its summary instruction to the caller's own model through the chat asker, and compacts. The operator pinned config to spend the operator's model; the call now spends the caller's, silently.
    • Proof: before, prefixAskerForAPI(OpenAI, "", …) fell through to prefixAskerFor, which returns nil for every non-Anthropic provider (proxy/prefixask.go:342-344), so c.PrefixAsk was nil on Chat. Now it returns chatPrefixAsker (proxy/prefixask.go:365-366). In cache_aware_summarizer.go:776-788, model = c.Model.For("config") returns Static only (components/component.go:462-464); staticModel() is nil in hosted mode (proxy/proxy.go:1101-1108); mm is then nil and usePrefixAsk := mm == nil && c.PrefixAsk != nil turns true. Shipped presets pin model.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.

Non-blocking

  • cheapmodel/openai_prefixed.go:109-113 — the ask invents max_tokens when the client sent neither field. A reasoning model on Chat Completions (o-series, gpt-5 on some gateways) rejects max_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 as sweep_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_expand on 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: CompletePrefixedChat against its Responses and Anthropic siblings, chatPrefixAsker against responsesPrefixAsker, the inject gate in proxy.go, adjudicate.Inject/HasTool/ResponseCallIDs/AnswerStrayCalls on the OpenAI wire, the sentStash put/get/snapshotCovering path, apply.NormalizeMessages, providerusage.Parse on chat usage, the dispatcher's incoming/Do (base + path, Bearer auth), the sweep's ask path and prefixAskCacheOK, and the summarizer's usePrefixAsk fallback.
  • Consistency of the two gate halves: injection fires for exactly the wires that get an asker (WireFor returns the provider string, so wire == WireOpenAI means 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 and tool_choice stay 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]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Round 1 fixed at the new head. Findings:

  • R1 (max_tokens): fixed. The asker keeps the client's own field. If the client sent neither, it sets max_completion_tokens. Tests pin the default, the kept max_tokens, and the both-sent case. Mutations killed.
  • R2 (summarizer fallback): the owner allows it. The PR body now names it as a second behavior change at the top. New real-handler test: the summary instruction reaches the caller's model on Chat. Mutation on the routing branch killed. docs/components/summarize.md now says the fallback applies on Chat.
  • SSE stray-gap comment: now names context_guru_adjudicate next to expand.
  • Content parts: content as a parts array is joined, with a test and a mutation.
  • Mutex capture: TestChatPrefixAskerAsksOverStashedSession uses the mutex pattern.
  • PrefixAsker doc: components/component.go says nil means no asker for the wire, no incoming client, or the feature off.

Box 1: -race on proxy, cheapmodel, components/offload, internal/adjudicate pass. make lint and mkdocs build --strict pass.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. 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.go drives a real handler on /openai/v1/chat/completions with model.source: config and no static model, and proves the fallback ran three ways: a summary landed (WaitForSummaryForTest), CacheAwareSummarizerPrefixAskUsed grew, and the [OPERATOR INSTRUCTION] text reached the caller's model. I checked the test's plumbing: bearerKey("") returns nil, so CallerKey supplies 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> format summarize.go:968 expects.
    • docs/components/summarize.md now states the fallback applies on Chat since #1030.
  2. 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 now max_completion_tokens; the client's own max_tokens is kept when it sent only that. Three tests pin the default, the kept field, and the both-sent case.
  3. Reviewer 1 non-blocking, content parts read as raw JSON. Fixed. chatContentText joins the text parts of a content array, same read as the Anthropic twin, with a test. A string or null content behaves exactly as before.
  4. Reviewer 1 non-blocking, SSE stray-gap comment named expand only. Fixed. The comment at proxy/proxy.go:1590 now names context_guru_adjudicate next to expand.
  5. Reviewer 1 non-blocking, test capture without a mutex. Fixed for TestChatPrefixAskerAsksOverStashedSession, which now captures under a mutex. The chatServer helper in cheapmodel tests keeps the bare pattern — pre-existing style there, -race passed.
  6. Mine and reviewer 1 non-blocking, stale PrefixAsker doc. Fixed. components/component.go now says nil means no asker for the wire, no incoming client, or the feature off.
  7. 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_tokens default 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 only max_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), chatContentText against 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 amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Mine, max_tokens invented when the client sent neither field — fixed. cheapmodel/openai_prefixed.go:109-113 now defaults to max_completion_tokens and keeps the client's max_tokens only when max_completion_tokens is absent. Three tests pin the cases: neither field (TestCompletePrefixedChatDefaultsToMaxCompletionTokens), client max_tokens only (TestCompletePrefixedChatKeepsTheClientsMaxTokens), both fields (TestCompletePrefixedChatPrefersMaxCompletionTokensWhenBothAreSent). I checked the logic on all four input combinations; the both-present case leaves the client's max_tokens in place, which is safe because a stashed body implies the provider already accepted both fields.
  2. 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 when model.source: config resolves to no static model. Presets with source: incoming keep the messages path (cheapmodel.OpenAI implements CompleteMessages, so mm is 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/completions and shows the instruction reaching the caller's model; docs/components/summarize.md now names Chat. Accepted.
  3. Non-blocking, all fixed: the SSE gap comment names context_guru_adjudicate (proxy/proxy.go:1590); content parts are joined (chatContentText, with TestCompletePrefixedChatJoinsContentParts); TestChatPrefixAskerAsksOverStashedSession uses the mutex capture; the PrefixAsker doc (components/component.go:165) now states the real nil conditions.

Non-blocking

  • chatServer in cheapmodel/openai_prefixed_test.go still 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. -race passes per the author's comment. No action required.
  • When the client sends BOTH max_tokens and max_completion_tokens, the ask sets max_completion_tokens and leaves max_tokens at 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; chatContentText against the Anthropic twins' part reads; the rewritten and new tests; components/component.go doc; docs/components/summarize.md; the proxy.go comment.
  • 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), the OPERATOR INSTRUCTION framing in ask_role.go, the <summary> reply parse in cache_aware_async.go, and the summarizer config keys (keep_last_turns, min_tokens, trigger.*).
  • The summarizer's Chat path is wire-generic: NoCacheBreakpoint is set by apply per provider (apply/apply.go:729), so the tool-exchange retreat is skipped on OpenAI as its comment requires; the stale-prefix guard and AskCovered run through chatPrefixAsker, which implements PrefixCoveredAsker.
  • No Go builds or tests were run (not approved; Go is not on this machine). The author's comment states -race, lint and mkdocs build --strict pass on the box; taken as stated.

@amiddavid

Copy link
Copy Markdown
Collaborator Author

Merged origin/main into this branch. New head: c30980f5.

  • Remerge-diff: 0 lines. No hand edits. No conflicts.
  • Semantic check: only proxy/proxy.go changed on both sides. The new symbols (CompletePrefixedChat, chatContentText, chatServer, chatPrefixAsker) have one definition each. go vet ./... is clean.
  • Tests (shared box, -race): ./cheapmodel/..., ./components/..., ./proxy/... all pass.
  • CI: all jobs pass, CodeQL and DCO included.

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]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Merged origin/main again (now includes #720, #1002, #1021, #1037). New head: f761f7f0.

  • Remerge-diff: 0 lines. No conflicts.
  • Semantic check: chatPrefixAsker has Ask, AskCovered and CoversSpan. The new feat(sweep): the warm path, an economic gate on a held answer (#491) #720 interface PrefixReadAsker is optional; the sweep falls back to AskCovered. No duplicate definitions (NewSessionRecorder is a build-tag pair). go vet ./... clean.
  • Tests (-race, shared box): cheapmodel, components, keepalive, proxy pass.
  • CI: all jobs pass, CodeQL included.

@amiddavid
amiddavid merged commit cc27f49 into main Nov 10, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 10, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant