Fix roadmap generation phase mapping and progress heartbeat#1924
Fix roadmap generation phase mapping and progress heartbeat#1924VDT-91 wants to merge 4 commits intoAndyMik90:auto-claude/237-migrate-claude-agent-sdk-python-to-vercel-ai-sdk-tfrom
Conversation
|
Plain-language bug summary: roadmap progress events used old phase names (discovery, eatures) while the frontend state machine only accepts (discovering, generating). That mismatch caused state errors / stuck progress behavior. This PR normalizes those phases at queue/store/load boundaries and adds heartbeat progress updates so long AI steps remain visibly active. |
Summary of ChangesHello, 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 critical issues in the roadmap generation process by ensuring consistent phase mapping and providing more frequent progress updates. The changes prevent the UI from displaying incorrect or stalled progress, leading to a more accurate and responsive user experience during roadmap creation. Highlights
Changelog
Activity
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.
Code Review
This pull request effectively resolves the roadmap generation phase mismatch by introducing normalization logic at multiple layers of the application. The changes in agent-queue.ts, roadmap-handlers.ts, and roadmap-store.ts ensure that legacy phase names are correctly mapped to their canonical versions, fixing the core issue. Additionally, the introduction of throttled progress heartbeats in agent-queue.ts is a great UX improvement that provides better visibility during long-running generation steps. My main feedback is about code duplication of the phase normalization logic, which is present in three different files. Centralizing this logic would improve maintainability.
| /** | ||
| * Normalize inbound phase aliases from backend/legacy progress files | ||
| * to the canonical roadmap generation phases expected by XState. | ||
| */ | ||
| function normalizeGenerationPhase(phase: string): RoadmapGenerationStatus['phase'] { | ||
| switch (phase) { | ||
| case 'idle': | ||
| case 'analyzing': | ||
| case 'discovering': | ||
| case 'generating': | ||
| case 'complete': | ||
| case 'error': | ||
| return phase; | ||
| case 'discovery': | ||
| return 'discovering'; | ||
| case 'features': | ||
| return 'generating'; | ||
| default: | ||
| return 'analyzing'; | ||
| } | ||
| } |
There was a problem hiding this comment.
This normalization logic is duplicated across three files:
apps/desktop/src/main/agent/agent-queue.ts(normalizeRoadmapPhase)apps/desktop/src/main/ipc-handlers/roadmap-handlers.ts(normalizeRoadmapProgressPhase)- Here in
roadmap-store.ts(normalizeGenerationPhase)
To improve maintainability, this logic should be centralized.
Furthermore, this normalization in the renderer might be redundant. The backend appears to normalize phases in agent-queue.ts (from the runner) and roadmap-handlers.ts (from persisted files) before sending data to the renderer. If the backend guarantees normalized phases over IPC, this function and its usage in setGenerationStatus could be removed, simplifying the renderer code.
If this defensive normalization is still desired, consider moving the function to a shared utility file (e.g., in apps/desktop/src/shared/utils/) to be used by both renderer and main process code, which would resolve the duplication.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
Summary
Fix roadmap generation progress/state mismatch and improve visibility during long-running phases.
Root cause
Backend roadmap runner emitted legacy phase names (
discovery,features) while renderer state machine expects canonical names (discovering,generating).Fixes in this PR
text-delta/tool-use) so long steps do not appear frozen.Result
Roadmap progress now transitions correctly:
analyzing -> discovering -> generating -> complete