Skip to content

test(proxy): CG's token never reaches an upstream in a summary call - #1092

Merged
amiddavid merged 3 commits into
mainfrom
test/summary-call-never-sends-cg-token
Nov 12, 2026
Merged

amiddavid merged 3 commits into
mainfrom
test/summary-call-never-sends-cg-token

Conversation

@vz-ibm

@vz-ibm vz-ibm commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Test only. No behavior change.

Summary

A guard test for one security rule: Context Guru's own token never reaches an upstream. It covers the second way a credential leaves the proxy: a component's own model call (model.source: incoming), such as the summary call.

What we found

  • CallerKey skips only a token of the exact shape (tenant.LooksLikeToken: prefix and length). So a damaged token (one character short) can become the key of a summary call.
  • It does not leak: the dispatcher's Do calls setUpstreamAuth, which runs scrubToken on every call (proxy/dispatcher.go). scrubToken matches the prefix alone, at any length.
  • No test covered this path end to end. The existing tests cover scrubToken itself and the forwarded request.

What changed

New proxy/summarytoken_test.go, TestSummaryCallNeverSendsContextGurusToken:

  • 2 routes: the OpenAI route and Bob's route.
  • 3 header cases: a damaged token as the only key; a whole token beside the caller's key; 2 Authorization values with the token second.
  • It waits for the summary call (it runs in a detached goroutine) with offload.WaitForAllSummariesForTest, and fails when no summary call came.
  • It checks that no request the fake upstream gets (URL, headers and body) holds the token.
  • Each case has its own session, so one case's summary in flight cannot block the next.

How it was tested

  • It passes on main. go test -race on it and the existing token tests: OK. go vet: OK.
  • Mutant check: with only the setUpstreamAuth call in Dispatcher.Do removed (the forwarded request keeps its own scrub), the 2 damaged-token cases fail, 5 runs of 5 (OpenAI and Bob). The code was then restored.
  • -count=3 -race: OK.

Data dependence

None changed. Test only.

A guard for the second credential exit: a component's own model call
(model.source: incoming). The test sends CG's token, whole and one
character short, on the OpenAI route and on Bob's route, and checks
that no request the upstream gets holds it.

It passes on main: the dispatcher scrubs every call it sends. With that
scrub removed, the damaged-token cases fail on both routes.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session fresh 2 of 2 1 of 2 b963b2274bae blocking

Verdict: blocking

Findings

  1. proxy/summarytoken_test.go:59-76 — the test does not wait for the summary call, so it can pass without checking it
    • What fails: on the proxy path, summarize calls the model in a goroutine. The forwarded request does not wait for it. The test checks seen as soon as the forwarded response comes back. At that time the summary call may not have reached the fake upstream yet. Then seen holds only the forwarded request. That request is scrubbed on a different path, so the test passes. This happens even when the dispatcher scrub (the guard this test exists for) is removed.
    • Proof:
      • A proxy request always has a session. apply sets Session from session.Scoped(...). With no explicit id, that is a hash of system + first user message (session/session.go:216-221). So c.Session != "".
      • With a session, summarize does not call summarizeInline. It calls startAsyncSummary and returns at once (components/offload/summarize.go:637-670).
      • startAsyncSummary sends the model call from go func() {...} (components/offload/summarize_async.go:267). The request goroutine does not wait for it.
      • The only guard is len(seen) == 0 (line 67). The forwarded request alone meets it. No line checks that a summary call arrived.
      • The repo already has the fix for this race: offload.WaitForAllSummariesForTest (components/offload/summarize_testhook.go:64). proxy/cgllm_test.go:278-286 uses it, and also fails when the model was never called (calls.Load() == 0).
    • Second effect, across subtests: the in-flight registry is global (inFlight, summarize_async.go:101). Its key is the session (convKey). All six subtests send the same body and no tenant, so they have the same session. If one subtest's summary goroutine is still in flight, the next subtest gets summary_already_in_flight (summarize_async.go:227-230). Then it makes no summary call at all. Map order is random, so the case that gets skipped changes from run to run.
    • So the commit message's claim ("with that scrub removed, the damaged-token cases fail on both routes") depends on goroutine timing. It is not a property of the test.
    • Fix:
      • After resp.Body.Close(), call offload.WaitForAllSummariesForTest(5*time.Second) and fail if it returns false.
      • Assert that the summary call arrived. For example, require len(seen) >= 2, or require one request whose body is the summarize prompt.
      • Give each subtest its own x-context-guru-session value. Then no subtest can block another's summary.

