Follow-up: remove local thread-name override persistence#456
Follow-up: remove local thread-name override persistence#456
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5618b0236
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const key = makeCustomNameKey(workspaceId, threadId); | ||
| return customNamesRef.current[key]; | ||
| }, []); | ||
| const getCustomName = useCallback((_workspaceId: string, _threadId: string) => undefined, []); |
There was a problem hiding this comment.
Keep manual rename signal for title autogeneration guard
Returning undefined unconditionally from getCustomName removes the cancellation signal that useThreadTitleAutogeneration.onUserMessageCreated relies on before and after generateRunMetadata to avoid overwriting user-renamed threads. In the race where a user renames a thread while metadata generation is in flight, the post-await guard no longer trips and renameThread(..., title) can clobber the manual name when the async call resolves; this is a regression from the previous behavior where renameThread immediately updated custom-name state.
Useful? React with 👍 / 👎.
Motivation
localStoragecould permanently maskthread/name/updatedevents and list refreshes, causing the UI to diverge from Codex thread state.thread/name/setto Codex.Description
codexmonitor.threadCustomNamesby removing calls tosaveCustomNameand localcustomNamesRefupdates fromuseThreads.renameThread(src/features/threads/hooks/useThreads.ts).useThreadStorageso it no longer hydrates or listens to a custom-names localStorage key and instead exposesgetCustomNamethat always returnsundefined(src/features/threads/hooks/useThreadStorage.ts).src/features/threads/hooks/useThreadStorage.test.tsx,src/features/threads/hooks/useThreads.integration.test.tsx).Testing
npm run test -- src/features/threads/hooks/useThreadStorage.test.tsx src/features/threads/hooks/useThreads.integration.test.tsx, and both test files passed (30 tests total passed).npm run typecheckandtsc --noEmitcompleted successfully.Codex Task