Skip to content

Port v0.57.0: harden OpenCodex numeric and cache parsing - #489

Merged
Finesssee merged 1 commit into
port/micro-0.57.0-codex-whitespacefrom
port/micro-0.57.0-opencodex-numeric
Sep 13, 2026
Merged

Finesssee merged 1 commit into
port/micro-0.57.0-codex-whitespacefrom
port/micro-0.57.0-opencodex-numeric

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

Ports upstream v0.57.0 commit b1e27d266a8e1a0db991be7cf40526f12e6a4e1d (fix: reject unrepresentable numeric usage safely (#3486)) into the Windows OpenCodex spend path.

  • Rejects the rounded floating-point 2^64 boundary before the u64 cast while preserving exact JSON integer u64::MAX.
  • Adds parser version 1 to the OpenCodex parse cursor and forces a full reparse for missing or mismatched versions.
  • Keeps CACHE_SCHEMA_VERSION = 2; this is parser compatibility gating, not a cache container format change.

Scope

  • rust/src/spend_contract/opencodex.rs
  • rust/src/spend_contract/opencodex/cache.rs

This is a stacked micro-PR after #488, with base branch port/micro-0.57.0-codex-whitespace. It does not change the app version, release files, CI, or later upstream versions.

Validation

  • cargo fmt --all -- --check — passed
  • git diff --check — passed
  • Focused Rust test and cargo check --manifest-path rust/Cargo.toml --tests — attempted, but blocked before test execution because this host has no MSVC cl.exe; where.exe resolves Git's usr/bin/link.exe, so rustc fails in linking.
  • Oracle review — approved the numeric boundary, parser-version migration, test coverage, PR scope, and published stack.

Upstream reference

  • Commit: b1e27d266a8e1a0db991be7cf40526f12e6a4e1d
  • Release range: v0.56.8...v0.57.0

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0207b0d1-037a-47f4-a489-3d8a5766b5b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo-nuclear code-quality review (Oracle-coordinated read-only swarm)

Verdict: BLOCKED pending a parser-routing fix in the stacked base.

Merge-blocking finding: the inherited change at rust/src/core/jsonl_scanner/codex/helpers.rs:326 treats any raw occurrence of "turn_context" as an event candidate. In rust/src/core/jsonl_scanner/codex/parser.rs:73-88, that makes bare_candidate false; if fast-event parsing then returns None, a valid type-less usage record is silently dropped. Example: { "model": "turn_context", "usage": { "prompt_tokens": 120, "completion_tokens": 30 } }. This is a lexical heuristic crossing a mutually exclusive parser-routing boundary and can lose usage data.

Concrete remedy: make candidate detection key/value exact and whitespace-tolerant, or keep the bare-usage path eligible when fast-event parsing fails; add a regression test for the example shape. The fix belongs in the stacked #488 base so #489 and #490 inherit the repaired routing. The OpenCodex numeric boundary and cache parser-version changes themselves had no high-confidence thermo blocker.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Superseding thermo correction — PASS for this PR’s own diff.

The earlier receipt correctly identified a real failure at the stacked head but assigned the cause to this PR. Oracle’s final adjudication confirms the blocker is inherited from #488’s parser classifier change; the OpenCodex numeric and cache changes in this PR have no independent thermo blocker. This PR remains operationally blocked until the repaired #488 base flows through the stack.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo follow-up: final dependency receipt.

Oracle's final thermo adjudication passes #489's own diff. Its only remaining concern was inherited from the #488 base parser classifier; that base is now repaired in dccacc6aa and pushed to port/micro-0.57.0-codex-whitespace.

No #489 code change was required. Oracle post-fix verdict: PASS for the own diff, merge after #488 and after a fresh hosted-check read-back.

@Finesssee
Finesssee merged commit 25b75b0 into port/micro-0.57.0-codex-whitespace Sep 13, 2026
2 of 4 checks passed
@Finesssee Finesssee mentioned this pull request Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants