fix(claude-sdk-oauth): canonicalize eval summary continuity - #1498
Altairpaca wants to merge 1 commit into
Conversation
|
Rebased/synchronized onto current |
|
Reviewed against a field report of the same symptom (a Claude session re-sending the whole conversation every turn, hundreds of KB per turn). Your diagnosis is right and the fix is in the right place: the harness-owned clamp lands after the provider-final boundary was hashed, so the fingerprint has to compare the effective tool input. The three tests are the right shape too — the clamp is clean, a real summary rewrite is still One change requested before merge: do not duplicate the clamp — import it. The normalization you re-implemented in
As written, the invariant now lives in two places across a package boundary with nothing binding them. If the eval tool ever changes its limit or its ellipsis, continuity silently starts classifying clean turns as rewritten again — and the regression test added here would still pass, because it hardcodes the same two numbers on both sides of the assertion. That is the same failure class this PR is fixing, one release later. Concretely: call If you would rather not extend this PR, say so and I will land the import swap as a small follow-up right after this merges — I do not want a review round trip to hold a correct fix. The behavior you shipped is what we want either way. |
3a809ba to
fc00ace
Compare
|
Addressed the requested review change in
I also checked the final 7-file diff and exercised the package export with isolated Node ESM / TypeScript resolution plus One repository-side gate detail: this GitHub App connection cannot apply the |
Summary
Fixes #1472.
eval.prepareArgumentsnormalizes run summaries before schema validation. For summaries longer than the schema limit, the provider-final assistant can therefore differ from the committed assistant only by harness-owned normalization.AssistantCommitBoundarypreviously fingerprinted the raw tool arguments and classified that normalization asassistant_rewritten, invalidating Claude SDK continuity and making the next turn fork or cold-flatten.This patch canonicalizes the effective
evalrun summary at the continuity fingerprint boundary while keeping every other tool and argument fail-closed.Maintainer review follow-up
Addressed the requested deduplication: continuity no longer carries a second implementation of the eval summary clamp.
clampEvalSummaryhas one implementation owned by@code-yeongyu/senpi-codemode.eval-request.tscontinues to export that same helper, andtypes.tscontinues to export the sameEVAL_SUMMARY_MAX_LENGTHconstant.@code-yeongyu/senpi-codemode/eval-summaryso compiled Node code does not statically import a.tsfile from the source-only package undernode_modules.AssistantCommitBoundaryimports that canonical helper and preserves the eval-only,peek/stop, string-summary, and fail-closed guards.prepareArgumentspath instead of hand-writing an 80-character expected value.Changes
evalrunsummaryvalues forassistantContentHashusing the tool-owned normalizer.peek/stoparguments untouched.eval.prepareArguments, plus negative controls for real summary and code rewrites.Independent runtime evidence
The issue has an independent macOS arm64 reproduction on
omo-ai 5.0.0-0.beta.51/ bundled Senpi2026.9.9-2/claude-sdk-oauth/claude-fable-5-1: the committed eval summary was exactly 80 characters ending in..., the binding invalidation reason wasassistant_rewritten, and the following request flattened 72 delta messages into a 943,217-byte payload. See #1472 for the measured details.Verification status
Focused regression:
packages/coding-agent/test/suite/regressions/1472-claude-sdk-oauth-eval-summary-clamp.test.tsFinal head
fc00aceef3be605d6a349afa62eff499d74a3a4ais a single commit on current upstreammainc68ec4d3c0a2dc5fd105da69b2ab4d4e898e7e4d.Pre-submit audit checked:
prepareArgumentsis used by the continuity regression;.mjsruntime leaf and.d.mtsdeclaration;npm pack --dry-runwere exercised in an isolated package fixture.This environment cannot execute the repository's installed dependency graph, so I am not claiming a local full-suite green run. The PR-triggered CI, Changelog gate, and binary-parity workflows were created for this head but are currently
action_requiredpending repository approval; any executable type/test failure remains blocking evidence.Risk
Low and bounded to the continuity fingerprint seam. Two provider/committed tool calls compare equal only when their
evalrun summaries normalize to the same effective value that the harness executes. Semantic summary changes within the limit and changes to other eval arguments remainassistant_rewritten.No release changelog entry is included in this contributor patch; repository-side changelog policy/label handling remains with the maintainer workflow.