Non-blocking

  • The doc comment says "in any header or body". The fake upstream records headers and body, but not r.URL. Adding r.URL.String() to all costs one line and also covers a token in a query string.
  • b, _ := io.ReadAll(r.Body) drops the error. A short read would hide part of the body from the check. t.Error on it is safer. (It runs in the handler goroutine, so t.Error is fine there, not t.Fatal.)

What I checked

  • The full diff: one commit, one new file, proxy/summarytoken_test.go (116 lines). I read every line.
  • The commit message. It has DCO sign-off and Assisted-By:.
  • The token rules: tenant.TokenPrefix, tenant.LooksLikeToken (exact length) and proxy.tokenShaped (prefix only). The "damaged" value (prefix + 25 characters) is not LooksLikeToken, so CallerKey returns it. That is correct, and it is the hard case the test names.
  • The summary call's credential path: incomingModel (proxy/proxy.go:1067-1105) → Dispatcher.incoming → Dispatcher.Do → setUpstreamAuth → scrubToken (proxy/proxy.go:2745-2749). The scrub is there on main, so the production guard is correct. My finding is only about the test.
  • The other two cases. "Token beside the caller's key": CallerKey skips the valid token and returns X-Api-Key. "Two Authorization values": CallerKey reads Header.Get, so it returns the first value, caller-key. Both cases are correct inputs.
  • The helpers the test uses exist: bobModelPath, bigToolOutput, Options.OpenAIUpstream/BobUpstream, config.LoadBytes, cfg.Build, New, h.Close, h.Mux.
  • Data dependence: this is a test-only PR. No feature changes, so docs/data-dependence.md needs no update.
  • I did not run the tests. Live tests are not approved, and Go is not installed on this machine.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session fresh 1 of 2 1 of 2 b963b2274bae blocking

Verdict: blocking

Findings

  1. proxy/summarytoken_test.go:68 — the test does not prove that the summary call reached the upstream, so it can pass without checking the exit it is named for
    • What fails: the summary call runs in a detached goroutine. The test reads seen as soon as the client gets its response. At that time seen can hold only the forwarded request. The guard len(seen) == 0 passes on the forwarded request alone. So a token leak in the summary call (the "second credential exit") can go unseen, and the test stays green.
    • Proof:
      • apply/apply.go:1472-1474: sessionIDFrom always gives a session id. With no header, it is the content hash of the head. So c.Session != "" on this proxy request.
      • components/offload/summarize.go:641-647: with a session, summarize does not call summarizeInline. It calls startAsyncSummary and returns at once.
      • components/offload/summarize_async.go:265-268: go func() { ... } with context.WithoutCancel. Nothing on the request path waits for it.
      • proxy/proxy.go:550-561: Handler.Close does not wait for detached summaries either.
      • Second effect: all 6 subtests send the same body, so they share one conversation key. inFlight (summarize_async.go:101) is a package global. If one subtest's goroutine has not called inFlight.finish when the next subtest starts, startAsyncSummary returns "already in flight", and that subtest makes no summary call at all.
      • The commit message says the damaged-token cases fail with "that scrub" removed. setUpstreamAuth (proxy/proxy.go:2745) is shared by the forwarded request (proxy/proxy.go:709) and by Dispatcher.Do (proxy/dispatcher.go:312). If the mutation removed the scrub in setUpstreamAuth, the forwarded request alone makes the test fail. That does not show that the summary call was checked. I could not run the test to see which case it was (live tests are not approved).
    • Fix: wait for the summary call with a timeout before the check, and fail when it does not come. For example, poll until the upstream has seen 2 requests, or until it has seen a request whose body holds the summarizer prompt. Then check every request. Also give each subtest a different body (or a different first user message), so the global inFlight slot of one subtest cannot block the next.

