Skip to content

Follow-up: remove local thread-name override persistence#456

Closed
Dimillian wants to merge 1 commit intomainfrom
codex/github-mention-thread-names-can-get-out-of-sync-localstora
Closed

Follow-up: remove local thread-name override persistence#456
Dimillian wants to merge 1 commit intomainfrom
codex/github-mention-thread-names-can-get-out-of-sync-localstora

Conversation

@Dimillian
Copy link
Owner

Motivation

  • Local per-thread name overrides stored in localStorage could permanently mask thread/name/updated events and list refreshes, causing the UI to diverge from Codex thread state.
  • Make the Codex thread name the single source of truth and keep renames as optimistic UI updates backed by thread/name/set to Codex.

Description

  • Stop persisting thread renames to codexmonitor.threadCustomNames by removing calls to saveCustomName and local customNamesRef updates from useThreads.renameThread (src/features/threads/hooks/useThreads.ts).
  • Simplify useThreadStorage so it no longer hydrates or listens to a custom-names localStorage key and instead exposes getCustomName that always returns undefined (src/features/threads/hooks/useThreadStorage.ts).
  • Update tests to reflect the new behavior by removing expectations around custom-name persistence and by adjusting an integration test to assert that names are reflected from Codex/list responses (src/features/threads/hooks/useThreadStorage.test.tsx, src/features/threads/hooks/useThreads.integration.test.tsx).
  • Clean up related imports and refs where the local custom-name API was removed.

Testing

  • Ran targeted unit/integration tests: 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).
  • Ran type checking with npm run typecheck and tsc --noEmit completed successfully.

Codex Task

@Dimillian
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 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, []);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Dimillian Dimillian closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments