-
Notifications
You must be signed in to change notification settings - Fork 483
fix: restore correct JSON format for backlog plan prompt #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: restore correct JSON format for backlog plan prompt #327
Conversation
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>
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
⏰ 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)
🔇 Additional comments (1)
Comment |
Summary of ChangesHello @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
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this 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.
|
ty |
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_PROMPTwas using an incorrect JSON output format that didn't match theBacklogPlanResultinterface: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 thechangesarray 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:
changesarray with objects containingtype,feature, andreasonsummarystringdependencyUpdatesarrayThis matches exactly with the
BacklogPlanResultandBacklogChangeTypeScript interfaces.Testing
BacklogPlanResultinterfaceImpact
Users can now:
Files Changed
libs/prompts/src/defaults.ts- FixedDEFAULT_BACKLOG_PLAN_SYSTEM_PROMPTJSON formatRelated Issue: The bug was introduced during the customizable prompts feature merge when the hardcoded prompt was migrated to the defaults library.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.