Skip to content

fix(chat): send immutable project_id and re-anchor selectedProject on rename (ENG-1028) - #516

Open
tino097 wants to merge 1 commit into
stagingfrom
tino097/eng-1028-project-rename-breaks-chat-project-not-found-error
Open

fix(chat): send immutable project_id and re-anchor selectedProject on rename (ENG-1028)#516
tino097 wants to merge 1 commit into
stagingfrom
tino097/eng-1028-project-rename-breaks-chat-project-not-found-error

Conversation

@tino097

@tino097 tino097 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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's projectName (pinned at creation). After a rename, the next send carried a name the server no longer knows.

Changes

  • api.js _streamResponse now sends the rename-proof project_id whenever the caller has one. Conditional spread, so older servers never see an unknown field; the project name stays in the payload as fallback.
  • App.jsx: handleSendFromHome / handleSendInTask / task shells pass and carry projectId; _conversationToTask maps conv.project_id so server-loaded tasks carry it too.
  • The anton:projects-changed handler re-anchors selectedProject by id after the projects refetch, so a rename immediately refreshes the open project's name/path (breadcrumb + sends).

Tests

  • New src/renderer/cowork/api.stream.test.js pins project_id in 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

… 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>
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