Repository navigation
Migrate the retired Anthropic API engine to Claude Code - #39
Conversation
A21-devs
left a comment
There was a problem hiding this comment.
Thanks, this is a clean fix. I checked it against every point in #22:
- The dropdown no longer offers the engine that isn't built.
- A saved
anthropic-apiloads asclaude-cliinmigrateSettingsChecked. The plugin, the runner (runner/host.ts,runner/settingsLoader.ts) andsettingsStoreall load through it, so nothing still sees the old value and falls through. - The note's wording lives in
copy.ts. - The test covers both the first load and a reload of the fixed settings.
EngineKind,ledgerReaderandrecordReaderkeep theiranthropic-apilabels, so old Access log rows still read correctly.
I checked out the branch and ran npm ci && npm run check on Windows: 161 files, 2,802 passed, 1 skipped, and the build is fine. There are no dependency or workflow changes.
Two small things below. Neither blocks merging, and I'll tidy them up in a follow-up.
| @@ -43,7 +43,7 @@ export type MotionPref = "system" | "reduced" | "full"; | |||
| export type AgeColours = "hue" | "lightness"; | |||
| export type ModelRole = "labels" | "summaries" | "maps" | "ask"; | |||
| /** Only the Claude Code CLI is built; the other two are listed as "later" and disabled (§5.27). */ | |||
There was a problem hiding this comment.
This comment is out of date now. Codex CLI and the local model are both built, and nothing is listed as "later" any more. Something like "The agent engines Settings › Agents offers. A stored anthropic-api from older builds loads as claude-cli" would match the code.
| this.toggle(c.organise, c.organiseDesc, a.enabled, (x, v) => void (x.agents.enabled = v)); | ||
| this.dropdown(c.engine, a.engine === "none" ? c.engineNoneDesc : undefined, { "claude-cli": c.engineCli, "codex-cli": c.engineCodex, "anthropic-api": c.engineApi, local: c.engineLocal, none: c.engineNone }, a.engine, (x, v) => void (x.agents.engine = v), true); | ||
| this.dropdown(c.engine, a.engine === "none" ? c.engineNoneDesc : undefined, { "claude-cli": c.engineCli, "codex-cli": c.engineCodex, local: c.engineLocal, none: c.engineNone }, a.engine, (x, v) => void (x.agents.engine = v), true); | ||
| if (a.engine === "claude-cli" && this.host.settings().issues.some((issue) => issue.path === "agents.engine" && issue.problem === "unknown-value")) { |
There was a problem hiding this comment.
issues on the handle only refreshes on reload(), so the note stays for the rest of the session. That includes switching to another engine and back to Claude Code. It's harmless, because the migrated value is what gets saved on the next change. I just wanted it noted in case someone wonders why the note outlives the fix.
Closes #22.
Settings › Agents now offers the implemented engines. Loading a saved
anthropic-apiselection selects Claude Code, and a note by the dropdown explains the migration. The regression test covers loading the old value and reloading the normalized settings. Historical Access log entries keep their original labels.Checklist
npm run checkpassed on Windows (typecheck, module boundaries, 2,802 unit tests passed and one skipped, production build).src/ui/copy.ts.