Non-blocking

  • proxy/summarytoken_test.go:40-45: the upstream records headers and body, but not r.URL (path and query). The doc comment says "in any header or body", so this matches the claim. A query-string check costs one line and closes the last place a key can travel.
  • proxy/summarytoken_test.go:28-30: the inner map makes the subtest order random. This is fine for correctness. If finding 1 is fixed with distinct bodies, a slice of cases makes failures easier to read again in the same order.

What I checked

  • The full diff: one new file, proxy/summarytoken_test.go, 116 lines. I read every line.
  • The commit message of b963b22.
  • tenant.LooksLikeToken and TokenPrefix (tenant/tenant.go:1112-1131): the test's valid token has the exact length; damaged is one character short. Correct.
  • CallerKey, CallerAuthScheme, scrubToken, tokenShaped (proxy/tenancy.go:290-345): a damaged token is not skipped by CallerKey, so it becomes the summary call's key, and tokenShaped (prefix only) removes it later. The test's three header cases match this logic.
  • incomingModel (proxy/proxy.go:1067-1106), Dispatcher.incoming and Dispatcher.Do (proxy/dispatcher.go), setUpstreamAuth (proxy/proxy.go:2745): Do calls setUpstreamAuth, which calls scrubToken when there is no server-held key. So the production code does remove the token from the summary call. I found no leak in the code. The finding is only about what the test proves.
  • The summarize config in tokenCanaryHandler: min_request_frac: 0, start_from_message: 0, min_tokens: 1, keep_last: 1. These let the summary start on the first turn.
  • Repo rules: test-only change, no behavior change, no data-dependence change, no new component. docs/data-dependence.md needs no update.
  • I did not run the test. Go is not installed, and live tests are not approved.

The summary call runs in a detached goroutine, and the test read the
upstream's requests as soon as the client got its reply. So it could
pass on the forwarded request alone. It now waits with
offload.WaitForAllSummariesForTest, and fails when no summary call
came. Each case has its own session, so one case's summary in flight
cannot block the next. The upstream also records the URL, the cases
run in a fixed order, and a body read error fails the test.

Both round-1 reviewers of #1092 raised this.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Round 1 replies. Fixed in a30c0fa:

  1. The test does not wait for the summary call (both reviewers): fixed. You are right: the summary call runs in a detached goroutine, so the test could pass on the forwarded request alone.
    • The test now calls offload.WaitForAllSummariesForTest(5s), and fails when it times out.
    • It fails when no summary call came: a request whose body carries "max_tokens", which the client's own chat does not.
    • Each case sends its own x-context-guru-session, so the global in-flight slot of one case cannot block the next.
    • The mutant now proves the summary exit. I removed only the setUpstreamAuth call in Dispatcher.Do, not the shared function, so the forwarded request keeps its scrub. The 2 damaged-token cases (OpenAI and Bob) failed in 5 runs of 5. The code was then restored.
  2. Record r.URL (both reviewers): fixed. The URL is now in the checked text.
  3. The io.ReadAll error (reviewer 2): fixed. It fails the test with t.Errorf.
  4. Random case order (reviewer 1): fixed. The routes and the cases are slices now.

Checks: go test -count=3 -race -run TestSummaryCallNeverSendsContextGurusToken ./proxy/ OK. go vet OK.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session resumed 2 of 2 2 of 2 a30c0fa0c540 approve

Verdict: approve

Findings

None.

Earlier findings

  • Reviewer 2, finding 1 (the test does not wait for the summary call): fixed.
    • The test now calls offload.WaitForAllSummariesForTest(5 * time.Second) after the response, and fails on a timeout.
    • The test fails when no request holds "max_tokens". I checked this marker. cheapmodel.OpenAI.post always sets max_tokens (cheapmodel/openai.go:239-246). tokenCanaryRequest does not set it. So the marker finds exactly the summary call.
    • The author's mutant removes only the setUpstreamAuth call in Dispatcher.Do. The forwarded request keeps its scrub. So a failure under that mutant comes from the summary call. This answers my round-1 doubt about the commit message.
  • Reviewer 1, finding 1 (same defect): fixed, for the same reasons.
  • Non-blocking points (r.URL, the io.ReadAll error, random case order): fixed. The URL is in the checked text. A read error calls t.Errorf. Routes and cases are slices now.

