Skip to content

fix(web): persist workspace rename and hide provider manager#1234

Merged
wbxl2000 merged 5 commits into
mainfrom
fix/web-workspace-rename
Jun 30, 2026
Merged

fix(web): persist workspace rename and hide provider manager#1234
wbxl2000 merged 5 commits into
mainfrom
fix/web-workspace-rename

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — see Problem below.

Problem

Two spots in the web UI where the client never reached the daemon:

  • Renaming a workspace in the sidebar only updated local state, so the new name was lost on refresh. The client never called the daemon's update API, which already exists (PATCH /api/v1/workspaces/:id).
  • The provider management dialog's add / delete actions call POST /providers and DELETE /providers/:id, which the server does not implement yet, so they always fail with an error toast.

What changed

  • renameWorkspace now calls updateWorkspace (PATCH /workspaces/:id { name }) and applies the result locally, so the new name survives a refresh.
    • Derived workspaces (a cwd with sessions that was never explicitly registered) are rejected by the daemon with workspace.not_found, since update only looks at registered entries. In that case the name is persisted in localStorage (keyed by root) and overlaid onto the loaded list, so the rename still survives a refresh instead of erroring out.
  • Hid the provider management entry points for now: removed /provider from the slash-command list and gated the handler behind a temporary PROVIDER_MANAGER_ENABLED flag. The component and client methods are kept so the dialog can be re-enabled once the server ships provider management.

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. (web-only change, no CLI doc impact)

@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7549afc

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

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code 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

@pkg-pr-new

pkg-pr-new Bot commented Jun 30, 2026

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

commit: 7549afc

@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: fd17dafe31

ℹ️ 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".

/** Rename a workspace — persists via the daemon update API, then applies locally. */
async function renameWorkspace(id: string, name: string): Promise<void> {
try {
await getKimiWebApi().updateWorkspace(id, { name });

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 derived workspace renames

When the sidebar item is a derived workspace from existing cwd-only sessions, this call now fails before any local state is updated: GET /workspaces intentionally includes derived workspaces (WorkspaceRegistryService.list, lines 98-107), but WorkspaceRegistryService.update only looks in file.workspaces and throws WorkspaceNotFoundError when the id is absent (lines 184-190). In that supported case, users now get an error and cannot even temporarily rename the workspace, whereas the previous local-only path did update the visible name; consider registering/upserting the workspace by root or falling back for 404 derived ids before skipping the local update.

Useful? React with 👍 / 👎.

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@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: 3b53048339

ℹ️ 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".

api.getFsHome().catch(() => ({ home: '', recentRoots: [] })),
]);
rawState.workspaces = list;
rawState.workspaces = applyWorkspaceNameOverrides(list);

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 Preserve overrides when registering derived workspaces

When a user renames a derived workspace and then starts a new chat in it, startSessionAndSendPrompt registers that root with api.addWorkspace({ root: ws.root }) and upserts the daemon response. Because the saved override is only applied to the initial loadWorkspaces() list here, that upsert replaces the renamed workspace with the daemon's default basename; the name only comes back after a refresh. Please apply the saved override to workspace upserts, or pass the override name when registering, so the fallback survives the derived→registered transition.

Useful? React with 👍 / 👎.

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 7549afc628

ℹ️ 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".

@wbxl2000 wbxl2000 merged commit 882cf35 into main Jun 30, 2026
9 checks passed
@wbxl2000 wbxl2000 deleted the fix/web-workspace-rename branch June 30, 2026 18:03
@github-actions github-actions Bot mentioned this pull request Jun 30, 2026
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.

1 participant