Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds frontend in-place chat rename UI and header tweaks, a PATCH /sessions/{session_id}/title backend route with ownership/validation and retry logic, DB/model helpers to atomically set titles-if-empty (with cache sync), title-polling to detect generated titles, tests, OpenAPI updates, and small UI/style/webhook tweaks. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FE as "Frontend\nChatSidebar / MobileDrawer"
participant API as "Backend\nPATCH /sessions/{id}/title"
participant Service as "Copilot\nModel/Service"
participant DB as "DB / Cache"
User->>FE: Click Rename β edit title
FE->>API: PATCH /sessions/{id}/title (title)
API->>Service: validate ownership -> request title update
Service->>DB: atomic update IF title IS NULL
DB-->>Service: success / no-op / not-found
Service-->>API: result (success/failure)
API-->>FE: 200 OK or 404/422/500
FE->>FE: invalidate sessions list
loop poll until observed or attempts exhausted
FE->>API: GET /sessions (poll)
API-->>FE: sessions list
end
Estimated code review effortπ― 4 (Complex) | β±οΈ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
π₯ Pre-merge checks | β 1 | β 2β Failed checks (1 warning, 1 inconclusive)
β Passed checks (1 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment was marked as spam.
This comment was marked as spam.
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 6
π§Ή Nitpick comments (1)
autogpt_platform/frontend/src/app/api/openapi.json (1)
13065-13071: Add basic validation constraints toUpdateSessionTitleRequest.title.Line 13066 currently accepts any string, including empty values. Add at least
minLength: 1(and backend-aligned max length) so generated clients and docs enforce valid titles.Suggested schema update
- "properties": { "title": { "type": "string", "title": "Title" } }, + "properties": { + "title": { + "type": "string", + "minLength": 1, + "title": "Title" + } + },π€ Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@autogpt_platform/frontend/src/app/api/openapi.json` around lines 13065 - 13071, The UpdateSessionTitleRequest schema currently allows empty strings for the title; update the "title" property inside UpdateSessionTitleRequest to include validation constraints by adding "minLength": 1 and "maxLength": <backend_max_length> (replace <backend_max_length> with the actual server-side limit) so generated clients and docs enforce non-empty, backend-aligned title lengths.
π€ Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@autogpt_platform/backend/backend/api/features/chat/routes.py`:
- Around line 134-137: UpdateSessionTitleRequest currently accepts
whitespace-only titles; add server-side normalization and validation by
implementing a Pydantic validator (e.g., `@validator`("title", pre=True,
always=True)) that strips surrounding whitespace and raises a ValueError if the
resulting string is empty, ensuring the model stores the stripped title; apply
the same validator/logic to the other request model in this file that handles
session title updates (the similar request class defined later) so direct API
calls cannot create blank titles.
- Around line 279-285: The code treats a failed update_session_title result as a
404 even after _validate_and_get_session passed; change this to treat update
failures as server errors: in the block after calling
update_session_title(session_id, request.title) (referencing
_validate_and_get_session and update_session_title), log the failure and raise
an HTTPException with a 500 (or appropriate 5xx) status and a clear detail like
"Failed to update session title" (optionally include internal error/info if
available) instead of returning 404 so persistence/cache failures arenβt masked
as "not found."
- Around line 251-287: Add a new test module that covers the PATCH
/sessions/{session_id}/title route: write tests for update_session_title_route
using the UpdateSessionTitleRequest model to send payloads, mocking or patching
_validate_and_get_session and update_session_title to simulate success and
not-found, and exercising an unauthorized request by omitting authentication (or
asserting Security(auth.requires_user) behavior) plus a validation-error case
with invalid request data; ensure tests follow existing naming conventions
(e.g., test_update_session_title.py or _test.py), use the same test
fixtures/helpers used by other feature tests, assert correct HTTP status codes
and response bodies for success (200 {"status":"ok"}), 404 when
update_session_title returns False, 401/403 for unauthorized, and 422 for
request validation errors.
In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx:
- Around line 283-291: The input handlers currently cause duplicate or
unintended submits because onBlur always calls handleRenameSubmit while
onKeyDown also invokes it (Enter) and Escape sets editing state but still
triggers blur; update the component to track user action with a ref/flag (e.g.,
renameHandledRef) so onKeyDown sets renameHandledRef.current = true when
handling Enter or Escape (call handleRenameSubmit(session.id) for Enter,
setEditingSessionId(null) for Escape), and modify onBlur to only call
handleRenameSubmit(session.id) if renameHandledRef.current is false; reset
renameHandledRef.current = false after handling to allow future edits. Use the
existing symbols handleRenameSubmit, setEditingSessionId, onKeyDown, and onBlur
to locate and apply the change.
- Line 30: Remove the unused useCallback import and convert the
handleRenameSubmit handler from an arrow function to a plain function
declaration; specifically, remove useCallback from the import list at the top of
ChatSidebar.tsx and replace the current arrow/const handleRenameSubmit = (...)
=> { ... } with function handleRenameSubmit(event) { ... } (or matching
parameters) so the handler is a normal function declaration and no longer
memoized. Ensure all internal references to handleRenameSubmit remain unchanged
and update any types/closures as needed.
In `@autogpt_platform/frontend/src/components/ai-elements/message.tsx`:
- Around line 329-336: The Dialog is using both controlled mode and the
standalone onClose prop which causes duplicate close calls; remove the redundant
onClose prop and rely solely on the controlled.set callback. In message.tsx,
delete the onClose={onClose} passed to the Dialog (or conditionalize it) so only
the controlled object with its set: async (open) => { if (!open) onClose(); }
triggers closing; ensure any references to onClose remain available to the
controlled.set closure but are not passed as a separate prop to Dialog.
---
Nitpick comments:
In `@autogpt_platform/frontend/src/app/api/openapi.json`:
- Around line 13065-13071: The UpdateSessionTitleRequest schema currently allows
empty strings for the title; update the "title" property inside
UpdateSessionTitleRequest to include validation constraints by adding
"minLength": 1 and "maxLength": <backend_max_length> (replace
<backend_max_length> with the actual server-side limit) so generated clients and
docs enforce non-empty, backend-aligned title lengths.
βΉοΈ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
π Files selected for processing (6)
autogpt_platform/backend/backend/api/features/chat/routes.pyautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/api/openapi.jsonautogpt_platform/frontend/src/app/globals.cssautogpt_platform/frontend/src/components/ai-elements/message.tsx
π€ Files with no reviewable changes (1)
- autogpt_platform/frontend/src/app/globals.css
π Review details
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: types
- GitHub Check: Seer Code Review
- GitHub Check: test (3.12)
- GitHub Check: test (3.11)
- GitHub Check: test (3.13)
- GitHub Check: Check PR Status
- GitHub Check: end-to-end tests
π§° Additional context used
π Path-based instructions (19)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Runpnpm formatto auto-fix formatting issues before completing work
Runpnpm lintto check for lint errors and fix any that appear before completing work
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/**/*.{tsx,ts}
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/**/*.{ts,tsx}
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend developmentRun
pnpm typesto check for type errors and fix any that appear before completing work
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}
π CodeRabbit inference engine (AGENTS.md)
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code usingpnpm format
Never use components fromsrc/components/__legacy__/*
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}
π CodeRabbit inference engine (AGENTS.md)
autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components asComponentName/ComponentName.tsx+useComponentName.ts+helpers.tsand use design system components fromsrc/components/(atoms, molecules, organisms)
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}and regenerate withpnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local/componentsfolder
Avoid large hooks, abstract logic intohelpers.tsfiles when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not useuseCallbackoruseMemounless asked to optimize a given function
autogpt_platform/frontend/src/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components and handlers
Use type-safe generated API hooks via Orval + React Query for data fetching
Use React Query for server state management and co-locate UI state in components/hooks
Separate render logic (.tsx) from business logic (use*.tshooks)
Use only shadcn/ui (Radix UI primitives) with Tailwind CSS for UI components
Use Phosphor Icons only for all icon implementations
Use ErrorCard component for render errors, toast for mutations, and Sentry for exceptions
Use design system components fromsrc/components/(atoms, molecules, organisms)
Never usesrc/components/__legacy__/*components
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}
Use Tailwind CSS only for styling with design tokens
Do not useuseCallbackoruseMemounless asked to optimize a specific function
Never type withanyunless a variable/attribute can actually be of any type
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}
π CodeRabbit inference engine (AGENTS.md)
Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/src/**/*.tsx
π CodeRabbit inference engine (AGENTS.md)
Component props should be
interface Props { ... }(not exported) unless the interface needs to be used outside the componentUse
type Props = { ... }(not exported) for component props unless used outside the component
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/**/*.{ts,tsx}
π CodeRabbit inference engine (AGENTS.md)
Never type with
any, if no types available useunknown
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/src/app/(platform)/**/*.tsx
π CodeRabbit inference engine (AGENTS.md)
If adding protected frontend routes, update
frontend/lib/supabase/middleware.ts
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}
π CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Fully capitalize acronyms in symbols, e.g.
graphID,useBackendAPI
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/src/**/components/**/*.{ts,tsx}
π CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Put sub-components in a local
components/folder within the feature directory
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/frontend/src/**/[A-Z]*/**/*.{ts,tsx}
π CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/components/**/*.{tsx,ts}
π CodeRabbit inference engine (.github/copilot-instructions.md)
Structure React components as: ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts (exception: small 3-4 line components can be inline; render-only components can be direct files)
Files:
autogpt_platform/frontend/src/components/ai-elements/message.tsx
autogpt_platform/backend/**/*.py
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development
Files:
autogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/backend/api/features/**/*.py
π CodeRabbit inference engine (.github/copilot-instructions.md)
Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
When modifying API routes, update corresponding Pydantic models in the same directory and write tests alongside the route file
Files:
autogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/**/*.{py,txt}
π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use
poetry runprefix for all Python commands, including testing, linting, formatting, and migrations
Files:
autogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/backend/api/**/*.py
π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
autogpt_platform/backend/backend/api/**/*.py: Use FastAPI for building REST and WebSocket endpoints
Use JWT-based authentication with Supabase integration
Files:
autogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/backend/**/*.py
π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use Prisma ORM for database operations in PostgreSQL with pgvector for embeddings
Files:
autogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/**/*.py
π CodeRabbit inference engine (AGENTS.md)
Format Python code with
poetry run format
Files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π§ Learnings (12)
π Common learnings
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Fill out the Changes section and checklist in pull requests
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Use conventional commit titles with a scope (e.g. `feat(frontend): add feature`) in pull requests
π Learning: 2026-02-26T10:12:58.845Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12207
File: autogpt_platform/frontend/src/components/ai-elements/conversation.tsx:0-0
Timestamp: 2026-02-26T10:12:58.845Z
Learning: Guideline: Do not apply dark mode CSS classes (e.g., dark:text-*) to copilot UI components until dark mode support is implemented. Applies to all copilot-related components (paths containing /copilot/). When reviewing, search for dark:* class names within copilot components and refactor to use conditional class sets or feature-flag gates, ensuring no dark-mode styles are present in the code paths that render copilot UI unless dark mode support is officially enabled.
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-27T10:45:49.499Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/(platform)/copilot/tools/RunMCPTool/helpers.tsx:23-24
Timestamp: 2026-02-27T10:45:49.499Z
Learning: Prefer using generated OpenAPI types from '@/app/api/__generated__/' for payloads defined in openapi.json (e.g., MCPToolsDiscoveredResponse, MCPToolOutputResponse). Use inline TypeScript interfaces only for payloads that are SSE-stream-only and not exposed via OpenAPI. Apply this pattern to frontend tool components (e.g., RunMCPTool) and related areas where similar SSE/openapi-discrepancies occur; avoid re-implementing types when a generated type is available.
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-26T21:29:44.094Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.094Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use React Query for server state management and co-locate UI state in components/hooks
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use React Query for server state (via generated hooks) in frontend development
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-03-01T07:58:56.207Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/api/openapi.json:10030-10037
Timestamp: 2026-03-01T07:58:56.207Z
Learning: When a backend field represents sensitive data, use a secret type (e.g., Pydantic SecretStr with length constraints) so OpenAPI marks it as a password/writeOnly field. Apply this pattern to similar sensitive request fields across API schemas so generated TypeScript clients and docs treat them as secrets and do not mishandle sensitivity. Review all openapi.jsons where sensitive inputs are defined and replace plain strings with SecretStr-like semantics with appropriate minLength constraints.
Applied to files:
autogpt_platform/frontend/src/app/api/openapi.json
π Learning: 2026-02-26T21:29:44.094Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.094Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use design system components from `src/components/` (atoms, molecules, organisms)
Applied to files:
autogpt_platform/frontend/src/components/ai-elements/message.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Applied to files:
autogpt_platform/frontend/src/components/ai-elements/message.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/backend/backend/api/features/**/*.py : Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:50:20.508Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.508Z
Learning: Applies to autogpt_platform/backend/backend/api/features/**/*.py : When modifying API routes, update corresponding Pydantic models in the same directory and write tests alongside the route file
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
𧬠Code graph analysis (3)
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx (2)
autogpt_platform/frontend/src/components/atoms/Text/Text.tsx (1)
Text(16-36)autogpt_platform/frontend/src/components/ui/sidebar.tsx (1)
SidebarTrigger(776-776)
autogpt_platform/frontend/src/components/ai-elements/message.tsx (1)
autogpt_platform/frontend/src/components/atoms/Text/Text.tsx (1)
Text(16-36)
autogpt_platform/backend/backend/api/features/chat/routes.py (3)
autogpt_platform/backend/backend/copilot/model.py (1)
update_session_title(678-715)autogpt_platform/backend/backend/blocks/apollo/models.py (1)
BaseModel(10-20)autogpt_platform/backend/backend/util/request.py (2)
patch(584-585)request(365-402)
π Additional comments (5)
autogpt_platform/frontend/src/components/ai-elements/message.tsx (3)
11-13: Good move to shared design-system primitives.This keeps modal UI elements consistent with the appβs component system.
As per coding guidelines: "Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development."
23-23: No actionable issue in this import update.
371-371: Clean modal integration point.Using a dedicated modal component here keeps the
MessageResponserender path tidy.autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsx (1)
74-84: Good UX improvement with clean implementation.Placing βNew Chatβ in the header makes the primary action easier to find on mobile, and this implementation is consistent with the component/style/icon conventions in this codebase.
As per coding guidelines: βUse design system components from
src/components/,β βUse Tailwind CSS utilities only for styling,β and βUse Phosphor Icons only.βautogpt_platform/frontend/src/app/api/openapi.json (1)
1304-1356: Looks good: new session-title PATCH route is consistent with adjacent chat endpoints.Security, path param, request body reference, and error response set are coherent.
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 3
π§Ή Nitpick comments (1)
autogpt_platform/backend/backend/api/features/chat/routes_test.py (1)
120-147: Strengthen 422 tests with βno DB callβ assertions.For Line 120-147, also assert
update_session_titleis not called when validation fails. That prevents regressions where invalid titles accidentally reach persistence.β Test hardening snippet
def test_update_title_blank_rejected( @@ - _mock_validate_and_get_session(mocker) + _mock_validate_and_get_session(mocker) + mock_update = _mock_update_session_title(mocker, success=True) @@ assert response.status_code == 422 + mock_update.assert_not_called() @@ def test_update_title_empty_rejected( @@ - _mock_validate_and_get_session(mocker) + _mock_validate_and_get_session(mocker) + mock_update = _mock_update_session_title(mocker, success=True) @@ assert response.status_code == 422 + mock_update.assert_not_called()π€ Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@autogpt_platform/backend/backend/api/features/chat/routes_test.py` around lines 120 - 147, Update both test_update_title_blank_rejected and test_update_title_empty_rejected to assert the DB updater is not invoked: after calling client.patch with the invalid title (whitespace or empty) and asserting status_code == 422, also assert that the mocked update_session_title function was not called (use the mock returned/created by _mock_validate_and_get_session or patch update_session_title directly). This ensures update_session_title remains uninvoked when validation fails.
π€ Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@autogpt_platform/backend/backend/copilot/service.py`:
- Around line 456-459: The logger.info call that prints the full user-provided
title (logger.info(...) referencing captured_session_id and existing.title)
should be changed to avoid exposing raw user content; replace the detailed title
with safe metadata such as a redacted marker or the title length (e.g., "title
redacted" or f"title length={len(existing.title)}") and keep captured_session_id
for context, ensuring no raw existing.title is included in logs.
- Around line 452-461: The current flow reads the session via
get_chat_session(captured_session_id, captured_user_id) then unconditionally
calls update_session_title(captured_session_id, title), which can overwrite a
concurrent user rename; change this to an atomic compare-and-set at the
persistence layer (e.g., add and call a new method like
update_session_title_if_empty or update_session_title_conditional that performs
an atomic DB update only if title IS NULL/empty or matches an expected value,
returning a boolean indicating success), then branch on that result to log
whether the auto-title was applied or skipped; do not perform the unconditional
update in service.py anymoreβuse the new conditional persistence API and handle
its success/failure.
In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx:
- Around line 117-125: When starting a rename in handleRenameClick you must
clear the escape-cancel flag so future blur events arenβt ignored; set
renameCancelledRef.current = false alongside setEditingSessionId(id) and
setEditingTitle(title || "") to reset the cancel state. Apply the same reset in
any other handlers that open the edit UI (the handler around lines 291-297 that
also calls setEditingSessionId/setEditingTitle) so renameCancelledRef is always
cleared when beginning a new edit.
---
Nitpick comments:
In `@autogpt_platform/backend/backend/api/features/chat/routes_test.py`:
- Around line 120-147: Update both test_update_title_blank_rejected and
test_update_title_empty_rejected to assert the DB updater is not invoked: after
calling client.patch with the invalid title (whitespace or empty) and asserting
status_code == 422, also assert that the mocked update_session_title function
was not called (use the mock returned/created by _mock_validate_and_get_session
or patch update_session_title directly). This ensures update_session_title
remains uninvoked when validation fails.
βΉοΈ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
π Files selected for processing (8)
autogpt_platform/backend/backend/api/features/chat/routes.pyautogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/copilot/model.pyautogpt_platform/backend/backend/copilot/service.pyautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxautogpt_platform/frontend/src/app/(platform)/copilot/components/DeleteChatDialog/DeleteChatDialog.tsxautogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/components/ai-elements/message.tsx
π€ Files with no reviewable changes (1)
- autogpt_platform/frontend/src/app/(platform)/copilot/components/DeleteChatDialog/DeleteChatDialog.tsx
π§ Files skipped from review as they are similar to previous changes (1)
- autogpt_platform/frontend/src/components/ai-elements/message.tsx
π Review details
π§° Additional context used
π Path-based instructions (22)
autogpt_platform/backend/**/*.py
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development
Files:
autogpt_platform/backend/backend/copilot/service.pyautogpt_platform/backend/backend/copilot/model.pyautogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/**/*.{py,txt}
π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use
poetry runprefix for all Python commands, including testing, linting, formatting, and migrations
Files:
autogpt_platform/backend/backend/copilot/service.pyautogpt_platform/backend/backend/copilot/model.pyautogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/backend/**/*.py
π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use Prisma ORM for database operations in PostgreSQL with pgvector for embeddings
Files:
autogpt_platform/backend/backend/copilot/service.pyautogpt_platform/backend/backend/copilot/model.pyautogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/**/*.py
π CodeRabbit inference engine (AGENTS.md)
Format Python code with
poetry run format
Files:
autogpt_platform/backend/backend/copilot/service.pyautogpt_platform/backend/backend/copilot/model.pyautogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Runpnpm formatto auto-fix formatting issues before completing work
Runpnpm lintto check for lint errors and fix any that appear before completing work
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/**/*.{tsx,ts}
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/**/*.{ts,tsx}
π CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend developmentRun
pnpm typesto check for type errors and fix any that appear before completing work
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}
π CodeRabbit inference engine (AGENTS.md)
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code usingpnpm format
Never use components fromsrc/components/__legacy__/*
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}
π CodeRabbit inference engine (AGENTS.md)
autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components asComponentName/ComponentName.tsx+useComponentName.ts+helpers.tsand use design system components fromsrc/components/(atoms, molecules, organisms)
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}and regenerate withpnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local/componentsfolder
Avoid large hooks, abstract logic intohelpers.tsfiles when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not useuseCallbackoruseMemounless asked to optimize a given function
autogpt_platform/frontend/src/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components and handlers
Use type-safe generated API hooks via Orval + React Query for data fetching
Use React Query for server state management and co-locate UI state in components/hooks
Separate render logic (.tsx) from business logic (use*.tshooks)
Use only shadcn/ui (Radix UI primitives) with Tailwind CSS for UI components
Use Phosphor Icons only for all icon implementations
Use ErrorCard component for render errors, toast for mutations, and Sentry for exceptions
Use design system components fromsrc/components/(atoms, molecules, organisms)
Never usesrc/components/__legacy__/*components
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}
Use Tailwind CSS only for styling with design tokens
Do not useuseCallbackoruseMemounless asked to optimize a specific function
Never type withanyunless a variable/attribute can actually be of any type
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}
π CodeRabbit inference engine (AGENTS.md)
Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/**/*.ts
π CodeRabbit inference engine (AGENTS.md)
Do not type hook returns, let Typescript infer as much as possible
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts
autogpt_platform/**/*.{ts,tsx}
π CodeRabbit inference engine (AGENTS.md)
Never type with
any, if no types available useunknown
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}
π CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Fully capitalize acronyms in symbols, e.g.
graphID,useBackendAPI
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.tsautogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/**/use*.ts
π CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
autogpt_platform/frontend/src/**/use*.ts: Extract component logic into custom hooks grouped by concern, with each hook in its own.tsfile
Do not type hook returns; let TypeScript infer types as much as possible
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts
autogpt_platform/backend/backend/api/features/**/*.py
π CodeRabbit inference engine (.github/copilot-instructions.md)
Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
When modifying API routes, update corresponding Pydantic models in the same directory and write tests alongside the route file
Files:
autogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/**/*_test.py
π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
autogpt_platform/backend/**/*_test.py: Always review snapshot changes withgit diffbefore committing when updating snapshots withpoetry run pytest --snapshot-update
Use pytest with snapshot testing for API responses in test files
Colocate test files with source files using the*_test.pynaming convention
Files:
autogpt_platform/backend/backend/api/features/chat/routes_test.py
autogpt_platform/backend/backend/api/**/*.py
π CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
autogpt_platform/backend/backend/api/**/*.py: Use FastAPI for building REST and WebSocket endpoints
Use JWT-based authentication with Supabase integration
Files:
autogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
autogpt_platform/backend/**/*test*.py
π CodeRabbit inference engine (AGENTS.md)
Run
poetry run testfor backend testing (runs pytest with docker based postgres + prisma)
Files:
autogpt_platform/backend/backend/api/features/chat/routes_test.py
autogpt_platform/frontend/src/**/*.tsx
π CodeRabbit inference engine (AGENTS.md)
Component props should be
interface Props { ... }(not exported) unless the interface needs to be used outside the componentUse
type Props = { ... }(not exported) for component props unless used outside the component
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/app/(platform)/**/*.tsx
π CodeRabbit inference engine (AGENTS.md)
If adding protected frontend routes, update
frontend/lib/supabase/middleware.ts
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/**/components/**/*.{ts,tsx}
π CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Put sub-components in a local
components/folder within the feature directory
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
autogpt_platform/frontend/src/**/[A-Z]*/**/*.{ts,tsx}
π CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts
Files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π§ Learnings (24)
π Common learnings
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Use conventional commit titles with a scope (e.g. `feat(frontend): add feature`) in pull requests
π Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.
Applied to files:
autogpt_platform/backend/backend/copilot/service.pyautogpt_platform/backend/backend/copilot/model.pyautogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:50:20.508Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.508Z
Learning: Applies to autogpt_platform/backend/backend/api/features/**/*.py : When modifying API routes, update corresponding Pydantic models in the same directory and write tests alongside the route file
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/backend/backend/api/features/**/*.py : Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes_test.pyautogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use function declarations for components and handlers (not arrow functions) in React components
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use function declarations (not arrow functions) for components and handlers
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Do not use `useCallback` or `useMemo` unless asked to optimize a specific function
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use arrow functions only for callbacks, not for component declarations
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Do not use `useCallback` or `useMemo` unless asked to optimize a given function
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Avoid large hooks, abstract logic into `helpers.ts` files when sensible
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-26T10:12:58.845Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12207
File: autogpt_platform/frontend/src/components/ai-elements/conversation.tsx:0-0
Timestamp: 2026-02-26T10:12:58.845Z
Learning: Guideline: Do not apply dark mode CSS classes (e.g., dark:text-*) to copilot UI components until dark mode support is implemented. Applies to all copilot-related components (paths containing /copilot/). When reviewing, search for dark:* class names within copilot components and refactor to use conditional class sets or feature-flag gates, ensuring no dark-mode styles are present in the code paths that render copilot UI unless dark mode support is officially enabled.
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-27T10:45:49.499Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/(platform)/copilot/tools/RunMCPTool/helpers.tsx:23-24
Timestamp: 2026-02-27T10:45:49.499Z
Learning: Prefer using generated OpenAPI types from '@/app/api/__generated__/' for payloads defined in openapi.json (e.g., MCPToolsDiscoveredResponse, MCPToolOutputResponse). Use inline TypeScript interfaces only for payloads that are SSE-stream-only and not exposed via OpenAPI. Apply this pattern to frontend tool components (e.g., RunMCPTool) and related areas where similar SSE/openapi-discrepancies occur; avoid re-implementing types when a generated type is available.
Applied to files:
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/backend/backend/blocks/**/*.py : Write tests alongside block implementation when adding new blocks in backend
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:50:20.508Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.508Z
Learning: Applies to autogpt_platform/backend/**/*_test.py : Always review snapshot changes with `git diff` before committing when updating snapshots with `poetry run pytest --snapshot-update`
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/backend/**/test/**/*.py : Use snapshot testing with '--snapshot-update' flag in backend tests when output changes; always review with 'git diff'
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:50:20.508Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.508Z
Learning: Applies to autogpt_platform/backend/**/*_test.py : Colocate test files with source files using the `*_test.py` naming convention
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:50:20.508Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.508Z
Learning: Applies to autogpt_platform/backend/**/*_test.py : Use pytest with snapshot testing for API responses in test files
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for authentication flows (login, signup, logout) that MUST work in a real browser
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Run 'poetry run test' before committing backend changes to ensure all tests pass
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
π Learning: 2026-02-04T16:50:20.508Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.508Z
Learning: Applies to autogpt_platform/backend/backend/api/**/*.py : Use FastAPI for building REST and WebSocket endpoints
Applied to files:
autogpt_platform/backend/backend/api/features/chat/routes.py
𧬠Code graph analysis (3)
autogpt_platform/backend/backend/copilot/service.py (2)
autogpt_platform/backend/backend/copilot/model.py (1)
get_chat_session(342-394)autogpt_platform/backend/backend/copilot/db.py (1)
get_chat_session(26-32)
autogpt_platform/backend/backend/api/features/chat/routes_test.py (3)
autogpt_platform/backend/backend/copilot/model.py (1)
ChatSession(126-302)autogpt_platform/backend/backend/util/exceptions.py (1)
NotFoundError(43-44)autogpt_platform/backend/backend/api/conftest.py (1)
mock_jwt_user(20-27)
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx (4)
autogpt_platform/frontend/src/components/molecules/Toast/use-toast.tsx (1)
toast(116-116)autogpt_platform/frontend/src/components/ui/sidebar.tsx (3)
SidebarHeader(761-761)SidebarTrigger(776-776)SidebarContent(755-755)autogpt_platform/frontend/src/components/atoms/Text/Text.tsx (1)
Text(16-36)autogpt_platform/frontend/src/lib/utils/time.ts (1)
formatDate(21-29)
π Additional comments (4)
autogpt_platform/backend/backend/copilot/model.py (1)
472-483: Good cache-title preservation guard.This best-effort merge before
cache_chat_sessionreduces accidental title loss during concurrent stream updates and keeps cache state closer to user intent.autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts (1)
206-230: Polling lifecycle looks solid.Nice job bounding attempts and explicitly clearing intervals on both restart and teardown; this avoids orphan timers and keeps title reconciliation predictable.
Also applies to: 355-361
autogpt_platform/backend/backend/api/features/chat/routes.py (2)
134-145: Validation at request boundary is well implemented.The validator trims and rejects blank/whitespace-only titles before persistence, which closes the direct API bypass path cleanly.
294-306: Good 404 vs 500 failure split.The post-update re-check avoids misreporting internal update failures as not-found after successful ownership validation.
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx
Show resolved
Hide resolved
|
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
|
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
β¦ux-improvements-rename-new-chat-button Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Conflicts have been resolved! π A maintainer will review the pull request shortly. |
|
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
autogpt-reviewer
left a comment
There was a problem hiding this comment.
PR #12258 β feat(copilot): UX improvements
Author: kcze | Files: 16 changed (+616/-120)
π― Verdict: APPROVE_WITH_CONDITIONS
What This PR Does
Adds four CoPilot UX improvements: (1) inline rename conversations via a new PATCH /sessions/{session_id}/title backend endpoint with ownership validation and atomic conditional updates, (2) sticky "New Chat" button moved from footer to always-visible sidebar header, (3) auto-generated title polling that detects when the backend has asynchronously generated a title after the first message, and (4) external link safety dialog redesigned using proper design system Dialog/Button components instead of CSS hacks.
Specialist Findings
π‘οΈ Security β
β Auth/authz correctly enforced: new PATCH endpoint uses Security(auth.requires_user) + Security(auth.get_user_id), DB WHERE clause scopes by both session_id AND userId. No injection risks (Prisma ORM), no secrets exposure, XSS mitigated by React auto-escaping. One should-fix: no max_length on title field allows arbitrarily large titles.
ποΈ Architecture β
β Clean RESTful sub-resource pattern (PATCH /sessions/{id}/title). Three-layer separation (route β model β db) is well-maintained. Atomic UPDATE WHERE title IS NULL eliminates the TOCTOU race for auto-titles. Should-fix: untyped -> dict response loses OpenAPI type safety; cache-title preservation in upsert_chat_session adds fragile coupling; ChatSidebar.tsx at 384 lines should extract rename logic into useRenameSession hook.
β‘ Performance β
β Prior claim of query key mismatch is FALSE (verified: title polling consistently uses {limit: 50} key). AnimatePresence correctly scoped to title span only. Should-fix: extra Redis GET on every upsert_chat_session call adds hot-path overhead during streaming; title polling fires even for follow-up messages in already-titled conversations (unnecessary API calls).
π§ͺ Testing update_chat_session_title DB function has zero test coverage (atomic conditional update, ownership scoping untested); update_session_title model function's new only_if_empty parameter untested; auto-title race guard in both service.py files untested; cache race guard in upsert_chat_session untested; zero frontend tests for rename keyboard flow, title polling, or ExternalLinkModal.
π Quality β
β Good docstrings on new Python functions. Should-fix: hardcoded { limit: 50 } repeated 5 times across 2 files (cache correctness risk if one changes); inline style={} on collapsed-state button should use Tailwind classes; arbitrary shadow value should be extracted. ExternalLinkModal should be its own file.
π¦ Product β
β All four features follow industry-standard UX patterns (Slack/VS Code inline rename, sticky primary action, progressive title reveal). Keyboard accessibility good (Enter submits, Escape cancels, aria-label present). Tab-key submits via blur which matches VS Code convention. Missing: maxLength on rename input, optimistic update for snappier rename feel.
π¬ Discussion only_if_empty flag, clarified race condition comments). majdyz dismissed their changes_requested review. One unanswered comment: majdyz asked "why remove this?" about telegram.py changes (change may have been absorbed by merge from dev). PR has active merge conflicts (CONFLICTING label). Most CodeRabbit issues fixed across 4 rounds; remaining: no minLength in OpenAPI spec.
π QA β β Full live testing passed: signup flow works, New Chat button visible at top and sticky, inline rename with Enter/Escape works correctly, auto-title polling generates titles after first message, external link dialog uses proper design system components. 12 screenshots captured. No console errors (only expected LaunchDarkly dev warnings).
QA Screenshots
Conditions for Approval
routes.pyβ Addmax_lengthto title field (UpdateSessionTitleRequest.title): AddField(max_length=200)to prevent storage of arbitrarily large titles. Also addmaxLengthto the<input>inChatSidebar.tsx. (Security + Product)- Resolve merge conflicts β PR is currently in
CONFLICTINGstate. (Discussion) - Answer majdyz's telegram.py question β Unanswered comment from reviewer. (Discussion)
Should Fix (Follow-up OK)
db.pyβ Add unit tests forupdate_chat_session_titleβ Atomic conditional update with ownership scoping has zero test coverage. Test cases: title already exists β no-op, title null β updates, wrong user_id β no-op. (Testing)model.py:479-481β Optimize Redis read inupsert_chat_sessionβ Only perform cache read when in-memory session has no title (if not session.title:), avoiding unnecessary Redis round-trips on every message during streaming. (Performance)useCopilotPage.tsβ Skip title polling for already-titled sessions β Add guardif (currentSession?.title) return;to avoid 5 unnecessary API calls on follow-up messages. (Performance)ChatSidebar.tsxβ Extract rename logic intouseRenameSessionhook β Component at 384 lines; rename state + handlers + mutation is a self-contained ~40-line hook. (Architecture + Quality)routes.pyβ Type the response model β Replace-> dictwith a properUpdateSessionTitleResponse(BaseModel)for OpenAPI codegen. (Architecture)- Standardize query key usage β Extract
{ limit: 50 }into a shared constant to prevent cache-key mismatches if the value changes. (Quality + Performance)
Risk Assessment
Merge risk: LOW β Well-scoped UX changes with proper auth, atomic DB operations, and bounded polling. No schema migrations.
Rollback: EASY β Pure feature addition, no breaking changes to existing APIs.
@ntindle Clean UX PR with good security practices and atomic title handling. Three conditions: add max_length on title field, resolve merge conflicts, and answer the open telegram.py reviewer question. After that, good to merge.
β¦ux-improvements-rename-new-chat-button Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Conflicts have been resolved! π A maintainer will review the pull request shortly. |
CoPilot conversation UX improvements (SECRT-2055):
1. **Rename conversations** β Inline rename via the session dropdown
menu. New `PATCH /sessions/{session_id}/title` endpoint with server-side
validation (rejects blank/whitespace-only titles, normalizes
whitespace). Pressing Enter or clicking away submits; Escape cancels
without submitting.
2. **New Chat button moved to top & sticky** β The 'New Chat' button is
now at the top of the sidebar (under 'Your chats') instead of the
footer, and stays fixed β only the session list below it scrolls. A
subtle shadow separator mirrors the original footer style.
3. **Auto-generated title appears live** β After the first message in a
new chat, the sidebar polls for the backend-generated title and animates
it in smoothly once available. The backend also guards against
auto-title overwriting a user-set title.
4. **External Link popup redesign** β Replaced the CSS-hacked external
link confirmation dialog with a proper AutoGPT `Dialog` component using
the design system (`Button`, `Text`, `Dialog`). Removed the old
`globals.css` workaround.
<img width="321" height="263" alt="Screenshot 2026-03-03 at 6 31 50 pm"
src="https://github.com/user-attachments/assets/3cdd1c6f-cca6-4f16-8165-15a1dc2d53f7"
/>
<img width="374" height="74" alt="Screenshot 2026-03-02 at 6 39 07 pm"
src="https://github.com/user-attachments/assets/6f9fc953-5fa7-4469-9eab-7074e7604519"
/>
<img width="548" height="293" alt="Screenshot 2026-03-02 at 6 36 28 pm"
src="https://github.com/user-attachments/assets/0f34683b-7281-4826-ac6f-ac7926e67854"
/>
**Backend:**
- `routes.py`: Added `PATCH /sessions/{session_id}/title` endpoint with
`UpdateSessionTitleRequest` Pydantic model β validates non-blank title,
normalizes whitespace, returns 404 vs 500 correctly
- `routes_test.py`: New test file β 7 test cases covering success,
whitespace trimming, blank rejection (422), not found (404), internal
failure (500)
- `service.py`: Auto-title generation now checks if a user-set title
already exists before overwriting
- `openapi.json`: Updated with new endpoint schema
**Frontend:**
- `ChatSidebar.tsx`: Inline rename (Enter/blur submits, Escape cancels
via ref flag); "New Chat" button sticky at top with shadow separator;
session title animates when auto-generated title appears
(`AnimatePresence`)
- `useCopilotPage.ts`: Polls for auto-generated title after stream ends,
stops as soon as title appears in cache
- `MobileDrawer.tsx`: Updated to match sidebar layout changes
- `DeleteChatDialog.tsx`: Removed redundant `onClose` prop (controlled
Dialog already handles close)
- `message.tsx`: Added `ExternalLinkModal` using AutoGPT design system;
removed redundant `onClose` prop
- `globals.css`: Removed old CSS hack for external link modal
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
- [x] Create a new chat, send a message β verify auto-generated title
appears in sidebar without refresh
- [x] Rename a chat via dropdown β Enter submits, Escape reverts, blank
title rejected
- [x] Rename a chat, then send another message β verify user title is
not overwritten by auto-title
- [x] With many chats, scroll the sidebar β verify "New Chat" button
stays fixed at top
- [x] Click an external link in a message β verify the new dialog
appears with AutoGPT styling
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
CoPilot conversation UX improvements (SECRT-2055):
1. **Rename conversations** β Inline rename via the session dropdown
menu. New `PATCH /sessions/{session_id}/title` endpoint with server-side
validation (rejects blank/whitespace-only titles, normalizes
whitespace). Pressing Enter or clicking away submits; Escape cancels
without submitting.
2. **New Chat button moved to top & sticky** β The 'New Chat' button is
now at the top of the sidebar (under 'Your chats') instead of the
footer, and stays fixed β only the session list below it scrolls. A
subtle shadow separator mirrors the original footer style.
3. **Auto-generated title appears live** β After the first message in a
new chat, the sidebar polls for the backend-generated title and animates
it in smoothly once available. The backend also guards against
auto-title overwriting a user-set title.
4. **External Link popup redesign** β Replaced the CSS-hacked external
link confirmation dialog with a proper AutoGPT `Dialog` component using
the design system (`Button`, `Text`, `Dialog`). Removed the old
`globals.css` workaround.
<img width="321" height="263" alt="Screenshot 2026-03-03 at 6 31 50 pm"
src="https://github.com/user-attachments/assets/3cdd1c6f-cca6-4f16-8165-15a1dc2d53f7"
/>
<img width="374" height="74" alt="Screenshot 2026-03-02 at 6 39 07 pm"
src="https://github.com/user-attachments/assets/6f9fc953-5fa7-4469-9eab-7074e7604519"
/>
<img width="548" height="293" alt="Screenshot 2026-03-02 at 6 36 28 pm"
src="https://github.com/user-attachments/assets/0f34683b-7281-4826-ac6f-ac7926e67854"
/>
### Changes ποΈ
**Backend:**
- `routes.py`: Added `PATCH /sessions/{session_id}/title` endpoint with
`UpdateSessionTitleRequest` Pydantic model β validates non-blank title,
normalizes whitespace, returns 404 vs 500 correctly
- `routes_test.py`: New test file β 7 test cases covering success,
whitespace trimming, blank rejection (422), not found (404), internal
failure (500)
- `service.py`: Auto-title generation now checks if a user-set title
already exists before overwriting
- `openapi.json`: Updated with new endpoint schema
**Frontend:**
- `ChatSidebar.tsx`: Inline rename (Enter/blur submits, Escape cancels
via ref flag); "New Chat" button sticky at top with shadow separator;
session title animates when auto-generated title appears
(`AnimatePresence`)
- `useCopilotPage.ts`: Polls for auto-generated title after stream ends,
stops as soon as title appears in cache
- `MobileDrawer.tsx`: Updated to match sidebar layout changes
- `DeleteChatDialog.tsx`: Removed redundant `onClose` prop (controlled
Dialog already handles close)
- `message.tsx`: Added `ExternalLinkModal` using AutoGPT design system;
removed redundant `onClose` prop
- `globals.css`: Removed old CSS hack for external link modal
### Checklist π
#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
- [x] Create a new chat, send a message β verify auto-generated title
appears in sidebar without refresh
- [x] Rename a chat via dropdown β Enter submits, Escape reverts, blank
title rejected
- [x] Rename a chat, then send another message β verify user title is
not overwritten by auto-title
- [x] With many chats, scroll the sidebar β verify "New Chat" button
stays fixed at top
- [x] Click an external link in a message β verify the new dialog
appears with AutoGPT styling
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>








