Repository navigation
fix(agents): editable model/effort catalogs for external agents (#123) - #124
Merged
Merged
Conversation
The Kanban Delegate dialog showed empty Model/Effort selects for every
provider except Claude. The dialog reads config.externalAgents[id].models /
.efforts correctly, but nothing could ever populate those arrays except the
built-in `claude` entry: the agent editor had no field for them and
POST /api/external-agents dropped them from the body.
- Settings agent form gains "Models" and "Reasoning efforts" fields
(comma-separated), prefilled on edit, in all five UI languages.
- POST /api/external-agents stores models/efforts through a shared
agent-catalog.js sanitiser (trim, de-dup, <=50 x <=64 chars). Omitted
keeps the stored list, [] clears it, a non-array is a 400.
- An entry with a leading '-' is dropped: the catalog is the allow-list
/api/delegate checks a bare {model}/{effort} argv word against, so an
option-shaped entry would arrive as a CLI flag.
- test/agent-catalog.test.js runs the browser's _parseAgentCatalog against
the server sanitiser on the same inputs, so the two cannot drift.
A catalog still shows only when the agent's template carries {model} /
{effort} (e.g. `codex -m {model} {prompt}`) — unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous assertion was vacuous: its || arm was always true. Mutation-checked: reintroducing 'else delete next[k]' in the catalog loop now fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #123.
Problem
The Kanban Delegate to Agent dialog filled Model/Effort from
config.externalAgents[id].models/.efforts, but only the built-inclaudeentry ever had them: the agent editor had no field, andPOST /api/external-agentsdropped both keys.Change
POST /api/external-agentsstores them throughagent-catalog.js(sanitizeAgentCatalog: trim, de-dup, ≤50 × ≤64 chars, leading-refused). Omitted → keep,[]→ clear (stored as[], not deleted —mergeAgentDefaults()would otherwise re-seed the built-inclaudecatalog on the next read), non-array → 400.{model}/{effort}, e.g.codex -m {model} {prompt}.Verification
npm test— exit 0 (87 files; newtest/agent-catalog.test.js, whose parity check runs the real browser_parseAgentCatalogagainst the server sanitiser; it was mutation-checked: dropping the length filter in the browser fails it).APP_DIR): set → stored sanitised (--yolodropped); omitted → preserved;models:"opus"→ 400;efforts:[]→ cleared;/api/delegatewithmodel:"--yolo"→ 400Unknown model.Not done (out of scope)
Auto-discovering models from each CLI, and a "No models available" hint in the dialog. Both are separate features.
🤖 Generated with Claude Code