Repository navigation
fix(ui): fork active sessions from stable history - #123718
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 14, 2026, 3:39 PM ET / 19:39 UTC. ClawSweeper reviewWhat this changesThe PR adds a stable-history fork mode so web, Android, iOS, and macOS clients can fork an active session without copying its in-flight turn. Merge readinessThe active-fork approach is focused, but the PR still breaks the published one-argument Swift transport API; it needs that additive compatibility repair before merge. Priority: P1 Review scores
Verification
How this fits togetherSession menus send fork requests through the Gateway, which creates a child from persistent transcript history. The new mode selects the last completed assistant boundary while the parent session continues running. flowchart LR
A[Session menus] --> B[Gateway fork request]
B --> C[Active-run decision]
C --> D[Stable transcript boundary]
D --> E[Child session]
A --> F[Parent continues running]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +164, Tests +122, Other +124. Total +410 across 49 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA web chat run can directly show the stable child boundary and continuing parent. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain the one-argument transport requirement and default, then add a boundary-aware overload that delegates compatibly while updated Gateway transports implement the stable-history request. Do we have a high-confidence way to reproduce the issue? Yes, by source: current main rejects a fork when its parent has active work, while the UI offers the action; the proposed Swift API regression is also directly reproducible by compiling an old-style caller or conformer. Is this the best way to solve the issue? No: the Gateway/storage boundary is appropriate, but replacing the published Swift method is not the best fix; an additive overload preserves existing consumers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3289e08c3005. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@openclaw-mantis web UI chat proof: verify that forking an active session creates a child from the last completed message while the parent keeps running. |
Mantis Web UI Chat ProofSummary: Mantis ran the OpenClaw Control UI chat proof against the candidate ref, sent a message through the mocked Gateway, rendered the final reply in the browser, and captured browser artifacts for review.
Control UI web chat proof Full videos: |
e06a1b6 to
f2758fb
Compare
28135c2 to
6880190
Compare
592b627 to
80d76aa
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Landing evidence for |
|
Merged via squash.
|
* fix(ui): fork active sessions from stable history * fix(protocol): align active fork types * test(ui): match main-session fork routing * fix(sessions): unify stable fork admission * fix(native): fork active sessions from stable history * fix(android): fork active sessions from stable history * style(android): simplify active fork result handling * fix(native): preserve legacy fork transport API * test(native): complete legacy fork transport stub --------- Co-authored-by: Peter Steinberger <[email protected]>

What Problem This Solves
Fixes an issue where users who forked a session while its agent was working received a backend rejection even though the Control UI offered the action.
Why This Change Was Made
Active-session forks now request an explicit stable boundary and copy the transcript only through the most recent completed assistant message. The in-flight user/tool turn stays in the parent. Inactive forks keep their existing full-transcript behavior, and active menus name the boundary as “Fork from last completed message.”
This is additive to the Gateway contract (
forkFrom: "last-completed") and keeps rewind, branch switching, model-selection-locked sessions, and command-hook rollover behavior unchanged. The published one-argument Swift transport API is preserved; the new overload delegates compatibly for legacy conformers while updated iOS/macOS transports implement the stable-boundary route.User Impact
Users can fork a working session immediately without stopping it or waiting for completion. The new session opens from the last completed response, while the parent continues running normally.
Evidence
git diff --check origin/main...HEADpassed.READY FOR /prepare-pr.AI-assisted implementation; the change, compatibility boundary, and owner paths were reviewed directly.