CoPilot conversation UX improvements (SECRT-2055):
Rename conversations β Inline rename via the session dropdown menu. New
PATCH /sessions/{session_id}/titleendpoint with server-side validation (rejects blank/whitespace-only titles, normalizes whitespace). Pressing Enter or clicking away submits; Escape cancels without submitting.New Chat button moved to top & sticky β The 'New Chat' button is now at the top of the sidebar (under 'Your chats') instead of the footer, and stays fixed β only the session list below it scrolls. A subtle shadow separator mirrors the original footer style.
Auto-generated title appears live β After the first message in a new chat, the sidebar polls for the backend-generated title and animates it in smoothly once available. The backend also guards against auto-title overwriting a user-set title.
External Link popup redesign β Replaced the CSS-hacked external link confirmation dialog with a proper AutoGPT
Dialogcomponent using the design system (Button,Text,Dialog). Removed the oldglobals.cssworkaround.Changes ποΈ
Backend:
routes.py: AddedPATCH /sessions/{session_id}/titleendpoint withUpdateSessionTitleRequestPydantic model β validates non-blank title, normalizes whitespace, returns 404 vs 500 correctlyroutes_test.py: New test file β 7 test cases covering success, whitespace trimming, blank rejection (422), not found (404), internal failure (500)service.py: Auto-title generation now checks if a user-set title already exists before overwritingopenapi.json: Updated with new endpoint schemaFrontend:
ChatSidebar.tsx: Inline rename (Enter/blur submits, Escape cancels via ref flag); "New Chat" button sticky at top with shadow separator; session title animates when auto-generated title appears (AnimatePresence)useCopilotPage.ts: Polls for auto-generated title after stream ends, stops as soon as title appears in cacheMobileDrawer.tsx: Updated to match sidebar layout changesDeleteChatDialog.tsx: Removed redundantonCloseprop (controlled Dialog already handles close)message.tsx: AddedExternalLinkModalusing AutoGPT design system; removed redundantonClosepropglobals.css: Removed old CSS hack for external link modalChecklist π
For code changes: