fix(web): persist workspace rename and hide provider manager#1234
Conversation
🦋 Changeset detectedLatest commit: 7549afc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
There was a problem hiding this comment.
💡 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 }); |
There was a problem hiding this comment.
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 👍 / 👎.
# Conflicts: # apps/kimi-web/test/workspace-state.test.ts
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Related Issue
No linked issue — see Problem below.
Problem
Two spots in the web UI where the client never reached the daemon:
PATCH /api/v1/workspaces/:id).POST /providersandDELETE /providers/:id, which the server does not implement yet, so they always fail with an error toast.What changed
renameWorkspacenow callsupdateWorkspace(PATCH /workspaces/:id { name }) and applies the result locally, so the new name survives a refresh.workspace.not_found, sinceupdateonly looks at registered entries. In that case the name is persisted inlocalStorage(keyed by root) and overlaid onto the loaded list, so the rename still survives a refresh instead of erroring out./providerfrom the slash-command list and gated the handler behind a temporaryPROVIDER_MANAGER_ENABLEDflag. The component and client methods are kept so the dialog can be re-enabled once the server ships provider management.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. (web-only change, no CLI doc impact)