fix(security): catalog discovery must use chat egress policy - #675
Closed
cursor[bot] wants to merge 4 commits into
Closed
fix(security): catalog discovery must use chat egress policy#675cursor[bot] wants to merge 4 commits into
cursor[bot] wants to merge 4 commits into
Conversation
Register NVIDIA NIM, OpenAI, OpenRouter, and Bytez credentials into the KV, compose a production agent pool (no GitHub Models), and fail closed on missing keys, 429 failover, and malformed upstream responses. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Replace keyword scoring and YAML-order failover with a single quality-per-unit-cost chooser. 429/5xx/timeout re-runs that chooser on the remaining healthy pool. Empty pool fail-closes without GitHub Models. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Discover chat models after each org secret is in the KV. Static seed is fallback only. Expose GET /v1/models on the gateway. No GitHub Models. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Discovery now reuses the chat-path host/IP checks, refuses redirects that would carry a KV Bearer token, and treats HTTP as an explicit lab hook. Reseed replaces the sqlite agent pool so stale discovered workers cannot linger. Sidecar CI fails when /healthz never comes up. Empty credentials are not treated as ready. Discovered models are tagged only when the id matches a capability marker. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
This was referenced Aug 16, 2026
seonghobae
marked this pull request as ready for review
August 16, 2026 17:06
Author
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
seonghobae
enabled auto-merge (squash)
August 16, 2026 17:06
auto-merge was automatically disabled
August 16, 2026 18:22
Pull request was closed
Contributor
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.
Why
PR #642 made live
GET /v1/modelsthe primary catalog (1e82827) and chooses workers by cost-performance. Catalog discovery still sent the KV Bearer token after only a hostname + HTTPS check, followed redirects, and treated anyhttp://seed URL as insecure-ok. That is a credential leak chat would have refused.#661 attempted the same egress fix on
ca2dd9fand is missing1e82827(primary catalog rewrite + capability-tag cap). Do not merge #642 or #661 in parallel with this branch.What landed (on top of #642
1e82827)provider_base_url_rejectionfor chat and discovery (public HTTPS, allowlist,getaddrinfoprivate/loopback/link-local/reserved).allow_insecure_discoveryonly (loopback lab fixtures).persist_catalog_to_agents_dbreplaces the sqliteagent_poolso a later static reseed cannot keep stale discovered workers./healthznever succeeds; no-secrets smoke skip happens only after a healthy serve.NotConfigured, no GitHub Models fallback).tag_discovered_modeltagsreasoning/review/codingonly when the model id matches a marker (the previousor "reasoning" not in tagsdefault made every discovered worker a thinker/worker/synthesizer).Tests
Local: 76 passed on that set; conventions + paper contracts also passed.
Papers
Same claim boundary as
docs/doctoring/provider-catalog.mdanddocs/doctoring/cost_performance_routing.md(APA 7). Discovery egress is now an explicit claim: no private/loopback/redirect leak of the KV key.Reviewer next action
Merge this PR instead of #642 / #661. Then point OpenCode/Strix at
http://127.0.0.1:8000/v1modelcontextual-orchestratorwith the five org secrets in the KV.