feat(ai-agent): multi-turn design agent - clarify, plan, then generate - #23
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 |
Suharshit
added this pull request to stack #24
September 15, 2026 18:40
Suharshit
force-pushed
the
feat/ai-design-turn-engine
branch
from
September 15, 2026 18:41
75436fd to
2b7b481
Compare
Each turn is still one design-agent run, but the agent now keeps a requirements brief, asks up to 3 rounds of clarifying questions when an unknown would change the architecture, proposes a plan (components, flows, decisions with rationale and alternatives, assumptions), and only draws the diagram once the plan is approved. - lib/ai/agent-schema.ts: brief, question, plan, turn-analysis and run-result schemas; list limits trimmed in code rather than enforced as maxItems, which models don't reliably honour - lib/ai/prompts.ts, lib/ai/design-agent-engine.ts: analyze/plan/ generate on generateText + Output.object; code-enforced decision rules; per-step thinking level (Gemini 3) or budget (Gemini 2.x); one retry on schema mismatch; per-call timeouts - design-agent task: single attempt, maxDuration 300s - Turns route accepts message, answers, generate and skip; stored replies are validated run output (QUESTIONS / PLAN / RESULT) and run failures are shown as friendly messages Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Suharshit
force-pushed
the
feat/ai-design-turn-engine
branch
from
September 15, 2026 18:43
2b7b481 to
decceb2
Compare
This was referenced Sep 15, 2026
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 design agent turned a single prompt straight into a diagram, so vague prompts produced guesswork and there was no chance to agree on the architecture first. This is step 3 of the AI sessions plan: a short conversation (clarify → plan → generate) on top of the stored sessions from #21 and #22.
What
design-agentrun. The agent:enforceDecision): no questions after a skip or past 3 rounds, no generating without a plan, no "ask" with zero questions.message,answers(only while questions are open),generate(409 without a plan) andskip.QUESTIONS,PLANorRESULTfrom run output validated with zod.RESULTcarries the plan's decisions, which the spec feature can reuse later.Hardening found while testing
thinkingLevelon Gemini 3,thinkingBudgeton Gemini 2.x. Calls took 4–30s after that.maxItems.maxDuration: 300Verification
pnpm typecheckandpnpm lintpass.End-to-end run (verified)
The full flow through the local Trigger worker passed on
gemini-3.5-flash-lite(the free-tier quotas for 3.5-flash and 2.5-flash were used up, andgemini-3-flash-previewwas overloaded):PLANNED; the brief was stored and the plan payload is valid.COMPLETE.The test project, Liveblocks room, sessions and TaskRuns were removed afterwards.
🤖 Generated with Claude Code