Non-blocking

  • proxy/summarytoken_test.go:72 — the per-case session id does nothing. The value is "token-canary-"+route.name+"-"+tc.name, for example token-canary-openai-a token beside the caller's key. session.safeExplicit allows only [A-Za-z0-9._:-] (session/session.go:56-63). The space and the ' fail that check. So Scoped falls back to the content hash (session/session.go:216-221), and all six cases share one session again.
    • The test is still correct. Each case waits for every summary to finish before it returns, so no flight is left to block the next case. Also, a skipped summary call now makes the test fail.
    • But the comment at lines 25-26 ("Each case has its own session, so one case's summary in flight cannot block the next") is not true. The guard is the wait, not the session.
    • Fix, either one: use a safe id (for example, an index: fmt.Sprintf("token-canary-%s-%d", route.name, i)), or change the comment to name the wait as the guard.

What I checked

  • Last review: round 1, b963b22, 2026-11-11T15:30:42Z
  • New commits read: 1. a30c0fa0 test(proxy): wait for the summary call before the token check
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
  • New items since my last review:
    • Reviewer 1's round-1 review (15:32:11Z). I checked its finding 1. It is the same defect as my finding 1, and it is fixed. I checked its two non-blocking points. Both are fixed.
    • The author's reply comment (15:35:02Z). I checked each claim against the new diff: the wait, the "max_tokens" marker, the per-case session header, r.URL, the read error and the slices. All are true in the code except "its own session" (see Non-blocking). I accept the mutant result as the author's report. I could not run it.
  • The full new diff of proxy/summarytoken_test.go (+42/-18), and the whole file around it.
  • offload.WaitForAllSummariesForTest (components/offload/summarize_testhook.go:64-76). It polls the global inFlight map until it is empty, with a deadline. That is the correct wait for a detached summary.
  • The x-context-guru-session path: session.Scoped → safeExplicit (session/session.go:43-65, 206-226).
  • This is a test-only PR. No behavior change and no data-dependence change, so docs/data-dependence.md needs no update.
  • I did not run the tests. Live tests are not approved, and Go is not installed on this machine.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.316 offload-review skill, @vz-ibm's session resumed 1 of 2 2 of 2 a30c0fa0c540 approve

Verdict: approve

Findings

None.

Earlier findings

  • Reviewer 1, finding 1 (the test does not wait for the summary call): fixed.
    • proxy/summarytoken_test.go:79 calls offload.WaitForAllSummariesForTest(5 * time.Second) and fails on a timeout.
    • The helper (components/offload/summarize_testhook.go:64-76) polls the same global inFlight registry that startAsyncSummary fills. inFlight.begin runs on the request goroutine, before the forwarded request goes out. So the job is in the registry before the client gets its response, and the wait cannot return early.
    • The helper does not wait for deferred commissions (coldDeferred, warmDeferred). Only CacheAwareSummarizer.deferSummary (components/offload/cache_aware_cold.go:103) makes those. This test uses plain summarize, so no deferral applies.
    • Lines 84-94 fail when no request carries "max_tokens". The OpenAI cheap-model client sets it (cheapmodel/openai.go:245). The client's chat body has none, and no proxy code adds one (I searched proxy/ and apply/). So the check needs a real summary call. A missing summary call now makes the test fail. It cannot pass without the check.
    • Each case sends its own x-context-guru-session (line 72). So the cases have different conversation keys, and one case's flight cannot block the next.
    • The author says the mutant now removes only the setUpstreamAuth call in Dispatcher.Do, and the 2 damaged-token cases failed 5 of 5. That mutant isolates the summary exit. I accept the report. I could not run it myself.
  • Reviewer 2, finding 1 (same defect): fixed. The same proof applies. The fix uses the helper and the per-case session that reviewer 2 proposed.
  • Non-blocking points (r.URL, the io.ReadAll error, the case order): all fixed. Line 53 records r.URL.String(). Lines 47-50 report a read error with t.Errorf, which is correct in a handler goroutine. Routes and cases are slices now.

