fix(agent-core-v2): degrade broken secondary-model pool entries to startup warnings - #3369
Conversation
🦋 Changeset detectedLatest commit: 8ba05c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4096ff2ca6
ℹ️ 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 aliases = Object.keys(models); | ||
| if (aliases.length === 0) return { pool: undefined, issues }; |
There was a problem hiding this comment.
Report an invalid default when the pool is empty
When [secondary_model.models] is present but empty, this early return produces no issues even if default_model is configured or required. Since the schema accepts an empty record, a configuration such as default_model = "provider/fast" followed by an empty models table silently makes subagents inherit the caller model, without the promised startup warning that the default is not a usable pool key. Validate the missing/unavailable default before returning for zero surviving aliases.
Useful? React with 👍 / 👎.
4096ff2 to
8ba05c6
Compare
Related Issue
N/A — reported via internal feedback (no public issue).
Problem
If any entry in the
[secondary_model.models]pool references a model alias that no longer exists in[models](typical after a provider is deleted or logged out), the session-startup pre-flight threw a configuration error, so every session create/resume/fork failed — the user had to hand-editconfig.tomlbefore any session could be opened at all.What changed
Secondary-model pool problems no longer block session startup, mirroring the v1 engine's long-standing advisory semantics:
primaryalias) are filtered out; a missing or brokendefault_modelfalls back to the first surviving entry; when nothing survives, subagents inherit the caller's model. TheAgent/AgentSwarmtool descriptions and binding choices only see the surviving entries.getSessionWarnings,GET /sessions/{id}/warnings) reports each issue as asecondary-model-invalidwarning, which the TUI renders when the session opens.modelrequest naming it, or aforcepin — fails with the existing wrapped, actionable error naming the entry.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.