Branch a new conversation off any user message: POST /api/fork locates the fork point by message ordinal (find_cut_line drives the real ParserState so the cut can't drift from the viewer), the sidecar copies the CC session file truncated at that line under a fresh session id (sessionId rewritten per record, trailing queue-operation/last-prompt bookkeeping trimmed) and resumes it; the pi runner branches pi's native session tree (--fork-from / --cut-user-ord) and mirrors the truncated CC-schema prefix. forkedFrom is stamped into the conversation meta; cutText canaries refuse a drifted slice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
17 KiB
Executable File
17 KiB
Executable File