fix(chat): send immutable project_id and re-anchor selectedProject on rename (ENG-1028) - #516
Open
tino097 wants to merge 1 commit into
Open
Conversation
… rename (ENG-1028) The composer identified the project by NAME held in long-lived state (selectedProject, task.projectName), so a rename made the next send carry a name the server no longer knows — "Project not found". Send the rename-proof project_id whenever the renderer has one (conditional, so older servers never see the field) and refresh selectedProject by id when the projects list refetches after a rename. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the renderer half of ENG-1028: after a project rename, chat failed with
Project not found: <name>.The composer identified the project by name, held in long-lived client state —
App.selectedProject(never updated on rename) and each task'sprojectName(pinned at creation). After a rename, the next send carried a name the server no longer knows.Changes
api.js_streamResponsenow sends the rename-proofproject_idwhenever the caller has one. Conditional spread, so older servers never see an unknown field; theprojectname stays in the payload as fallback.App.jsx:handleSendFromHome/handleSendInTask/ task shells pass and carryprojectId;_conversationToTaskmapsconv.project_idso server-loaded tasks carry it too.anton:projects-changedhandler re-anchorsselectedProjectby id after the projects refetch, so a rename immediately refreshes the open project's name/path (breadcrumb + sends).Tests
src/renderer/cowork/api.stream.test.jspinsproject_idin the payload and its omission when unknown.npm test— 585 passed (58 files);npm run build— green.Companion server PR: mindsdb/cowork-server#246 (existing conversations no longer depend on the client-held name at all). Both are independently safe; merging the server PR first is preferred.
🤖 Generated with Claude Code