fix: fail-closed catalog redirects, withdraw overlay, and known-cost rank - #673
fix: fail-closed catalog redirects, withdraw overlay, and known-cost rank#673cursor[bot] wants to merge 5 commits into
Conversation
Discover models for the five org KV credential names using the PR #574 inventory/refresh design (Bytez native /models/v2, fail-closed last-known-good). Rank workers by existing capability tags first, then known price (PR #575). Unpriced is never free. Failover stays post-error resilience. Issue #86 quality/Pareto selection is deferred. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Store catalog list/original prices separately from a $0 serving channel. Use the list price in known-cost comparison so a free channel does not win as cost 0.0. Explicit $0 with no list price remains a known 0. Unknown or non-finite catalog prices stay unpriced; no list price is invented. Same-document OpenRouter :free siblings may inherit the paid row's finite pricing. Capability-first selection and fail-closed catalog discovery are unchanged. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Stop following 3xx on credential-bearing catalog GET/POST, verify TLS, and bound Bytez/catalog bodies. A later successful catalog drops withdrawn overlay ids so injected workers cannot persist. Infer capabilities from tokens and an allowlist; known cost beats tag inflation. Rename the throttle bypass to force_refresh. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
There was a problem hiding this comment.
This tip addresses the two #651 blockers: catalog urlopen no longer follows credential-bearing 3xx (open_catalog_request + CatalogRedirectHandler), Bytez POST is bounded, and overlay_discovered_agents tombstones withdrawn overlay ids while keeping seed agents. Capability tokens no longer treat eval / available as vision. Known cost now sorts before tag inflation. The refresh body field is force_refresh and the overlay reports catalog_authority.
Next action: keep this draft as the overlay landing. Do not merge #651, #642, #658, or #575 against this slice. Mark ready after the required checks on e10dc789. Two residuals below are not merge-blocking if you accept stale prices and codec→coding as follow-ups.
Do not fold issue #86, durable Postgres catalog, or GET /v1/models overlay onto this tip.
Not an approval — this automation family opened the tip.
Sent by Cursor Automation: Fix Issues
| ingested = 0 | ||
| for model_name, price in (prices or {}).items(): | ||
| if known_price_rank(price)[0]: | ||
| self.price_per_million[model_name] = float(price) |
There was a problem hiding this comment.
Important: withdrawn agents are tombstoned, but price_per_million is append-only. A later unpriced seed or different-account row that reuses the withdrawn model name inherits the stale list price and can win a known-cost tie-break it should lose as unpriced. Drop keys for withdrawn model names (or key prices by agent id).
| for needle in needles: | ||
| if needle in tokens: | ||
| return True | ||
| if len(needle) >= 3 and any(token.startswith(needle) for token in tokens): |
There was a problem hiding this comment.
Important: token.startswith("code") still tags codec (the decode fixture does not catch this). Keep exact tokens for short needles (code, vl) and prefix-match only the longer ones (codestral, embedding). Add audio-codec-v1 next to decode-helper.
|
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. |
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head35d626e306971f1d6fe6a746a3927caf20d7afe9. -
Head SHA:
35d626e306971f1d6fe6a746a3927caf20d7afe9 -
Workflow run: 32184465189
-
Workflow attempt: 1
Coverage evidence
Coverage evidence job did not run or did not publish coverage evidence.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (8 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (8 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs (9 files)"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs (9 files)"]
R2 --> V2["docs review"]
Evidence --> S3["Test (3 files)"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test (3 files)"]
R3 --> V3["targeted test run"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage evidence job did not run or did not publish coverage evidence. Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (8 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (8 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs (9 files)"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs (9 files)"]
R2 --> V2["docs review"]
Evidence --> S3["Test (3 files)"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test (3 files)"]
R3 --> V3["targeted test run"]
|


Landing vehicle for the catalog overlay slice. #651 plus redirect reject, overlay withdraw, token/allowlist capabilities, known-cost before tag inflation, and force_refresh. Do not merge #651 or #642. Refs #86, #574, #575, #651.