Repository navigation
feat(ai-sessions): run the AI Architect chat on stored sessions - #22
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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 |
A reload no longer loses the chat or an in-flight run. Generation is still one-shot; this changes persistence and resume only. - POST /api/projects/[projectId]/ai-sessions/[sessionId]/turns stores the prompt and a PENDING reply carrying the run id (replaces POST /api/ai/design, which is removed) - Replies are settled from runs.retrieve whenever a session is read, so a turn is saved even if the tab closed mid-run; concurrent reads settle once - useAiSession replaces useDesignAgent: reopens the last chat, resumes pending runs via Realtime with a 4s polling fallback, stores new chats lazily on the first message - Sidebar session bar with saved-chat history (delete, expiry) and New chat - Limits moved to lib/ai/session-limits.ts for client use; formatRelativeTime extracted to lib/relative-time.ts Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Suharshit
force-pushed
the
feat/ai-sessions-wiring
branch
from
September 15, 2026 18:41
6d2255e to
ccbaf77
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The AI sidebar lost its chat and any in-flight run on reload. This is step 2 of the AI sessions plan: the chat now reads and writes the sessions stored in #21. Generation is still one prompt → one design run; the clarify → plan → generate flow is step 3.
What
POST /api/projects/[projectId]/ai-sessions/[sessionId]/turnswith{ type: "message", text }.design-agentand stores the prompt plus a PENDING reply carrying the run id. It also records theTaskRunrow, moves the expiry forward and titles the chat from its first message.GET .../ai-sessions/[sessionId]saves any finished runs before returning.runs.retrieve. A success is saved as aRESULTwith node and edge counts; a failure, cancellation or missing run becomes anERROR.POST /api/ai/design. The token route is unchanged.useAiSessionreplacesuseDesignAgent.lib/ai/session-limits.tsso the client can import them without Prisma.formatRelativeTimemoved tolib/relative-time.ts.Verification
pnpm typecheckandpnpm lintpass.TaskRunrowtrigger devworker, on a throwaway project and Liveblocks room that were removed afterwards:TaskRunrow🤖 Generated with Claude Code