fix: resolve obvious model and todo validation issues - #3924
Conversation
Raw validation rejected malformed todo operations before coercion but returned no correction code, causing repeated opaque failures. Bounded rejection codes now identify each accepted shape without echoing untrusted input. Lore-id: 3916todo Confidence: high Scope-risk: narrow Reversibility: easy Tested: bun test packages/coding-agent/test/tools/todo-write.test.ts packages/ai/test/tool-argument-coercion.test.ts
Sonnet 5 supports Anthropic xhigh and max effort, but the capability inference only admitted Opus models. Version-scoped capability detection now includes Sonnet 5 while older Sonnet and Bedrock routes remain fail-closed. Lore-id: 3913effort Constraint: preserve older Sonnet and Bedrock effort ranges Confidence: high Scope-risk: narrow Reversibility: easy Tested: bun test packages/ai/test/model-thinking.test.ts
Alibaba rejects qwen-3.8-max because the supported provider id is qwen3.8-max. Catalog injection, onboarding, profiles, tests, and documentation now use the provider spelling and collapse the legacy discovered alias. Lore-id: 3909qwen Constraint: generator must not retain both legacy and canonical aliases Confidence: high Scope-risk: narrow Reversibility: easy Tested: bun test packages/ai/test/generate-models.test.ts packages/coding-agent/test/provider-onboarding.test.ts packages/coding-agent/test/model-profile-activation.test.ts packages/coding-agent/test/model-profiles-catalog.test.ts
The Qwen model documentation update changes the embedded docs payload, so the generated index must be refreshed for public-surface sync. Lore-id: 3909docs Confidence: high Scope-risk: narrow Reversibility: easy Tested: bun run generate-docs-index
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47cab2e8dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const legacyQwenIndex = models.findIndex( | ||
| model => model.provider === "alibaba-token-plan" && model.id === "qwen-3.8-max", | ||
| ); |
There was a problem hiding this comment.
Canonicalize all legacy Qwen entries
When authenticated generation receives qwen-3.8-max from both models.dev and the Alibaba catalog, these sources are concatenated before this function runs, but findIndex converts or removes only the first legacy entry. The later ID-keyed deduplication then sees one renamed qwen3.8-max and one remaining qwen-3.8-max as distinct, so the generated catalog still exposes the rejected legacy selector; remove or canonicalize every matching legacy entry before grouping.
Useful? React with 👍 / 👎.
Boundary review found that catalog injection removed only one qwen-3.8-max row and that todo_write docs still advertised targetless done/drop operations. Generation now filters every legacy alias with duplicate-source coverage, and published docs match raw validation. Lore-id: 3924review1 Constraint: no generated catalog may retain qwen-3.8-max Confidence: high Scope-risk: narrow Reversibility: easy Tested: bun test packages/ai/test/generate-models.test.ts packages/coding-agent/test/tools/todo-write.test.ts packages/ai/test/tool-argument-coercion.test.ts
Summary
todo_write(todo_write raw-argument rejections surface no correction hint, causing repeated failed calls #3916)xhighandmaxeffort on Messages routes (claude-sonnet-5 capped at effort 'high' — Anthropic docs confirm xhigh/max are supported #3913)qwen3.8-maxmodel id across catalog, presets, and profiles (bug(models): alibaba-token-plan uses incorrect Qwen 3.8 Max model ID #3909)Closes #3916
Closes #3913
Closes #3909
Verification
bun test packages/coding-agent/test/tools/todo-write.test.ts packages/ai/test/tool-argument-coercion.test.tsbun test packages/ai/test/model-thinking.test.ts packages/ai/test/generate-models.test.ts packages/coding-agent/test/provider-onboarding.test.ts packages/coding-agent/test/model-profile-activation.test.ts packages/coding-agent/test/model-profiles-catalog.test.tsbun --cwd=packages/ai run checkbun --cwd=packages/coding-agent run check