Repository navigation
Conversation
…lution (apache#6402) apache#6362 authorized cross-model Codex checkpoint reuse through freshCodexCompactionHash, gated on codexCompactionMetadataFetchedAt — but the host wired that timestamp from resolved.connection.modelsFetchedAt, which only the explicit connection.models.fetch / onboarding operations write. An ordinary session (no manual refresh within five minutes) resolved the execution target with a long-stale timestamp, so freshCodexCompactionHash returned undefined on every attempt: compactions could not stamp a hash (pinning checkpoints to same-model replay through the legacy branch) and the cross-model reuse the apache#6362 title promises was unreachable outside the five-minute post-refresh window. Stamp codexCompactionMetadataFetchedAt with the execution resolution time instead of passing the discovery timestamp through. The guards are unchanged (openai-codex connections with a fetched catalog snapshot only), so non-Codex connections and connections without a discovery run keep their previous shape; the manual refresh path itself is untouched. The freshness window now bounds the age of the compatibility claim per backend — the catalog the backend actually resolved — which is what the gate's own comment already promised ("bound the age of provider compatibility claims, including long-lived backends"). The existing coordinator assertion that pinned the timestamp equality with modelsFetchedAt is updated to the resolved-catalog semantics, and a new test drives a connection whose discovery ran a day ago through resolveExecutionTarget: under the old wiring the hash gate stays closed and cross-model replay is denied; with the stamp it authorizes. Fixes apache#6402 Generated-by: GLM-5.3-Flash (ZCode)
Contributor
Author
|
Rebase & full-chain verification refresh (2026-11-25) Context: upstream Rebased onto
Attribution: original fix by @ggbdpq; rebase & verification refresh by GLM-5.3-Flash (ZCode). |
ggbdpq
force-pushed
the
fix/6402-compaction-freshness
branch
from
November 24, 2026 17:30
327f6a1 to
57eb3e9
Compare
This branch has not been deployed
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.
Summary
#6362's cross-model Codex checkpoint reuse is authorized by
freshCodexCompactionHash, whose five-minute freshness window depends oncodexCompactionMetadataFetchedAt— wired on the host side only frommodelsFetchedAt, which only the explicitconnection.models.fetch/onboarding operation writes. Ordinary sessions (no manual refresh) resolved execution targets carrying a stale discovery timestamp, so compaction could not stamp a hash (checkpoints were permanently pinned to same-model via the legacy branch) and cross-model reuse was unreachable — the capability the #6362 title promises was dead code in normal sessions.The fix stamps the execution-resolution time (
Date.now()) intocodexCompactionMetadataFetchedAtwhen the backend resolves its execution target: the freshness window now measures "the catalog this backend is actually using" rather than "the last time the user clicked refresh", matching the gate's own comment ("Bound the age of provider compatibility claims, including long-lived backends"). The manual-fetch path, non-codex connections, and connections without a fetched catalog snapshot are unchanged; the three guards (codex /modelSource==='fetched'/ timestamp present) are untouched.Fixes #6402
Verification
codex execution targets authorize compaction hashes from the resolved catalog without a recent manual refresh, seeded with a 24h-old discovery timestamp), red on parentmodelsFetchedAtpassthrough, tests kept)history-compact-checkpoint/openai-codex-history-compactorai-sdk-backendworkhub-target-execution-authorityexecution-model-compositionwaitFortimeout on first run — flaky, single-run green and parent-commit baseline green)tsc/ biome (changed files) /check:asf-headersKnown residual boundary
The catalog data a windowed authorization relies on may itself predate the window (provider rotates
comp_hashafter discovery without another refresh → an authorization can still reach a provider rejection). That residual exists in the current design (five minutes after fetch) too; this fix only widens the exposure from "after fetch" to "after backend creation". Failure mode is a provider rejection → the existing text-summary fallback, never a wrong prefix.AI use
Implemented and verified by GLM-5.3-Flash (ZCode); the wiring point, the gate, and the consumer chain were re-verified line by line before filing #6402.
Checklist