feat: capture user-pasted plans from chat messages#39
Open
chriswritescode-dev wants to merge 3 commits into
Open
feat: capture user-pasted plans from chat messages#39chriswritescode-dev wants to merge 3 commits into
chriswritescode-dev wants to merge 3 commits into
Conversation
Adds server-side capture of user-pasted plans (marked with ---plan-start/---plan-end) from chat messages, persists them to the plans repo, and prompts the architect to ask how to execute. - inspectLatestPastedPlan finds plans in the newest user message only (not scanning older messages of the same role) - Handles both streaming (message.part.updated) and completion (message.updated) paths - Captures are skipped when a loop is active on the session - TUI-side plan store (tui-plan-store.ts) provides direct SQLite access so captured plans survive message compaction - TUI prefers persisted plan over message-parsed plan in execute-plan flow - fetchLatestPlanForSession falls back to user-pasted plans when no assistant plan exists - Refactored inspectLatestMarkedPlan into a generic role-based helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Captures user-pasted plans (marked with
---plan-start/---plan-end) from chat messages, persists them server-side, and prompts the architect to ask the user how to execute. Adds a TUI-side plan store so a captured plan survives message compaction.Changes
Added
src/hooks/plan-capture.ts— event hook for user message completion, captures pasted plans and prompts architectsrc/utils/tui-plan-store.ts— direct SQLite read/write access to persisted plans from TUIinspectLatestPastedPlan— finds marked plans in the newest user message only (not scanning older messages of the same role)Updated
src/utils/marked-plan-parser.ts— refactoredinspectLatestMarkedPlaninto a generic role-based helpersrc/utils/plan-from-messages.ts—fetchLatestPlanForSessionfalls back to user-pasted plans when no assistant plan existssrc/tui.tsx— prefers persisted captured plan over message parsing in execute-plan flowsrc/services/plan-capture.ts— addedcapturePastedPlanForSessionTests
test/plan-capture.test.tscovering pasted plan capture, streaming path, dedup, loop guard, and TUI fallback orderingtest/utils/plan-from-messages.test.tsBreaking changes
None.