Skip to content

Conversation

@casiusss
Copy link
Contributor

@casiusss casiusss commented Dec 30, 2025

Problem

The backlog plan feature was broken - when users clicked the Plan button and entered a prompt, the AI would generate a plan but nothing would appear in the review dialog. It appeared as if "nothing happened."

Root Cause

The DEFAULT_BACKLOG_PLAN_SYSTEM_PROMPT was using an incorrect JSON output format that didn't match the BacklogPlanResult interface:

Broken format (what the prompt was asking for):

{
  "plan": {
    "add": [...],
    "update": [...],
    "delete": [...]
  }
}

Expected format (what the code parses):

{
  "changes": [
    { "type": "add", "feature": {...}, "reason": "..." },
    { "type": "update", "featureId": "...", "feature": {...}, "reason": "..." },
    { "type": "delete", "featureId": "...", "reason": "..." }
  ],
  "summary": "...",
  "dependencyUpdates": [...]
}

The parser in parsePlanResponse() would fail to find the changes array and return an empty result, causing the frontend to show "No changes generated."

Solution

Restored the original working JSON format from the hardcoded prompt before the customizable prompts migration. The prompt now correctly instructs the AI to output:

  • A changes array with objects containing type, feature, and reason
  • A summary string
  • A dependencyUpdates array

This matches exactly with the BacklogPlanResult and BacklogChange TypeScript interfaces.

Testing

  • ✅ All 845 tests passing
  • ✅ Verified format matches original hardcoded prompt from upstream
  • ✅ JSON structure aligns with BacklogPlanResult interface
  • ✅ Build succeeds without errors

Impact

Users can now:

  • Use the Plan button on the Kanban board successfully
  • See generated plans in the review dialog
  • Apply AI-suggested changes to their backlog

Files Changed

  • libs/prompts/src/defaults.ts - Fixed DEFAULT_BACKLOG_PLAN_SYSTEM_PROMPT JSON format

Related Issue: The bug was introduced during the customizable prompts feature merge when the hardcoded prompt was migrated to the defaults library.

Summary by CodeRabbit

  • Refactor
    • Restructured plan change format to include explicit reasons, priorities, and enhanced dependency management for each change, providing clearer visibility into plan modifications.

✏️ Tip: You can customize this high-level summary in your review settings.

The backlog plan system prompt was using an incorrect JSON format that didn't
match the BacklogPlanResult interface. This caused the plan generation to
complete but produce no visible results.

Issue:
- Prompt specified: { "plan": { "add": [...], "update": [...], "delete": [...] } }
- Code expected: { "changes": [...], "summary": "...", "dependencyUpdates": [...] }

Fix:
- Restored original working format with "changes" array
- Each change has: type ("add"|"update"|"delete"), feature, reason
- Matches BacklogPlanResult and BacklogChange interfaces exactly

Impact:
- Plan button on Kanban board will now generate and display plans correctly
- AI responses will be properly parsed and shown in review dialog

Testing:
- All 845 tests passing
- Verified format matches original hardcoded prompt from upstream

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

The pull request restructures the JSON schema in prompt templates for backlog planning. It replaces a hierarchical plan structure with a unified changes array, introduces explicit reason and priority fields, adds dependency management details, and includes a root-level summary field.

Changes

Cohort / File(s) Summary
Prompt JSON Schema Updates
libs/prompts/src/defaults.ts
Restructured plan JSON schema from hierarchical add/update/delete sections to unified changes array with type field; added reason, priority, and dependencies fields; reformatted dependencyUpdates with removedDependencies/addedDependencies; added root-level summary

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A schema's dance, where changes align,
Old nests of add/update now unified shine,
With reasons whispered and priorities gleaned,
Dependencies tracked in structures pristine! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: restoring the correct JSON format for the backlog plan prompt to fix parsing issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5ae9ad and 968d889.

📒 Files selected for processing (1)
  • libs/prompts/src/defaults.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Always import from shared packages (@automaker/*), never from old relative paths

Files:

  • libs/prompts/src/defaults.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use resolveModelString() from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names

Files:

  • libs/prompts/src/defaults.ts
⏰ 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). (1)
  • GitHub Check: e2e
🔇 Additional comments (1)
libs/prompts/src/defaults.ts (1)

334-371: LGTM! JSON format correctly restored.

The JSON structure now matches the BacklogPlanResult interface expected by the parser. The format includes:

  • Unified changes array with type discriminators (add/update/delete)
  • Explicit reason fields for all changes
  • Root-level summary and dependencyUpdates
  • Complete field definitions for all change types

This fix resolves the parsing issue that was causing empty results in the review dialog.


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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @casiusss, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug in the backlog plan feature where AI-generated plans were not being displayed to users. The issue stemmed from a mismatch between the JSON format requested by the AI system prompt and the format expected by the application's parsing logic. By correcting the system prompt to output the expected JSON structure, the feature is now fully functional, enabling users to effectively leverage AI for backlog planning.

Highlights

  • Bug Fix: Backlog Plan Feature: The backlog plan feature was broken, preventing AI-generated plans from appearing in the review dialog after users clicked the 'Plan' button.
  • Root Cause Identified: The DEFAULT_BACKLOG_PLAN_SYSTEM_PROMPT was instructing the AI to output an incorrect JSON format, which did not match the BacklogPlanResult interface expected by the parsing logic.
  • Solution Implemented: The DEFAULT_BACKLOG_PLAN_SYSTEM_PROMPT has been updated to restore the correct JSON output format, aligning it with the BacklogPlanResult and BacklogChange TypeScript interfaces.
  • User Impact: Users can now successfully utilize the 'Plan' button on the Kanban board, view generated plans in the review dialog, and apply AI-suggested changes to their backlog.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a bug where the backlog planning feature was failing due to a mismatch between the JSON format requested by the AI prompt and the format expected by the backend parser. By restoring the correct JSON structure in DEFAULT_BACKLOG_PLAN_SYSTEM_PROMPT and wrapping it in a json code block, you've aligned the prompt with the BacklogPlanResult interface and the parsing logic. This is a solid fix. I have one minor suggestion to make the example JSON in the prompt more robust by ensuring it's strictly valid JSON.

@webdevcody webdevcody merged commit ed2da79 into AutoMaker-Org:main Dec 30, 2025
8 checks passed
@webdevcody
Copy link
Collaborator

ty

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.

2 participants