Repository navigation
fix: show the host's purge refusal and say auto is modern - #106
Conversation
|
Restacked onto main 1.8.0. The branch merged its parent ( Conflicts and how they were resolvedPurge row
Endpoint copy (D19)
Warning colour
Taken from
Debug rule (D24)
Plan and catalog tests
Dropped, because
|
| Round | Found | Upheld | Fixed |
|---|---|---|---|
| 1 | 8 | 7 | 7 |
| 2 | 3 | 2 | 2 |
| 3 | 0 | 0 | 0 |
Round 1 brought the in-tree auto copy (docs/redirect-planes.md) into line with D19, restored the three catalog cases, and corrected the plan's defect table, its P1a scope and the host-tokens header. Round 2 corrected the host-tokens header's reason for leaving the meter out of the card scan, and named the three catalog cases in the plan.
One stale comment in src/models-discovery.ts still says auto follows the catalog. It is left for P-R1/P-R2, which rewrite that code.
Live re-measures still owed
None for this phase: nothing on the live request path changed. CI must confirm the unit suite (including shuffled), test:mock, vp check, the bundle gate and the coverage ratchet on the restacked tree.
Every review ran on the dedicated reviewer; none fell back to the general model.
Generated by Claude Code
|
Nothing in this change is at fault: the branch carries main's generated Generated by Claude Code |
|
The regenerated file can only come from the scheduled refresh on Generated by Claude Code |
Phase **P1a** of `docs/improvement-plan.md`, restacked onto 1.8.1. Most of what shipped broken in 1.4.1 is on `main` now (#133, #135), so this is what is left: - **Purge refusal.** The purge row shows the `message` of a refusal whose `error` is the remote protocol's serialized `RemoteError`. `main` reads only a string `message` or `error`, so that refusal was reported without its reason. - **The endpoint copy (D19).** The schema description, the `config-values` doc, the card's hint and Automatic label, both READMEs and `docs/redirect-planes.md` name the per-protocol inference family for `modern`, with `auto` as its alias. A test asserts that `auto` resolves exactly as `modern` does. - **`isZenProvider("opencode-google")` regression tests.** The predicate, its agreement with `catalogPlaneForRoute`, and the usage service's Zen fallback on that route. The fix itself is on `main`. - **Warning colour.** Both rows use the bare `var(--dsw-alias-state-warn-label)` — no token fallback, because the fallback is what hid the original bug — and `host-tokens.test.ts` checks every token the card files name against the host's primitives vocabulary. - **Catalog refusal tests.** Three cases `main` lacks: the Zen-plane 404 fill, the non-JSON 200 answer, and the `retry-after` passthrough. - **Debug rule (D24).** Naming `debugFile` writes the file; `debug` governs the console only. Dropped because `main` now does it: the wrapper fix (#135), the `isZenProvider` code change, the `enrichModelsResponse` passthrough, the spinner keyframes, the `parsePurgeResult` switch, P1a's `endpointModern` label, and P1a's debug gate. Restacked by rebasing the branch's net change onto 1.8.1 rather than merging `main` into it: the branch's own history is two merges of `main`, and replaying them would have carried the pre-refresh catalog back over #151.
894fa6e to
e7ad3df
Compare
Phase P1a of
docs/improvement-plan.md. It is stacked on #105 and targets that branch; once #105 merges, its base moves tomain.It makes eight small fixes to defects that shipped in 1.4.1. Each one opened with a test that was red on the base.
@viztor/dsh-opencodewrapper re-exported adefaultthat the barrel doesn't have. That is an ESM link error on every load:SyntaxError: … does not provide an export named 'default'.export *only, written by one shared helper (scripts/wrapper-forwarder.ts).test/wrapper-forwarder.test.tslinks the generated entry against the built barrel in a real Node process. vite-node would turn the missing export intoundefinedand stay green.isZenProvider("opencode-google")answered false, because the "go" inside "google" read as the Go plane.catalogPlaneForRoutealready encodes: Go isopencode-gooropencode-go-*.request-shape.test.ts, plus a usage-service behaviour caseenrichModelsResponseanswered a 401, 403, 429 or 5xx with a 200 catalog./models.catalog.test.ts--dsw-alias-label-warning, which the host doesn't define, so warnings rendered as caption text.--dsw-alias-state-warn-label, the token the primitives' own modules use.host-tokens.test.tschecks every token the card files name against the primitives' token set. It was checked by planting a bogus token.dsh-oc-spinkeyframes.settings-usage.test.tsxdebugFilewithdebugoff.debugis the switch anddebugFileis only where it writes. The fetch patch already used this gate.stream-hook.test.ts,lifecycle.test.ts{ ok: false }failure as "not a purge result", and cast the answer.parsePurgeResult.settings-purge.test.ts,settings-card-purge.test.tsxmodernas/inference/v1, which the plugin never sends.autoas its alias. This is what the code already did; behaviour is unchanged.endpoint-copy.test.ts,pi-provider.test.tsBehaviour changes worth knowing
/modelslisting now reach the host as errors. A 401, 403 or 5xx used to show up as a full catalog. The host now gets a failed listing it can report.debugFilewithoutdebug: trueno longer writes anything. The README examples that paireddebug: falsewith adebugFilewere updated.Both notes are superseded by the restack: the passthrough is on
main(#133), and the debug rule ismain's (D24), so this PR changes no runtime behaviour around either.Review
The change was reviewed in three lenses: correctness and host contracts, tests, and repository rules. Two independent skeptics checked each finding. Over three rounds the reviewers raised 23 findings; 22 survived as low severity and were fixed, and one was refuted.
Verification
All run locally:
pnpm run checktest:mockscripts/check.tstest:mockThe diff contains no local paths.
Restacked onto main 1.8.0
The branch merged its parent (P0, #105), which carries
main1.8.0 and the harness's alpha.2 cluster. Most of what shipped broken in 1.4.1 was fixed onmain(#133, #135), so the PR is now scoped to:settings-purgeshows themessageof a refusal whoseerroris the remote protocol's serializedRemoteError.mainreads only a stringmessageorerror, so that refusal was reported without its reason. Tested insettings-purge.test.tsandsettings-card-purge.test.tsx.config-valuesdoc, the card's hint and Automatic label, both READMEs anddocs/redirect-planes.mdname the per-protocol inference family formodern, withautoas its alias.test/endpoint-copy.test.tspins this. Thepi-providerandgoogle-bridgedocs and tests say the same, and a test asserts thatautoresolves exactly asmoderndoes.isZenProvider("opencode-google")regression tests. They cover the predicate, its agreement withcatalogPlaneForRoute, and the usage service's Zen fallback on that route. The fix itself is onmain.var(--dsw-alias-state-warn-label). There is no token fallback, because the fallback is what hid the original bug. Rendering tests assert the exact string.host-tokens.test.tsalso checks that every token the five card files name is in the host's primitives vocabulary.mainlacks: the Zen-plane 404 fill, the non-JSON 200 answer, and theretry-afterpassthrough. The passthrough itself is onmain(fix: the plane decides the price, the flag and the refusal #133).main's rule. NamingdebugFilewrites the file, anddebuggoverns the console only.Dropped, because
mainnow does it:scripts/wrapper-forwarder.ts,publish-scoped.tsand its test). It landed onmainin fix(publish): the retired alias must LINK, not fail on every load #135, and P2 retires the wrapper again (D9).isZenProvidercode change. It is fixed onmain, and only the regression tests stay.enrichModelsResponserefusal passthrough and its duplicated test cases. They landed onmainin fix: the plane decides the price, the flag and the refusal #133.mainhasSPIN_KEYFRAMES(fix: the plane decides the price, the flag and the refusal #133).parsePurgeResultswitch in the purge row and itscatalogRead/strip cases. They landed onmainin fix: the plane decides the price, the flag and the refusal #133 and are covered there.endpointModernlabel.main's "Modern (inference/…)" is kept.if (debug)in the stream hook, the "only while debug is on" copy in both READMEs,config.tsandcordis.patch.yml, and thedebug: truetweak inlifecycle.test.ts). The gate is reversed tomain's rule (D24).Decisions applied: D19, which this PR's copy settles over
main's "follows the catalog". D24 for the debug gate. D22': the branch runs onmain's alpha.2@deepseek-aicluster through its parent, and P1a changes no pins. D14' (the pi pin) and D25 (the tool fallback) belong to P-T1a and P1b, and do not touch this diff.Still open: a comment in
src/models-discovery.tsstill describesautoas following the catalog. P-R1/P-R2 rewrite that code, so the comment is left for them to avoid another conflict higher up the stack.Live re-measures CI must confirm: none. This phase changes copy, a client-side message read and tests, and nothing on the live request path. CI must confirm the unit suite (including shuffled),
test:mock,vp check, the bundle gate and the coverage ratchet on the restacked tree.Generated by Claude Code