1.6 KiB
1.6 KiB
Diagnosis: Why the Plan / PRD Didn't Update in the UI
I investigated why the PRD and Tasks did not appear in your Plan UI after the AI said it updated them.
Here is exactly what happened:
1. Why the PRD text didn't update
- The UI's "Product Spec" tab specifically looks for a single document stored in your database under a hardcoded ID called
prd_spec. - Because the AI doesn't have a tool specifically named
update_prd_spec, it used the genericplan_vision_settool. It saved your new PRD text into theplan.visionfield (the "Objective" box) instead of theprd_specdocument. - The Fix: I can either add a new AI tool specifically for updating the PRD document, or we can adjust the UI to read from the correct field.
2. Why the Tasks didn't show up immediately
- The AI correctly executed
plan_task_addfor both tasks ([US1]and[US2]). I queried the Postgres database, and both tasks are successfully saved in your project's plan. - However, the Plan UI uses aggressive caching (
revalidateOnFocus: false). When the AI finishes running its background tools, the UI doesn't know the database changed. - You simply need to refresh the page, and then click on the Delegate tab. You will see both
[US1]and[US2]waiting in the queue!
How we can fix this permanently when you return:
- Real-time UI: We can add a simple
router.refresh()or WebSocket trigger so the Plan tab instantly updates when the AI adds a task. - Dedicated PRD Tool: I can add an
update_prd_documenttool to the AI so it knows exactly where to save Product Specifications.
Let me know which you want to tackle first when you're back!