fix(cli): separate model reload and make foreground restart actually restart #287

Merged
karsten merged 4 commits from fix/model-catalog-reload into main 2026-11-06 08:10:39 +00:00
Owner

User-visible failures

/reload-skills incidentally invalidated the model catalog while existing sessions kept stale same-ID API/protocol objects. /restart exited 75 and left a native foreground user in the shell.

Fix

Explicit admin-only /reload-models refreshes the shared SDK catalog locally without model requests or network discovery. Existing model IDs/reasoning and conversation history are preserved; same-ID metadata is reapplied at the next turn. Skills/MCP reload does not alter the catalog. Active prompts/compaction refuse mutation; new prompts wait for reload. Invalid configuration blocks inference until corrected/reloaded without silent fallback. Successful reload releases only queued topic metadata via a durable save.

The installed npm executable is a foreground launcher: wait for old process and IPC closure, restart only on 75, preserve arguments, forward graceful signals, resume the selected TUI conversation from bounded IPC metadata. Normal quit/failure does not restart. Direct CLI/container entrypoints retain external-supervisor semantics.

Verification

Final exact candidate typecheck/build and 1559/1559 full tests passed, no skips. Real SDK test changes the API for the SAME model ID and confirms old sessions refresh only after explicit model reload, keeping thinking/history. Invalid catalog blocks inference and can recover after repair. Commands test admin isolation and no skill/resource side effects. Queued topic retries respect the persistence barrier. Subprocess tests cover signals, no overlapping writer, normal exits and retained arguments.

Actual pseudoterminal smoke test twice: /restart replaces the runtime PID, same conversation metadata, /quit exits foreground launcher with 0, no model requests. Independent tool-free review found no remaining concrete regressions after the IPC handoff ordering was fixed.

The local Claude 400 was separately reproduced and corrected through per-model openai-completions (user model/role selections unchanged). Recovery notice fix #286 is already merged and included. Existing running processes must restart to import the new code.

## User-visible failures /reload-skills incidentally invalidated the model catalog while existing sessions kept stale same-ID API/protocol objects. /restart exited 75 and left a native foreground user in the shell. ## Fix Explicit admin-only /reload-models refreshes the shared SDK catalog locally without model requests or network discovery. Existing model IDs/reasoning and conversation history are preserved; same-ID metadata is reapplied at the next turn. Skills/MCP reload does not alter the catalog. Active prompts/compaction refuse mutation; new prompts wait for reload. Invalid configuration blocks inference until corrected/reloaded without silent fallback. Successful reload releases only queued topic metadata via a durable save. The installed npm executable is a foreground launcher: wait for old process and IPC closure, restart only on 75, preserve arguments, forward graceful signals, resume the selected TUI conversation from bounded IPC metadata. Normal quit/failure does not restart. Direct CLI/container entrypoints retain external-supervisor semantics. ## Verification Final exact candidate typecheck/build and **1559/1559 full tests passed**, no skips. Real SDK test changes the API for the SAME model ID and confirms old sessions refresh only after explicit model reload, keeping thinking/history. Invalid catalog blocks inference and can recover after repair. Commands test admin isolation and no skill/resource side effects. Queued topic retries respect the persistence barrier. Subprocess tests cover signals, no overlapping writer, normal exits and retained arguments. Actual pseudoterminal smoke test twice: /restart replaces the runtime PID, same conversation metadata, /quit exits foreground launcher with 0, no model requests. Independent tool-free review found no remaining concrete regressions after the IPC handoff ordering was fixed. The local Claude 400 was separately reproduced and corrected through per-model openai-completions (user model/role selections unchanged). Recovery notice fix #286 is already merged and included. Existing running processes must restart to import the new code.
karsten deleted branch fix/model-catalog-reload 2026-11-06 08:10:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/core!287
No description provided.