← Back to Pull requests

fix(executor): drop tool schema numeric bounds outside the int64 range #6591

Closed
unknown closed this pull request without merging on Nov 26, 2026 17:11 UTC
View on GitHub
unknown unknown commented on Oct 13, 2026 13:44 UTC
Author

Summary

Follow-up to #6579. While this PR was open, upstream landed its own fix for the same issue (57d005fe, dev): strip integer numeric bounds outside the int64 range, which the Codex backend otherwise answers with an opaque HTTP 500 that cools the whole credential. This branch now merges dev (adopting that implementation wholesale, including its bounded mantissa/exponent parser) and carries the review-driven delta on top:

  • A bound is dropped only when it is a tautology over integer schemas (upper bound above MaxInt64, lower bound below MinInt64) — no int64 can violate it, so removal is lossless. This still covers the original case: IDA Pro's emulate_process options.seed with "maximum": 18446744073709552000 (u64::MAX).

  • On number-typed (and type-less) schemas the bound still restricts real JSON numbers (e.g. maximum: 1e100), so it clamps to the nearest int64 edge, keeping the keyword. An out-of-int64 exclusive bound rewrites to the non-exclusive edge (exclusiveMaximum → maximum: 9223372036854775807), since the original bound admits the edge value; a dominating non-exclusive keyword makes it simply redundant and it is dropped. The rewritten schema is only ever more restrictive than the original contract — never widened.

  • Opposite-side bounds (upper below MinInt64, lower above MaxInt64) admit no int64 at all; dropping would re-admit every value, so the schema collapses to an in-range unsatisfiable pair (minimum: 9223372036854775807 + maximum: -9223372036854775808).

  • Bounds on explicitly non-numeric schemas are dead constraints and are removed.

  • Non-integer bounds and in-range bounds (including the exact int64 edge literals) stay verbatim; the schema-aware walk still leaves the same keys inside user data (default, enum, …) untouched.
  • This resolves the open review thread (Enard52) and both Codex review findings on the original head.

    Verification

    | Claim | Command | Result |
    | --- | --- | --- |
    | Number-typed maximum: 1e100 clamped, opposite-side bounds collapse to unsatisfiable pair, tautologies still dropped (fails before: bounds were dropped) | go test ./internal/runtime/executor/helps/ -run TestNormalizeCodexToolSchemas_PreservesNumericBoundStrength -v -count=1 | red before fix, green after |
    | Upstream suite updated for the clamp semantics, still green | go test ./internal/runtime/executor/helps/ -run TestNormalizeCodexToolSchemas_StripsOutOfRangeInt64Bounds -count=1 | pass |
    | helps package | go test ./internal/runtime/executor/helps/ -count=1 | pass |
    | Codex executor paths | go test ./internal/runtime/executor/ -run 'TestNormalizeCodexTool\|TestCodex' -count=1 | pass |
    | Build | go build ./cmd/server | pass |
    | gofmt / go vet on changed files | gofmt -l / go vet ./internal/runtime/executor/helps/ | clean |

    Closes #6579

    Generated-by: GLM-5.3-Flash (ZCode)

    Diff: 362 lines (+271 / -91) across 4 files Reviewer: ggbdpq Review duration: 63566m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 362 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.353
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6591"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.6% (MEDIUM) · Higher = larger blast radius
    42.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.9% · Safe to merge
    16.9%