Skip to content

feat(sessions): fork Claude sessions from a message point#920

Open
rodboev wants to merge 4 commits into
kenn-io:mainfrom
rodboev:pr/message-point-fork
Open

feat(sessions): fork Claude sessions from a message point#920
rodboev wants to merge 4 commits into
kenn-io:mainfrom
rodboev:pr/message-point-fork

Conversation

@rodboev

@rodboev rodboev commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

AgentsView can resume or fork a whole Claude session, but it cannot start from the message where the user actually wants to branch. The session detail view already exposes message ordinals, and the backend already owns resume command construction, so the missing piece is a message-point contract between the message UI and the resume handler.

This adds a Claude-only message-point fork path that accepts a session ID plus message ordinal, validates that the ordinal belongs to the local Claude session, and builds a deterministic context prefix for a new Claude run. The existing whole-session resume and fork behavior stays unchanged when no ordinal is supplied, and storage remains a data source rather than the place where fork policy lives. Embedded child-session transcripts keep their own session identity, local read-only mode falls back to a copyable command, remote read-only mode hides the action, and each generated prompt file is isolated per launch and self-cleaning when run.

The frontend adds the affordance at the message level instead of overloading the breadcrumb session menu. The focused coverage should prove whole-session preservation, unsupported-agent handling, missing-ordinal handling, and the message-level request body.

Fixes #107

@roborev-ci

roborev-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (1db98b0)

No Medium, High, or Critical findings were reported.

The only findings were Low severity, so they are omitted per the requested threshold.


Panel: ci_default_security | Synthesis: codex, 7s | Members: codex_default (codex/default, done, 6m44s), codex_security (codex/security, done, 3m16s) | Total: 10m7s

@roborev-ci

roborev-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (98d985f)

Summary verdict: No Medium, High, or Critical findings to report.

The only reported issues were Low severity and have been omitted per the requested threshold.


Panel: ci_default_security | Synthesis: codex, 5s | Members: codex_default (codex/default, done, 7m22s), codex_security (codex/security, done, 2m38s) | Total: 10m5s

@roborev-ci

roborev-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (0ab3f85)

Medium severity issue found; security review found no additional issues.

Medium

  • Location: internal/server/huma_routes_sessions.go:1005
  • Problem: from_ordinal is treated as a slice index, but stored Claude message ordinals can be non-contiguous. A valid selected message such as ordinal 3 in [0,1,3] returns 404 and cannot be forked.
  • Fix: Find the message by Message.Ordinal, keep the found slice index separately, and render msgs[:idx+1]. Add a regression test with a gap in ordinals.

Panel: ci_default_security | Synthesis: codex, 7s | Members: codex_default (codex/default, done, 4m50s), codex_security (codex/security, done, 4m55s) | Total: 9m52s

@roborev-ci

roborev-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (5a43b12)

Summary verdict: One Medium issue needs attention; no Critical or High findings were reported.

Medium

  • internal/server/huma_routes_sessions.go:1029
    Message-point fork commands are built with POSIX-only shell syntax ('...', <, ; rm -f -- ...). Windows builds expose this feature, but the copied fallback command will not run correctly in PowerShell/cmd. Generate platform-specific command/cleanup syntax based on runtime.GOOS, or disable/return unsupported for message-point command fallback on Windows until supported.

Panel: ci_default_security | Synthesis: codex, 6s | Members: codex_default (codex/default, done, 9m35s), codex_security (codex/security, done, 3m3s) | Total: 12m44s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat: fork/resume conversation from any message point

1 participant