Non-blocking

  • proxy/summarytoken_test.go:87: "max_tokens" is an indirect sign of a summary call. It holds today. If the proxy ever adds max_tokens to a forwarded body, the count can come from the forwarded request. A match on part of the summarize prompt is a direct sign. This is not needed for merge.

What I checked

  • Last review: round 1, b963b22, 2026-11-11T15:32:11Z
  • New commits read: 1 (a30c0fa test(proxy): wait for the summary call before the token check)
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
  • New items since my last review:
    • Commit a30c0fa: read the full diff and the whole changed file. Reviewed above.
    • Comment by vz-ibm at 2026-11-11T15:35:02Z (round-1 replies): I checked each of its 4 points against the code. All 4 are true for the code I can read. The mutant runs and go test -race are the author's report. I did not run them.
    • Reviewer 2's round-1 review (15:30:42Z, posted before mine): read in full. Its finding and non-blocking points are covered above.
  • The helper WaitForAllSummariesForTest is in a non-_test.go file, so package proxy can import it. proxy/cgllm_test.go already uses it.
  • The wait is global. Go runs top-level t.Parallel tests only after the sequential ones finish, and this test is sequential. So other tests cannot keep the registry busy during this wait.
  • x-context-guru-session does not go upstream: copyHeaders drops x-context-guru-*.
  • Repo rules: test-only change, no behavior change, no data-dependence change. The commit has DCO sign-off and Assisted-By:.
  • I did not run the test. Go is not installed, and live tests are not approved.

The case name held a space and a quote, which the session check
refuses, so all cases fell back to one content-hash session. The id is
now the route and the case index. Raised by reviewer 2 of #1092.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Round 2 replies. Both reviewers approve.

  1. The per-case session id does nothing (reviewer 2): fixed in 32699e0. The id is now token-canary-<route>-<index>, which passes safeExplicit. The comment is now true. The wait stays the main guard.
  2. "max_tokens" is an indirect sign (reviewer 1): no change. It holds today, as both reviews checked. A match on the summarize prompt would tie the test to prompt text that changes more often.

The review budget (2 rounds) is used. The last commit changes only the session id string in the test.

Checks: go test -count=2 -race -run TestSummaryCallNeverSendsContextGurusToken ./proxy/ OK. go vet OK.

@amiddavid

Copy link
Copy Markdown
Collaborator

Integrator note: the owner added this PR to v0.7.4 (2026-11-12). Its 2 approvals are at a30c0fa, and the head has new code since then (approval-still-valid.sh prints CHANGED). Please run the next offload-review round on the final head, then tell the integrator session.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

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 (claude, user of @amiddavid) Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 1 of 2 3 of 3 32699e094e7b approve

Verdict: approve

Findings

None.

Earlier findings

  • Reviewer 1, round 1, finding 1 (the test does not wait for the summary call): fixed in a30c0fa. The fix is unchanged at this head (proxy/summarytoken_test.go:80-95).
  • Reviewer 2, round 1, finding 1 (same defect): fixed, for the same reason.
  • Reviewer 2, round 2, non-blocking (the per-case session id does nothing): fixed in 32699e0.
    • The id is now token-canary-<route>-<index>, for example token-canary-openai-0 and token-canary-bob-2 (line 73).
    • safeExplicit allows [A-Za-z0-9._:-] (session/session.go:43-65). Both route names (openai, bob) and the digits are in that set. The id is not all dots and is short. So Scoped uses the id, not the content hash. The 6 cases now have 6 different sessions.
    • So the comment at lines 26-27 ("Each case has its own session") is now true.
  • Reviewer 1, round 2, non-blocking ("max_tokens" is an indirect sign): rejected by the author. The reason: a match on prompt text ties the test to text that changes more often. I accept it. Both round-2 reviews confirmed the marker holds today, and the check fails loudly (summaries == 0) if it ever stops finding a summary call.

Non-blocking

  • proxy/summarytoken_test.go:96: for i, s := range seen shadows the outer case index i from line 44. It is correct: line 73 reads the outer i before the shadow starts. A different name (for example n) would make the two clearer. Not needed for merge.

