Skip to content

refactor: remove custom title generation and optimize session updates#187

Merged
chriswritescode-dev merged 3 commits intomainfrom
refactor-session-title
Apr 16, 2026
Merged

refactor: remove custom title generation and optimize session updates#187
chriswritescode-dev merged 3 commits intomainfrom
refactor-session-title

Conversation

@chriswritescode-dev
Copy link
Copy Markdown
Owner

Summary

Changes

  • Removed backend/src/routes/title.ts: Deleted custom title generation route (228 lines)
  • Removed backend/src/services/session-title.ts: Deleted title generation service
  • Removed backend/test/routes/title.test.ts: Deleted title route tests (150 lines)
  • Modified backend/src/index.ts: Removed /api/generate-title route registration
  • Modified frontend/src/hooks/useOpenCode.ts: Removed useTitleGenerating hook and title generation logic
  • Modified frontend/src/hooks/useSSE.ts: Replaced query invalidations with setQueryData for optimistic updates
  • Modified frontend/src/components/ui/header.tsx: Removed generating prop and loading state
  • Modified frontend/src/pages/SessionDetail.tsx: Removed title generating state usage

Session titles now come directly from upstream OpenCode via SSE events and session refetches.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation

Checklist

  • Code follows project style (no comments, named imports)
  • TypeScript types are properly defined
  • Tests added/updated (80% coverage target)
  • pnpm lint passes locally
  • pnpm typecheck passes locally

…titles

- Delete backend/src/routes/title.ts and backend/src/services/session-title.ts
- Remove /api/generate-title route from backend/src/index.ts
- Delete backend/test/routes/title.test.ts
- Remove useTitleGenerating hook and title generation logic from frontend/src/hooks/useOpenCode.ts
- Remove generating prop from Header.EditableTitle and frontend/src/pages/SessionDetail.tsx
- Clean up unused imports in frontend/src/hooks/useOpenCode.ts and frontend/src/components/ui/header.tsx
- Session titles now come directly from upstream OpenCode via session refetches after prompt
- Remove redundant query invalidations in useSendPrompt
- Use setQueryData for optimistic updates in SSE session.updated handler
- Update session cache directly when session exists in list
- Prepend new sessions to list when not found
- Fall back to invalidation only when cache is empty
@chriswritescode-dev chriswritescode-dev merged commit 8e90ba2 into main Apr 16, 2026
3 checks passed
@chriswritescode-dev chriswritescode-dev deleted the refactor-session-title branch April 16, 2026 13:59
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