feat: add reload commands - #383
Conversation
🦋 Changeset detectedLatest commit: ed23fe0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51c70c5425
ℹ️ 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".
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa19d63a5a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed23fe091c
ℹ️ 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".
| } | ||
|
|
||
| export async function handleReloadCommand(host: SlashCommandHost): Promise<void> { | ||
| const tuiConfig = await loadTuiConfig(); |
There was a problem hiding this comment.
Handle invalid TUI config during reload
When tui.toml has a parse or schema error, loadTuiConfig() throws TuiConfigParseError; startup catches that error and applies its fallback defaults, but this new /reload path does not. In that scenario /reload aborts before reloading the active session or runtime config at all, even though the error message says defaults are being used, so a bad UI preference file prevents users from applying fixed config.toml changes until they restart or manually fix the TUI file.
Useful? React with 👍 / 👎.
| const session = host.session; | ||
|
|
||
| if (session !== undefined) { | ||
| await session.reloadSession(); |
There was a problem hiding this comment.
Mark reload as busy before rebuilding the session
Because slash-command execution is fire-and-forget and this active-session path does not call beginSessionRequest() or otherwise set streamingPhase away from idle, a user can submit another prompt while /reload is still closing and resuming the core session. During that window KimiCore.reloadSession() closes/deletes the old session before resumeSession() completes, so the prompt can race into SESSION_NOT_FOUND or the old runtime instead of being queued until reload finishes.
Useful? React with 👍 / 👎.
|
|
||
| this.reloadProviderManager(); | ||
| this.clearRuntimeCache(); | ||
| await this.reloadPlugins({}); |
There was a problem hiding this comment.
Report plugin reload errors during session reload
PluginManager.reload() records per-plugin materialization failures in its returned errors array rather than throwing, and /plugins reload surfaces that count, but this session reload discards the summary and continues to resume. If a changed plugin manifest or MCP declaration is broken, /reload reports success while the reloaded session silently omits that plugin's skills/MCP servers, leaving users with missing tools and no indication of the cause.
Useful? React with 👍 / 👎.
Related Issue
No linked issue.
Problem
Users need a way to apply configuration changes from an active TUI without restarting the CLI, while keeping TUI-only preference reloads separate from full session reloads.
What changed
/reloadto reload the current session and apply updatedconfig.tomlsettings together withtui.tomlUI preferences./reload-tuito reload onlytui.tomlUI preferences without rebuilding the active session.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.