feat: full Clone MCP session integration (start/record/feedback/stop)#7
Merged
Merged
Conversation
32b6c1b to
cc51668
Compare
4b4072b to
ab1b473
Compare
f099de4 to
5b23ef6
Compare
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.
Warning
Review carefully before merge. This PR adds Clone MCP session memory recording in addition to prediction: session tracking, prompt/response recording, feedback submission, and session stop calls. Prediction and local safety gates still follow the latest
mainbehavior.Summary
scripts/clone-mcp.mjsas the shared Clone MCP action layer forpredict_next_prompt,start_session,stop_session,record_agent_prompt,record_agent_response, andsubmit_feedback, built on the existing shared MCP client/auth helpers frommain./clone:loop, record the initial user prompt, and persistclone_session_id,mcp_session_id, andlast_prompt_event_idin local loop state when available.Write,Edit,MultiEdit, andapply_patchmutation summaries./clone:cancel-loop.Alignment with merged direction
validateActiveLoopState, strict session matching, loop-start history validation, and TTL handling.clone-mcp.mjscentralizes Clone-specific actions.Failure behavior
start_session/ initialrecord_agent_promptfailure: loop still starts, with a warning.record_agent_response,record_agent_prompt,submit_feedback, orstop_sessionfailure: hook continues its existing control flow and appends an error record to.claude/clone-loop.history.local.jsonl.predict_next_promptfailure: loop does not fabricate a continuation. Stop hook escalates/stops; AskUserQuestion defers to the real user. This matches the latest safe gating behavior onmain.Validation
npm test-> 72/72 passclaude plugin validate .-> passgit diff --check-> passManual follow-ups before undrafting
/clone:loop "..."in a real Claude Code session and confirm state frontmatter receivesclone_session_id.record-response,record-prompt, andfeedback-sentlocal history events.session-stoppedare logged without prompt injection./clone:cancel-loopand confirm the state file is removed and stop-session errors, if any, are non-fatal.