feat(modalities): add bounded capability contracts (#154) - #168
Merged
tcballard merged 2 commits intoAug 3, 2026
Merged
Conversation
tcballard
marked this pull request as ready for review
August 3, 2026 06:05
tcballard
force-pushed
the
codex/enterprise-modality-contracts
branch
from
August 3, 2026 06:07
6b39014 to
e07bc0f
Compare
…OADMAP-0010] The bounded modality contracts added five capability flags to DestinationCapabilities and a surface field to RoutingRequirements, but the hand-written Swift callers were not updated, so the Apple bridge tests and the iOS shell no longer compile against the generated bridge. Update every construction site to the new signatures, defaulting each non-text capability to false and each request surface to .text, matching the fail-closed defaults in wayfinder-apple-ffi.
tcballard
force-pushed
the
codex/enterprise-modality-contracts
branch
from
August 3, 2026 06:08
e07bc0f to
85ea98b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the first, fail-closed foundation slice for gateway compatibility issue #154. Shared Rust routing contracts now model embeddings, image generation, audio, and batch execution as explicit provider capabilities, while the current text gateway rejects known non-text payloads before provider delivery.
Scope
Included
InferenceSurfaceand normalized non-text capability contract.wayfinder_router_unsupported_modalityerror.Excluded
Product / Architecture Decisions
User-Facing Contract
CLI / Human Output
No CLI commands or exit codes change in this slice.
JSON Output
Known unsupported modality payloads receive HTTP
400with error typewayfinder_router_unsupported_modalityand the normal bounded request-id metadata. Ordinary text Chat Completions and Responses requests remain unchanged.Exit Codes
No CLI exit-code changes.
Verification
Ran
cargo fmt --manifest-path rust/Cargo.toml --all -- --checkcargo +1.85.0 check --manifest-path rust/Cargo.toml --locked -p wayfinder-runtime-contracts -p wayfinder-routing-core -p wayfinder-apple-ffi -p wayfinder-gatewaycargo clippy --manifest-path rust/Cargo.toml --workspace --all-targets --all-features --locked -- -D warningscargo test --manifest-path rust/Cargo.toml --workspace --all-targets --locked -qgit diff --checkCovered
Review Path
Stacked on PR #167 (
codex/enterprise-responses-api); target that branch first, then rebase this PR ontomainafter #167 merges.Notes For Reviewer
This is intentionally the smallest safe #154 slice. It creates the shared contract and fail-closed boundary without pretending that a generic OpenAI-shaped endpoint is a qualified embeddings, image, audio, or batch adapter. The four execution surfaces should land as independent follow-up PRs with their own bounds, usage/cost, concurrency/deadline, persistence (where applicable), and parity evidence.