Skip to content

feat(ai-agent): answer questions and decline unsupported edits in text - #33

Merged
Suharshit merged 1 commit into
mainfrom
feat/ai-agent-reply-decision
Sep 16, 2026
Merged

Suharshit merged 1 commit into
mainfrom
feat/ai-agent-reply-decision

Conversation

@Suharshit

Copy link
Copy Markdown
Owner

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, or generate, 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

  • New decisions in 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). Returns UNSUPPORTED_EDIT_MESSAGE, written in code so the agent never promises edits it can't make.
  • enforceDecision allows both only for typed messages; answers and skip turns still go to planning.
  • New reply result action, settled as a TEXT message with no phase or brief change, so a previously proposed plan stays generatable.
  • A plan with nothing new to add now returns a reply instead 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.
  • These turns end after the analyze call (one model call instead of two).
  • context/architecture-context.md documents the add-only behaviour; progress tracker updated.

No UI change was needed: the sidebar already renders assistant TEXT messages.

Test plan

  • pnpm typecheck, eslint on lib/ai and src/trigger
  • Offline decision rules: reply/unsupported kept for messages, turned into plan for answers and skip; result schema accepts reply and rejects an empty one
  • Live analyze on gemini-3.5-flash-lite with a 10-component CI/CD canvas:
Message Decision
graph is looking too complex, simplify it… unsupported
what is my name? reply
why is there a separate CD Deployer? reply
add a Slack notifier that alerts when a deploy fails plan
remove the unit test job and add a load test job instead unsupported
  • After merge (Trigger.dev tasks deploy from main): the same messages in a production session, then generate a previously proposed plan after a reply turn

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
draftly Ready Ready Preview Sep 16, 2026 5:36pm UTC

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2e4910f4-5d6e-49f1-8a87-3fe4458fa4a5


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Suharshit
Suharshit merged commit f250a92 into main Sep 16, 2026
5 checks passed
@Suharshit
Suharshit deleted the feat/ai-agent-reply-decision branch September 16, 2026 18:24

This branch was successfully deployed

1 active deployment
Preview — ebdb81f2 Deployed Sep 16, 2026 by vercel[bot]
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