fix(jev): four verified transport defects (cost, model id, request cap, provenance) #50

Merged
clawdie merged 1 commit from fix/jev-cost-model-provenance into main 2026-10-28 23:32:01 +01:00
Owner

All four are reproducible offline; none needed a live call or a credential.

  • jev_batch cost aggregation undercounted to zero. The matcher used
    key.endswith("cost"), case-sensitive, and break after the first hit, so
    gateways that report {"cost": "0", "marketCost": "0.000035322", "surchargeCost": "0"} were summed as zero. It now matches case-insensitively,
    sums every component, ignores booleans, and reports whether anything was
    found. The summary prints total_cost=unknown when no cost field came back,
    instead of a confident 0.00000000.
  • A served snapshot id was rejected. Validation compared the reported model to
    the requested one literally, so a correct answer for typesafe/jev-1.14
    labelled typesafe/jev-1.14:20261015 failed with SchemaMismatch. Comparison
    now ignores a : snapshot suffix only; a different model family still fails,
    and the direct-TypeSafe jev-* alias exemption is unchanged.
  • The result now records reported_model (what the gateway says it served)
    next to model (what was requested). Provenance, not a signature.
  • --max-requests N caps HTTP requests per invocation across retries and
    provider fallback, and raises RequestBudgetExceeded before the request that
    would exceed it. 0 keeps the old unlimited behaviour.
All four are reproducible offline; none needed a live call or a credential. - jev_batch cost aggregation undercounted to zero. The matcher used `key.endswith("cost")`, case-sensitive, and `break` after the first hit, so gateways that report `{"cost": "0", "marketCost": "0.000035322", "surchargeCost": "0"}` were summed as zero. It now matches case-insensitively, sums every component, ignores booleans, and reports whether anything was found. The summary prints `total_cost=unknown` when no cost field came back, instead of a confident `0.00000000`. - A served snapshot id was rejected. Validation compared the reported model to the requested one literally, so a correct answer for `typesafe/jev-1.14` labelled `typesafe/jev-1.14:20261015` failed with SchemaMismatch. Comparison now ignores a `:` snapshot suffix only; a different model family still fails, and the direct-TypeSafe `jev-*` alias exemption is unchanged. - The result now records `reported_model` (what the gateway says it served) next to `model` (what was requested). Provenance, not a signature. - `--max-requests N` caps HTTP requests per invocation across retries and provider fallback, and raises RequestBudgetExceeded *before* the request that would exceed it. 0 keeps the old unlimited behaviour.
All four are reproducible offline; none needed a live call or a credential.

- jev_batch cost aggregation undercounted to zero. The matcher used
  `key.endswith("cost")`, case-sensitive, and `break` after the first hit, so
  gateways that report `{"cost": "0", "marketCost": "0.000035322",
  "surchargeCost": "0"}` were summed as zero. It now matches case-insensitively,
  sums every component, ignores booleans, and reports whether anything was
  found. The summary prints `total_cost=unknown` when no cost field came back,
  instead of a confident `0.00000000`.
- A served snapshot id was rejected. Validation compared the reported model to
  the requested one literally, so a correct answer for `typesafe/jev-1.14`
  labelled `typesafe/jev-1.14:20261015` failed with SchemaMismatch. Comparison
  now ignores a `:` snapshot suffix only; a different model family still fails,
  and the direct-TypeSafe `jev-*` alias exemption is unchanged.
- The result now records `reported_model` (what the gateway says it served)
  next to `model` (what was requested). Provenance, not a signature.
- `--max-requests N` caps HTTP requests per invocation across retries and
  provider fallback, and raises RequestBudgetExceeded *before* the request that
  would exceed it. 0 keeps the old unlimited behaviour.
clawdie deleted branch fix/jev-cost-model-provenance 2026-10-28 23:32:01 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/agent-skills!50
No description provided.