Skip to content

feat: add reload commands - #383

Merged
liruifengv merged 7 commits into
mainfrom
reload-config
Jun 4, 2026
Merged

feat: add reload commands#383
liruifengv merged 7 commits into
mainfrom
reload-config

Conversation

@liruifengv

@liruifengv liruifengv commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

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

  • Added /reload to reload the current session and apply updated config.toml settings together with tui.toml UI preferences.
  • Added /reload-tui to reload only tui.toml UI preferences without rebuilding the active session.
  • Added Core and SDK reload support plus TUI tests covering command resolution, reload behavior, and transcript preservation.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ed23fe0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@moonshot-ai/agent-core Minor
@moonshot-ai/kimi-code-sdk Minor
@moonshot-ai/kimi-code Minor
@moonshot-ai/acp-adapter Patch
@moonshot-ai/migration-legacy Patch

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/agent-core/src/session/index.ts
Comment thread apps/kimi-code/src/tui/kimi-tui.ts
Comment thread packages/agent-core/src/rpc/core-impl.ts
Comment thread apps/kimi-code/src/tui/commands/reload.ts
Comment thread apps/kimi-code/src/tui/commands/reload.ts
@pkg-pr-new

pkg-pr-new Bot commented Jun 3, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@ed23fe0
npx https://pkg.pr.new/@moonshot-ai/kimi-code@ed23fe0

commit: ed23fe0

@liruifengv liruifengv changed the title 新增 /reload 与 /reload-tui 命令 feat: add reload commands Jun 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/agent-core/src/rpc/core-impl.ts
@liruifengv
liruifengv merged commit 15d71b5 into main Jun 4, 2026
8 checks passed
@liruifengv
liruifengv deleted the reload-config branch June 4, 2026 05:29
@github-actions github-actions Bot mentioned this pull request Jun 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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({});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

3 participants