Skip to content

Fork chats from selected messages - #215

Merged
yongkangc merged 5 commits into
cfal:mainfrom
0xSolarPunk:feat/message-point-fork
Jun 24, 2026
Merged

Fork chats from selected messages#215
yongkangc merged 5 commits into
cfal:mainfrom
0xSolarPunk:feat/message-point-fork

Conversation

@0xSolarPunk

@0xSolarPunk 0xSolarPunk commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Add per-message fork actions that send an optional upToSeq cutoff through the chat API and session controller.
  • Preserve native JSONL source metadata so forks can truncate at a clicked Claude/Codex message, preferring Claude-style entry ids and falling back to source lines.
  • Allow message-point forks while the source is running when the agent supports fork-while-running, and truncate before active/corrupt JSONL tails.
  • Pass raw copied Codex rollout paths through resume params and harden HTTP compression/range handling for the current Bun runtime.

API note:

  • POST /api/v1/chats/fork now accepts optional upToSeq; omitting it preserves existing full-chat fork behavior.

Dogfood evidence:

  • Isolated server from this branch with GARCON_DISABLE_AUTH=true, separate GARCON_CONFIG_DIR, and a seeded Claude JSONL chat containing four complete lines plus one deliberately incomplete active tail.
  • Flow tested in browser: open seeded chat, open the first message three-dot menu, click Fork, verify new forked chat opens and renders only the first message.
  • Native verification: forked JSONL line count is 1, contains the first prompt, excludes the second prompt, excludes tail response, excludes incomplete active tail, and parses as valid JSONL.
  • Report: docs/pr-evidence/message-point-fork/report.md

Screenshots:

Source chat with completed messages and incomplete tail ignored:

Source chat

First message menu showing per-message Fork:

Fork menu

Forked chat containing only the selected prefix:

Forked chat

Validation:

  • bun run check
  • bun run test
  • timeout 60s bun run start --port 0 || test $? -eq 124 (server reached http://0.0.0.0:34091 before the timeout shut down the smoke process)

@yongkangc
yongkangc enabled auto-merge (squash) June 24, 2026 10:22
@yongkangc
yongkangc merged commit d0aa1c1 into cfal:main Jun 24, 2026
4 checks passed
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.

2 participants