Skip to content

Fix ideation PR generation and task detail crash - #538

Open
adriandemian wants to merge 2 commits into
mainfrom
fix/ideation-pr-generation-pr-description
Open

Fix ideation PR generation and task detail crash#538
adriandemian wants to merge 2 commits into
mainfrom
fix/ideation-pr-generation-pr-description

Conversation

@adriandemian

@adriandemian adriandemian commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Create the missing synthetic parent chat conversation before plan PR-description workspace writes, satisfying the SQLite FK that blocked ideation PR generation.
  • Thread the chat conversation repository into every plan PR-description drafter construction path used by app state, startup recovery, and merge completion.
  • Stabilize task-detail registry viewMode objects in both Kanban and Agents task panels to avoid context churn on identical rerenders.

User Impact

Ideation merge tasks can draft PR descriptions again instead of failing with FOREIGN KEY constraint failed before PR creation. The Merge Incomplete/task-detail surface also avoids the unstable context updates that can trip React's maximum update depth guard when the error boundary is shown.

Technical Context

agent_conversation_workspaces.conversation_id references chat_conversations(id). The PR describer previously generated a synthetic conversation id only for the workspace, which worked in memory tests but failed under SQLite. The new helper parent conversation is archived immediately so it stays out of normal project chat lists, then both workspace and conversation rows are removed after success or failure. If workspace creation itself fails, the synthetic parent is deleted before returning the error.

The frontend fix memoizes the registry TaskDetailViewMode passed into TaskDetailContextProvider. A focused regression records the context viewMode reference across query-driven renders and explicit rerenders so this class of update loop cannot silently return.

Risks / Follow-Ups

No expanded React component stack was available in local logs or the user report, so the UI fix targets the concrete instability on the reported Merge Incomplete/task-detail path. If a different component is also involved, the error boundary stack will still be needed for a follow-up.

Validation performed locally:

  • Rust: focused plan_pr_description lib tests, including SQLite FK regression and cleanup assertions.
  • Frontend: task-detail registry, MergeIncomplete detail, overlay, and timeline focused Vitest suites.
  • Frontend typecheck and git diff --check.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src-tauri/src/application/plan_pr_description.rs 86.66% 2 Missing ⚠️
...src/application/chat_service/chat_service_merge.rs 0.00% 1 Missing ⚠️
src-tauri/src/application/startup_pipeline.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@reefagent
reefagent force-pushed the fix/ideation-pr-generation-pr-description branch from 0df7335 to 6129517 Compare June 30, 2026 11:07
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