feat(ai-agent): answer questions and decline unsupported edits in text - #33
Merged
Merged
Conversation
The analyze step could only ask, plan, or generate, and the agent can only add
to a design. Questions ("what is my name?") and edit requests ("simplify the
graph") were forced into planning, drafted a plan with nothing to add, and
showed as a red error.
- TURN_DECISIONS gains `reply` (questions, greetings, off-topic) and
`unsupported` (remove, merge, rename, move, restyle, or simplify existing
components). enforceDecision allows both only for typed messages.
- New `reply` result action, stored as a TEXT message with no phase or brief
change, so a proposed plan stays generatable. Unsupported edits get a fixed
message written in code.
- A plan with nothing new to add returns a `reply` instead of aborting the run.
- These turns stop after the analyze call.
- Architecture context and progress tracker updated.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
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 |
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.
Problem
In production, "graph is looking too complex, simplify it" and "what is my name?" both ended as a red error: "The plan didn't include any new components to add…". The analyze step could only decide
ask,plan, orgenerate, and the agent can only add to a design, so every question or edit request was forced into planning, came back with nothing to add, and failed.Changes
TURN_DECISIONS:reply— questions about the diagram or plan, greetings, anything off-topic. The model's answer is shown as normal text.unsupported— remove / merge / rename / move / restyle / simplify existing components (even mixed with additions). ReturnsUNSUPPORTED_EDIT_MESSAGE, written in code so the agent never promises edits it can't make.enforceDecisionallows both only for typed messages;answersandskipturns still go to planning.replyresult action, settled as aTEXTmessage with no phase or brief change, so a previously proposed plan stays generatable.replyinstead of aborting the run, so it no longer renders as an error. The passthrough for that message is kept for runs on older task versions.context/architecture-context.mddocuments the add-only behaviour; progress tracker updated.No UI change was needed: the sidebar already renders assistant
TEXTmessages.Test plan
pnpm typecheck, eslint onlib/aiandsrc/triggerreply/unsupportedkept for messages, turned intoplanfor answers and skip; result schema acceptsreplyand rejects an empty onegemini-3.5-flash-litewith a 10-component CI/CD canvas:unsupportedreplyreplyplanunsupportedmain): the same messages in a production session, then generate a previously proposed plan after areplyturn🤖 Generated with Claude Code