test(coding-agent): correct custom discovery limit contract - #3961
Merged
Conversation
The issue fixture treated one configured model's limits as provider-wide defaults for unrelated discovered ids. Cover same-id YAML precedence, exact-id model overrides, and unknown fallback independently. Lore-id: issue-3954-yaml-discovery-contract Constraint: model configuration remains identity-scoped Rejected: provider-wide cross-model limit inheritance | not supported by schema or runtime merge semantics Confidence: high Scope-risk: narrow Reversibility: easy Tested: focused issue regression and three nearby model-registry discovery checks
Yeachan-Heo
commented
Aug 6, 2026
Yeachan-Heo
left a comment
Owner
Author
There was a problem hiding this comment.
Red-team review — MERGE_READY / CLEAR
Exact head: 460285d137066278bc63d5ab275b519957bab3e1
Base: dev @ d2646cb8a (mergeable: true)
Scope (exact-head diff)
| Surface | Result |
|---|---|
| Files | 1 only — packages/coding-agent/test/issue-970-custom-provider-discovery.test.ts |
| Production / runtime code | None |
| Commits | 1 — test(coding-agent): correct custom discovery limit contract |
Contract correction (not a behavior change)
The prior assertion treated sibling-discovered models as inheriting YAML fields from a different model id (deepseek-r1 expected contextWindow: 128000 / maxTokens: 8192 from qwen3.6). That is not the post-#3927 discovery contract.
Corrected contract under test:
- Same-id YAML wins over discovery payload (
qwen3.6keeps YAML128000/8192even when discovery reportscontext_length: 256000). modelOverridesapply per discovered id (issue-3954-override-context→ 64000;issue-3954-override-max→ maxTokens 4096 while keeping discoveredcontext_length).- Uncatalogued discovery-only models use
UNK_CONTEXT_WINDOW/UNK_MAX_TOKENSplaceholders — not hardcoded sibling inheritance.
Runtime paths (model-registry.ts, discovery, providers) are untouched. This is a test-oracle fix only.
CI evidence (exact head)
| Check class | Result |
|---|---|
| Affected path validation + evidence producer | success |
Targeted test issue-970-custom-provider-discovery.test.ts |
success |
| ts-build coding-agent | success |
| native-build, gjc-state-gates, Telegram generation guard | success |
| Local public surfaces | failure — pre-checkout only: Failed to resolve action download info → Internal Server Error / Service Unavailable (GitHub Actions 5xx). No repository code executed. Documented infrastructure flake; not a product regression. |
| Windows / Python / darwin / Live release | correctly skipped |
Regression risk
| Risk | Verdict |
|---|---|
| Silent runtime change | No — zero production files |
| Weakens discovery guarantees | No — tightens oracle to real precedence (YAML same-id, modelOverrides, UNK fallbacks) |
| Masks #3927 breakage | No — CI targeted suite green at this head against post-#3927 code |
Verdict
MERGE_READY / CLEAR. Owner-authored T0 unblock. Safe to merge to dev despite Local public surfaces infrastructure 5xx.
— census red-team @ emergency audit batch
Yeachan-Heo
pushed a commit
that referenced
this pull request
Aug 7, 2026
…3952) Workflow-gate selector asks surface through session/request_permission when the client lacks elicitation.form. Permission-mode allow still auto-approves tools; the permission reverse channel is only used for asks (and for tool prompts when mode is prompt). Includes cold-broker discovery reuse when a clean exit races ownership. Rebased onto current origin/dev after #3961 fixed the issue-970 provider baseline.
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.
Summary
deepseek-r1expectation had no same-idmodelsentry ormodelOverridesentrycontext_lengthmodelOverridesfield precedence and uncataloguedUNK_*fallbackNo runtime provider-discovery source changed; model configuration remains identity-scoped with no cross-id inheritance.
Verification
bun test packages/coding-agent/test/issue-970-custom-provider-discovery.test.ts— 3 pass, 0 failbun test packages/coding-agent/test/model-registry.test.ts --test-name-pattern "discoverable bundled replacement survives refresh"— 1 pass, 0 failbun test packages/coding-agent/test/model-registry.test.ts --test-name-pattern "modelOverrides still apply after discoverable refresh"— 1 pass, 0 failbun test packages/coding-agent/test/model-registry.test.ts --test-name-pattern "newly discovered ids inherit provider fields, not another model's custom fields"— 1 pass, 0 failbun x biome check packages/coding-agent/test/issue-970-custom-provider-discovery.test.tsgit diff --checkCloses #3954
—
[repo owner's gaebal-gajae (clawdbot) 🦞]