feat(agent-core-v2): fail fast on unsupported [secondary_model].default_effort - #3785
Conversation
|
|
@codex review |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 160f3c99cc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
| const pool = resolveSubagentModelPool(config); | ||
| if (pool !== undefined) assertValidSubagentModelPool(pool, modelCatalog); | ||
| assertValidSubagentDefaultEffort(section, pool, modelCatalog); |
There was a problem hiding this comment.
Add the required user-facing changeset
This changes CLI-visible behavior by rejecting previously accepted configuration during session creation, but the commit adds no .changeset entry, so the generated CLI changelog will omit the change. Add a patch changeset for @moonshot-ai/kimi-code.
AGENTS.md reference: AGENTS.md:L86-L87
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Deliberate decision: skipping the changeset. The new error only fires on configurations that were already broken in effect — the configured effort was silently ignored or clamped before this change, so no working setup changes behavior. The changelog entry would describe a failure mode no valid config can hit.
| if (effort === undefined || pool === undefined) return; | ||
| for (const alias of Object.keys(pool.models)) { | ||
| const model = modelCatalog.get(alias); | ||
| if (modelSupportsThinkingEffort(effort, model, true)) continue; |
There was a problem hiding this comment.
Reject off for always-thinking pool models
When a pool alias resolves to a model with alwaysThinking: true and default_effort = "off", modelSupportsThinkingEffort returns true for off unconditionally, so this validation accepts the configuration. During binding, resolveThinkingEffortForModel converts that explicit off to the model default or on, meaning session creation still succeeds while silently ignoring the configured pool-wide kill switch; handle always-thinking models before accepting off.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 484d78f6c7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ); | ||
| } | ||
| if (modelSupportsThinkingEffort(effort, model, true)) continue; | ||
| if (!modelSupportsThinking(model)) { |
There was a problem hiding this comment.
Read adaptive thinking from provider options
When a custom-named Anthropic-compatible model relies on adaptive_thinking = true without also declaring the thinking capability, this rejects every concrete default_effort as unsupported. ModelCatalogService.buildProtocolProviderOptions stores that flag in model.providerOptions.adaptiveThinking, not on the top-level Model, while ProtocolAdapterRegistry.resolve later forwards it to the requester as valid thinking metadata; passing only model to modelSupportsThinking therefore produces a false negative and prevents session creation for an otherwise supported configuration. Include the provider-option adaptive flag in the metadata used by this validation.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
- MoonshotAI#3750 loop_control.compaction_max_attempts caps one compaction round's requests (default 5, upstream's, replacing the hardcoded 10) - MoonshotAI#3785 reject an unsupported [secondary_model].default_effort at load time, and surface adaptive_thinking on the catalog model - MoonshotAI#3681 warn on [models] entries missing the model field - MoonshotAI#3752 tower resolves a caller by its last roster entry and retires duplicate agent ids; only ENOENT means an uninitialized workspace - MoonshotAI#3778 evict completed subagent scopes behind an LRU cache (KIMI_CODE_SUBAGENT_SCOPE_CACHE_SIZE, default 32) and rebuild them from the persisted resume record on demand - MoonshotAI#3747 aborting an unknown or already-settled prompt answers 40402 instead of 40903, end to end through the protocol and kimi-web - MoonshotAI#3720/MoonshotAI#3717 scope task notifications by session, so one session's print turn can no longer consume another's completion The allowlist verdicts move to ported where the behavior landed, and ROADMAP 6.1 records the evidence and what stayed open.
Related Issue
Internal change, no linked issue — motivation explained below.
Problem
[secondary_model]offers subagents a pool of models, but the section-widedefault_effortwas a plain string checked against nothing:assertValidSubagentModelConfigvalidated pool structure (aliases resolve,forceconstraints) but never the effort against any pool model'ssupport_efforts.Same config, two silent failure modes, no signal to the user. Effort scales are also model-private (
low/high/maxvslow/medium/high/xhigh/max/ultra), so one section-wide value is routinely meaningless for part of a heterogeneous pool.What changed
assertValidSubagentModelConfig(runs at session scope creation, alongside the existing pool validation) now validates the section'sdefault_effort:force = true— using the samemodelSupportsThinkingEffortpredicate as request-time validation, so config-time and request-time semantics agree.offstays valid everywhere (pool-wide thinking kill switch); models declaring nosupport_effortspass (nothing to check against, not a detectable silent failure).CONFIG_INVALIDnaming the effort, the offending model, and its supported efforts — session creation fails loudly instead of running with a silently different effort.Per-entry effort defaults remain the model-level mechanism (
[models."<alias>".overrides].default_effort); this change only removes the silent failure of the section-wide knob.Tests:
subagentModelsValidation.test.tsgains cases for the unsupported-effort failure (pool and force modes), the non-thinking-model failure, and the passing shapes (all models support the effort, no declared effort list,off).Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.