Skip to content

feat(providers): complete Fable 5.1 support - #1284

Merged
sudomaggie merged 1 commit into
developfrom
dev/fable51-support
Sep 5, 2026
Merged

feat(providers): complete Fable 5.1 support#1284
sudomaggie merged 1 commit into
developfrom
dev/fable51-support

Conversation

@Chloe-JY

@Chloe-JY Chloe-JY commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

Fable 5.1 is already discoverable, but ORG2 inherits incompatible Fable 5 defaults: the fallback catalog offers ultracode, plain side queries lose the selected effort, structured side queries send forced tool choices that 5.1 rejects, and edited/compacted histories can fail its thinking-signature check. Static metadata also understates maximum output and overstates cached-input pricing.

Solution

  • Synthesize low, medium, high, xhigh, and max, retaining the high default and authoritative live capability metadata. Saved ultracode aliases remain readable and send max; no stored selections are deleted.
  • Use always-on adaptive thinking, summarized display, and the chosen effort for both plain and tool-enabled requests. Enable drop_block with its required thinking-binding beta so the API can discard invalidated reasoning after system/tool/history changes. Preserve opaque signed blocks for provider validation, including empty visible summaries. Both response finalizers and the history converter previously dropped those valid blocks; the fix retains their signatures in the existing tool-call metadata format.
  • Translate forced tool/any choices to auto with an explicit instruction appended for the current request. Existing side-query extraction, empty-result handling, and text fallback remain in place.
  • Apply the same request construction to streaming/non-streaming and API-key, Azure Bearer, and Claude OAuth paths. Merge custom beta headers case-insensitively into one header so they cannot accidentally omit the required binding beta.
  • Record 1M context, 128K maximum output, and $0.25/Mtok cache reads, keeping Fable 5 metadata unchanged.

Checked Anthropic's migration guide, effort reference, and model specifications/pricing.

Potential risks

  • Prompting for tool use cannot guarantee a tool call. Structured side queries can still return the existing text fallback or fail to produce usable structured output.
  • drop_block trades invalid-prefix errors for lost prior reasoning; repeated history changes may increase token cost and latency. This PR does not redesign conversation persistence or measure live cache behavior.
  • Native Anthropic-compatible gateways must support the new binding control and mid-conversation system messages. Live Anthropic/OAuth/Azure/gateway calls were not run because no Anthropic API key was available in the environment; account entitlement and server-side signature validation remain unverified.
  • Bundled Fable 5.1 cached-input cost estimates decrease. No dependencies, lockfiles, database schemas, persistence formats, change, and no historical records are rewritten. Previously discarded signatures cannot be reconstructed; this fixes newly received history. Reverting this PR restores the prior catalog, pricing, and request behavior.

Verification

  • cargo test -p key_vault -p orgtrack_core --lib — 383 KeyVault tests and 592 OrgTrack tests passed; 8 existing OrgTrack tests ignored.
  • pnpm test src/types/model/info.anthropic.test.ts src/util/__tests__/modelGrouping.test.ts src/util/__tests__/modelVariants.test.ts src/util/__tests__/formatModelName.test.ts — 71 passed.
  • pnpm run typecheck:fast — passed for the whole frontend.
  • pnpm exec eslint src/ --ext .ts,.tsx,.js,.jsx --format json — 6,432 files, zero errors or warnings.
  • pnpm run check:circular — zero cycles across 6,528 modules.
  • pnpm run check:test-placement — passed across 495 directories.
  • Normal commit hooks — lint-staged (Oxlint, ESLint, Prettier), TypeScript, scoped Rust Clippy, and commitlint passed. The commit trailer records the independently measured full-frontend lint/cycle counts above.
  • git diff --check — passed. Reviewed the entire feature diff for unrelated changes, credentials, personal paths, generated files, and caches.
  • cargo clippy -p agent_core -p key_vault -p orgtrack_core --all-targets -- -D warnings — passed.
  • cargo test -p agent_core --lib providers:: — 461 passed, including serialized auth/stream/effort matrices and raw JSON/SSE signed-history replay regressions.
  • No desktop/UI automation or live provider calls ran. Screenshots are not useful for this metadata/protocol change: no components, layout, themes, or loading/error-state rendering changed. API entitlement, gateway acceptance, cryptographic binding enforcement, and prompt-cache behavior require live validation.

Architecture review

Covered all ten layers within this change: compilation; production call-chain wiring; naming; effort/model-version semantics; defaults and legacy aliases; provider ownership; readability; serialized HTTP bodies/headers; API/OAuth discovery parity; and symmetry across stream modes, auth modes, qualified ids, and neighboring models. Tests inspect requests built by prepare_request and apply_headers, including signed history, rather than only testing predicates. Broader FSM, database, React, and cloud-sync internals are outside this feature's scope. Live wire validation remains the limitation above.

Performance review

Area Verdict Evidence Change or reason kept Verification
Background work keep Both chat paths retain the same send/retry loops No new timers, polling, workers, or network calls Call-chain review and provider suite
Memory keep Compatibility values live within one prepared request; custom betas are bounded by configured headers No new retained maps, histories, or caches Input-immutability and header tests
Scope/isolation keep Auth and model are resolved on the existing client No new process-wide or cross-account state API-key/Azure/OAuth matrix and neighboring-model controls
Rendering/hot path keep Changes run at request preparation, not per SSE delta Finalizers retain signed metadata without adding empty UI blocks; the per-delta loop is unchanged Raw JSON/SSE ingestion-to-replay fixtures and request matrix

Performance verdict: pass for the changed client resource lifecycle. No CPU, latency, or prompt-cache improvement is claimed; live provider performance remains unmeasured.

Align effort, thinking history, tool choice, output limits, and pricing with the published Fable 5.1 contract.

Pre-commit hook ran. Total eslint: 0, total circular: 0
@sudomaggie
sudomaggie merged commit ac6b344 into develop Sep 5, 2026
6 checks passed
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