Skip to content

fix(agents): editable model/effort catalogs for external agents (#123) - #124

Merged
Lexus2016 merged 2 commits into
mainfrom
fix/123-agent-model-effort-catalogs
Oct 3, 2026
Merged

Lexus2016 merged 2 commits into
mainfrom
fix/123-agent-model-effort-catalogs

Conversation

@Lexus2016

@Lexus2016 Lexus2016 commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Fixes #123.

Problem

The Kanban Delegate to Agent dialog filled Model/Effort from config.externalAgents[id].models / .efforts, but only the built-in claude entry ever had them: the agent editor had no field, and POST /api/external-agents dropped both keys.

Change

  • Settings → agent form: Models and Reasoning efforts (comma-separated), prefilled on edit; i18n for uk/en/ru/fr/he.
  • POST /api/external-agents stores them through agent-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-in claude catalog on the next read), non-array → 400.
  • Unchanged rule: a select shows only if the template carries {model} / {effort}, e.g. codex -m {model} {prompt}.

Verification

  • npm test — exit 0 (87 files; new test/agent-catalog.test.js, whose parity check runs the real browser _parseAgentCatalog against the server sanitiser; it was mutation-checked: dropping the length filter in the browser fails it).
  • Live server (throwaway APP_DIR): set → stored sanitised (--yolo dropped); omitted → preserved; models:"opus" → 400; efforts:[] → cleared; /api/delegate with model:"--yolo" → 400 Unknown 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

Lexus2016 and others added 2 commits October 3, 2026 12:11
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>
@Lexus2016
Lexus2016 merged commit 2c4bf3f into main Oct 3, 2026
2 checks passed
@Lexus2016
Lexus2016 deleted the fix/123-agent-model-effort-catalogs branch October 3, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Kanban "Delegate to Agent" Dialog Does Not Populate Model and Effort for Non-Claude Providers (ex:codex)

1 participant