Repository navigation
Conversation
The runtime endpoint has no /ListAvailableModels API, so /v1/models is served from the static FALLBACK_MODELS list. Models released after that list was last updated work when requested directly but never appear in /v1/models, breaking clients that rely on it for model discovery. The account manager already learns such models into its routing map on success (dynamic learning). This change also surfaces them: - ModelInfoCache.add_discovered_model(): register a model discovered via a successful request (marked _discovered) - AccountManager.report_success(): register the model in the account's model cache (account-system mode, shared by OpenAI/Anthropic routes) - legacy single-account mode: same registration right after a 200 response in both route files No probing, no extra requests, no config: a model shows up in /v1/models the first time a request with its ID succeeds. Registration is idempotent and per-process (until restart).
|
Thanks for the PR! 🎉 Before merge, we need a one-time CLA confirmation. Full CLA text: Please reply once with: You need to write once, all further messages from me can be ignored. |
I have read the CLA and I accept its terms |
|
I have read the CLA and I accept its terms |
|
@guanbear could you give a try to this gateway: https://github.com/ankitcharolia/kiro-gateway It works quite well with All AI harness and actively being developed. The most important thing is that it is ACP compliant Models are automatically detected for claude, no need to manually update when new one is released |
|
Thanks for the PR! 🎉 Before merge, we need a one-time CLA confirmation. Full CLA text: Please reply once with: You need to write once, all further messages from me can be ignored. |
|
Thanks for maintaining the project. I reviewed this against the current main branch and fixed two edge cases: a model is now advertised only after its complete response succeeds, and confirmed discoveries survive subsequent cache refreshes while fresh upstream metadata takes priority. Existing routing and success-statistics behavior is preserved. Both APIs and account modes are covered, including streaming/non-streaming, rejected requests, failed bodies, disconnects and account isolation. The 244 affected tests pass in separate processes. The full-unit run has the same 79 credential-fixture errors as unchanged main; details are recorded in the PR description. Spec and Standards reviews have no remaining actionable findings. The CLA check still reports ERROR despite my existing acceptance comments on September 20 and 21. The log for this latest push is accessible and says that @guanbear has not signed the CLA; it appears the prior acceptance has not been recorded by the bot. Could you please check or re-run the CLA verification when convenient? I have not repeated the acceptance or changed the legal wording. Thanks for your help. |
|
Thanks for your help. I checked the current CLA error log and the main-branch |
|
A brief follow-up on the remaining CLA gate: the current head still reports |
Problem
On the runtime endpoint (
runtime.<region>.kiro.dev) there is no/ListAvailableModelsAPI, so/v1/modelsis served entirely from the staticFALLBACK_MODELSlist. Models not yet included in that list may work when requested directly — the account manager even "learns" them into its routing map on success — but they never appear in/v1/models, which breaks every client that relies on the endpoint for model discovery.Approach
Register a previously unadvertised model in its selected account's cache only after a response body is collected successfully or a streaming response completes successfully. This applies to OpenAI and Anthropic APIs in both account-system and legacy modes. An initial HTTP 200 alone is insufficient: failed bodies, failed streams, rejected requests and client disconnects do not register the model.
ModelInfoCache.add_discovered_model()creates idempotent discovered metadata with default token limits.No probing, extra upstream requests, configuration or dependencies are introduced. Accounts keep separate caches, and
/v1/modelsexposes confirmed discoveries through the existing aggregation/resolver path.Verification
Current upstream base:
a5292ca04c7c, checked 2026-10-08./v1/modelsvisibility, refresh persistence, upstream metadata priority and account isolation.No accounts configured in credentials.json). The unchanged base passed 1594 tests and encountered the exact same 79 errors. The previously documented four truncation tests also have an existing cross-file order dependency; both API test files pass independently.End-to-end (2026-09-20, IAM Identity Center account via kiro-cli SQLite,
runtime.us-east-1.kiro.dev, legacy mode):GET /v1/modelsclaude-opus-5POST /v1/chat/completionswithclaude-opus-5GET /v1/modelsagainclaude-opus-5; log:Discovered new model via successful request: claude-opus-5Notes
test_routes_anthropic.py(TruncationRecovery group) fail when run in the multi-file combination on main as well — pre-existing cross-file pollution, unrelated to this change (single-file runs pass; my branch shows the identical 4 failures + this PR's new test passing).