What I checked

  • Last review: round 2, a30c0fa, 2026-11-11T15:37:26Z
  • New commits read: 1 (32699e09 test(proxy): give each token-canary case a valid session id)
  • Read in full: 4 reviews, 3 comments, 0 inline comments (from the three files)
  • New items since my last review:
    • Commit 32699e0 (+3/-2): read the diff and the whole file (141 lines). Reviewed above. It changes only the session id string and adds the fmt import. The commit has DCO sign-off and Assisted-By:.
    • Comment by vz-ibm at 2026-11-11T15:38:59Z (round-2 replies): point 1 checked against safeExplicit and line 73, true. Point 2 is the rejection above, accepted.
    • Comment by amiddavid at 2026-11-12T07:13:11Z (integrator note: approvals are at a30c0fa, head changed): this review is the round on the final head that the note asks for.
    • Reviewer 2's round-2 review (2026-11-11T15:36:55Z): read in full. Its one point is the session id, now fixed.
  • Go 1.22+ loop-variable semantics (module is Go 1.26): each subtest closure gets its own i, route and tc.
  • Full PR diff against base f123d528: one new file, proxy/summarytoken_test.go. Test-only. No behavior change, no data-dependence change, no binary.
  • I did not run the test. Go is not installed, and live tests are not approved.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

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 (claude, user of @amiddavid) Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 2 of 2 3 of 3 32699e094e7b approve

Verdict: approve

Findings

None.

Earlier findings

  • Reviewer 2, round 1, finding 1 (no wait for the summary call): fixed in a30c0fa. It stays fixed at this head. Lines 79-81 wait with WaitForAllSummariesForTest. Lines 85-95 fail when no summary call came.
  • Reviewer 1, round 1, finding 1 (same defect): fixed, for the same reason.
  • Reviewer 2, round 2, non-blocking (the per-case session id does nothing): fixed in 32699e0.
    • The id is now fmt.Sprintf("token-canary-%s-%d", route.name, i) (line 73). Example: token-canary-openai-0.
    • Every character is in the safeExplicit allow-list (session/session.go:43-65): letters, digits, -. The length is far below MaxExplicitLen. So Scoped uses the id and does not fall back to the content hash.
    • The 6 ids are distinct: 2 routes × index 0-2.
    • So the comment at lines 26-27 ("Each case has its own session") is now true.
  • Reviewer 1, round 2, non-blocking ("max_tokens" is an indirect sign): rejected by the author. The reason: a match on the summarize prompt ties the test to prompt text that changes more often. I accept it. It is non-blocking, and the marker holds today, as both round-2 reviews checked.

Non-blocking

  • proxy/summarytoken_test.go:96: for i, s := range seen shadows the outer case index i (line 44). It is correct: the outer i is used only at line 73, before the loop. A different name (for example n) would read more clearly. Not needed for merge.

What I checked

  • Last review: round 2, a30c0fa, 2026-11-11T15:36:55Z
  • New commits read: 1
    • 32699e09 test(proxy): give each token-canary case a valid session id (+3/-2, proxy/summarytoken_test.go)
  • Read in full: 4 reviews, 3 comments, 0 inline comments (from the three files)
  • New items since my last review:
    • Reviewer 1's round-2 review (15:37:26Z). Approve. Its one non-blocking point is covered above.
    • The author's round-2 reply (15:38:59Z). I checked point 1 against the code: true. I accept point 2 (see above).
    • The integrator note by amiddavid (2026-11-12T07:13:11Z). It asks for a review round on the final head. This review is that round, at 32699e09.
  • The whole file at this head (141 lines), not only the diff lines.
  • session.Scoped and safeExplicit (session/session.go), for the new id.
  • The whole PR is still 1 file, proxy/summarytoken_test.go. No binary, no behavior change, no data-dependence change. docs/data-dependence.md needs no update.
  • All 3 commits have Signed-off-by: and Assisted-By:. None has Co-Authored-By.
  • I did not run the tests. Live tests are not approved, and Go is not installed on this machine.

@amiddavid
amiddavid merged commit cd82e95 into main Nov 12, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 12, 2026
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.

2 participants