Skip to content

Capability + image lanes: paid requests stop silently changing shape - #134

Merged
anantham merged 2 commits into
mainfrom
fix/fable-capability-integrity
Jul 28, 2026
Merged

Capability + image lanes: paid requests stop silently changing shape#134
anantham merged 2 commits into
mainfrom
fix/fable-capability-integrity

Conversation

@anantham

Copy link
Copy Markdown
Owner

Closes the integrity campaign's final slice: capability-cache provenance (no more silent structured-output downgrades), the direct-provider namespace fix, bounded require_parameters recovery, a real pricing TTL, honest image-cost precedence (4x discrepancy fixed, $0 unknowns gone), steering provenance, the inert Gemini planner config, and Google-path timeouts. 24 red-proof failures against reverted sources; 9,030 tests green. Carries the consolidated round-two WORKLOG + INBOX.

🤖 Generated with Claude Code

https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi

…age costs tell the truth

Final integrity-campaign slice, all red-proven (24 new-test failures
against reverted sources):

CAPABILITY LANE:
- Silent structured-outputs downgrade: a fetch failure or cache miss
  quietly weakened paid requests to json_object. The capability answer
  now carries provenance (metadata vs failure-default), warns once per
  model, and the adapter logs every downgrade that rests on a default
  rather than real metadata.
- Direct-provider namespace miss: the capability map is keyed by
  OpenRouter slugs, so bare direct-provider ids could NEVER hit —
  structured outputs permanently off for direct OpenAI, parameter checks
  permanently fail-open. Lookups now try the documented provider-prefixed
  slug; booleans provably flip.
- OpenRouter's real failure shape ("No endpoints found that can handle
  the requested parameters" — names no parameter) now gets ONE bounded
  retry without require_parameters + a recorded failure, instead of
  rebuilding the same failing request forever.
- The ">24h stale" pricing-cache comment described a TTL that did not
  exist: now real (serve-stale + deduped background refresh).

IMAGE LANE:
- calculateImageCost precedence was REVERSED vs its docstring (static
  table shadowed live billed prices — seedream-4.5 4x off) and unknown
  models recorded $0. Live-first now; unknowns log an error and charge
  the conservative $0.25 unpriced constant (spend-guard's pattern).
- Steering images were silently ignored by every provider except PiAPI
  while metadata recorded them as applied — provenance now records
  steeringIgnored honestly and warns loudly.
- The Gemini planner's entire config layer was inert (wrong SDK shape
  hidden by an `as any`) — system prompt, schema, JSON mime, temperature
  all silently dropped; now typed and active, and the schema-less retry
  finally retries without a REAL schema.
- Both Google image calls now have timeouts + SDK abort signals (the
  comment claimed the hang class was closed; it was open on both). Bonus
  catch from the red-proof run: the guidance wrapper's own text contained
  "safety", so a TIMEOUT was misclassified as SAFETY_FILTER — bypassed.

Also carries the consolidated round-two WORKLOG entry + INBOX deferrals
(incl. the chrome-extension keep-or-delete decision for the operator).

tsc clean; full suite 9,030 passed / 0 failed; build green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexicon-forge Ready Ready Preview, Comment Jul 28, 2026 8:22am

…s now CONSULTED

recordParameterFailure taught the cache but nothing read it: every later
request for the same model repeated the known-failing call before
retrying. Both request builders now consult hasRecordedParameterFailure
and omit require_parameters up front (logged). Cache test added; all
capability mocks updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi
@anantham

Copy link
Copy Markdown
Owner Author

Codex finding adjudicated — real record-but-never-consult: both request builders now gate require_parameters on the learned-failure cache (omitted up front with a log once a model taught us it can't route with it). Full suite green.

@anantham
anantham merged commit 35e58d9 into main Jul 28, 2026
1 of 2 checks passed
@anantham
anantham deleted the fix/fable-capability-integrity branch July 28, 2026 08:21
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.

1 participant