Repository navigation
contracts: pin the CLI contract from InferenceInfra's code-complete line (draft, do not merge yet) - #218
Draft
sanchitmonga22 wants to merge 2 commits into
Draft
contracts: pin the CLI contract from InferenceInfra's code-complete line (draft, do not merge yet)#218sanchitmonga22 wants to merge 2 commits into
sanchitmonga22 wants to merge 2 commits into
Conversation
InferenceInfra's models list is about to answer a second form, `?format=openrouter-v2`: the
operation gains a `format` query parameter and its 200 becomes `ModelListResponse`, a `oneOf`
of `ModelList` and `OpenRouterModelDocumentList` with no discriminator (the query picks the
variant). The CLI sends no `format`, so it only ever reads `ModelList`.
Left in the slice, the second form stops the binding generator ("unsupported schema shape" at
OpenRouterV2ParameterDescriptor.properties: an inline object that refers to itself), and any
later change to that form would mark the CLI's pin stale for something it never reads.
extract-cli-contract.py now leaves the `format` parameter out of listModels and reads
`ModelListResponse` as `ModelList` (CLI_NARROWED_OPERATIONS). A source contract without them is
carried unchanged, so this commit alone moves no pin: wally-cli-v1.openapi.json is byte-identical.
tests/test_contract_sync.py gains three cases, red before the change: the slice keeps only the
default form; a change to the other form does not move the slice; an older source is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ine (a8259392)
Wally main's pin is the live line's (3fb1fd00, `fix/codex-harness-live`). InferenceInfra's `new_infra` ->
`staging` promotion compares this repo's main pin to the control-plane document at its head
("downstream contract freshness / Wally main vs this control-plane") and stays red until this
pin matches. This re-syncs it with `contracts/sync_from_inferenceinfra.py --from <checkout>`.
Source: InferenceInfra track/api-parity a8259392, which is `integration/code-complete`
(c76e9697) plus the catalogue and public models-list change. Its control-plane-v1 document is
byte-identical to the merge of that track into the integration branch, which is the document
that will be promoted.
What moves in the CLI slice (additive; nothing the CLI reads is removed):
- ApiErrorCode gains 34 values the staging line added (organisations, invitations, partners,
operator, price-book errors).
- `GET /v1/models` is anonymous-capable (`security: [BearerAuth, {}]`), declares the
`x-request-id` response header, and has new summary/description text.
- Wording of the reasoning, datacenter and whoami descriptions follows the source.
- The `format=openrouter-v2` form of the models list is NOT in the slice (previous commit).
console_contract.rs is regenerated (CONTRACT_SHA256 moves). The only use of the error enum
outside it is `== ApiErrorCode::KCardRequired` in console.rs, so no match needs new arms. The
decisions contract is not touched: Wally main already carries the Eve format 4 revision
(ecd738b2), which is byte-identical to the one in track/api-parity.
Checked:
- python3 tests/test_contract_sync.py 8 tests OK
- python3 contracts/generate_console_binding.py --check both bindings match their pins
- python3 contracts/sync_from_inferenceinfra.py --check Wally CLI lock OK (a8259392)
- the regenerated console_contract.rs compiles on its own (cargo check, serde_json only)
- InferenceInfra's own gate, `check_consumer_impact.py --against-wally-pin`, run on a
track/api-parity checkout against this tree: "consumer-impact: none" (CLI slice and decisions).
A full `cargo check` of wally could not run here (build.rs needs the CMake kit); CI compiles it.
Merge order: this lands before InferenceInfra's promotion PR (its consumer-impact gate reads
this repo's main). If the control-plane contract moves again before then, re-run the sync.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
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.
What this is
InferenceInfra's
new_infra->stagingpromotion runsconsumer-impact, which compares this repo'smainpin of the control-plane contract with the document at the promotion head. Against Wallymaintoday it reports two stale pins (probe run 39821135687):contracts/wally-cli-v1.openapi.json(CLI slice digest)874aaee1b08bfa883210af07contracts/wally-decisions-public-v1.openapi.jsonc58df52d97cd592f19f7d594The same check is already red against InferenceInfra
stagingitself (874aaee1b08b->ef52e0dcf18f): Wally's pin was cut from the live line (fix/codex-harness-live, 3fb1fd00).Two commits
contracts: carve GET /v1/models down to the default form the CLI reads:extract-cli-contract.pyleaves theformatquery out oflistModelsand readsModelListResponseasModelList. Needed because InferenceInfra'strack/api-paritymakes the models list answer a second form (?format=openrouter-v2) as aoneOfwith no discriminator; the CLI never sendsformat. Without this, the binding generator stops withunsupported schema shapeatOpenRouterV2ParameterDescriptor.properties. Three new tests intests/test_contract_sync.py(red before the change). No pin moves in this commit.contracts: pin the CLI contract from InferenceInfra's code-complete line (a8259392): output ofpython3 contracts/sync_from_inferenceinfra.py --from <InferenceInfra @ a8259392>. Additive only: 34 newApiErrorCodevalues,x-request-idon the models response, anonymous-capableGET /v1/models, description wording.console_contract.rsis regenerated; the only use of the enum outside it is== ApiErrorCode::KCardRequired.The decisions pin is deliberately not touched
Wally main already carries the Eve
prompt_format_version4 revision (ecd738b2, sha2562201716c...).track/api-paritybrings the same bytes to InferenceInfra's integration branch;new_infrais the one that lacks them today. So that red clears whentrack/api-paritymerges, and re-vendoring the older document here would drop format 4 from what production accepts.Checked
python3 tests/test_contract_sync.py: 8 tests OKpython3 contracts/generate_console_binding.py --check: both bindings match their pinspython3 contracts/sync_from_inferenceinfra.py --check:Wally CLI lock OK (a8259392, track/api-parity)console_contract.rscompiles standalone (cargo check, serde_json only)python3 contracts/check_consumer_impact.py --against-wally-pin --head <track/api-parity checkout> --wally-repo <this branch>:consumer-impact: nonecargo checkof wally (build.rs needs the CMake kit); CI compiles it.DRAFT: do not merge yet
integration/code-completecontainstrack/api-parity. Then re-run the gate against the integration head; if its control-plane document changed since a8259392, re-run the sync (the slice digest, not the stamp, is what is compared).🤖 Generated with Claude Code
Summary by cubic
Re-syncs the CLI contract pin to InferenceInfra's
track/api-parityline (a8259392), which is what itsnew_infra→stagingpromotion compares against; the current pin (from the live line) is stale against both Wally main and InferenceInfra staging. The decisions contract is deliberately not touched: Wally main already carries the format 4 revision the new line serves.Changes
extract-cli-contract.pynow carvesGET /v1/modelsdown to the defaultModelListform the CLI reads, dropping theformatquery and theopenrouter-v2oneOfbranch; the binding generator cannot read that shape, and a change to it must not flag the pin stale. Older sources without the query are carried unchanged.ApiErrorCodevalues, anonymousGET /v1/models, thex-request-idresponse header, and updated description wording.console_contract.rsis regenerated; its only external use is== ApiErrorCode::KCardRequired.Merge note
Do not merge yet: this pin gets ahead of what production serves. Merge only after InferenceInfra's owner confirms, once
integration/code-completecontainstrack/api-parity; re-run the sync if the control-plane document changed since a8259392. This PR lands before the promotion PR.Written for commit 34d54f6. Summary will update on new commits.