Repository navigation
fix: link sessions started from a selection back to their source chat - #206509
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesThis PR adds source-session links after quoted selections when starting a new session. Example: Select “Review the deployment checklist.” in agent:main:main and start a session with “Summarize the risks.”
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR adds useful source attribution that current main still lacks, with a focused implementation and no discrete correctness findings. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI carries a selected passage and its source key into launcher attachments, then converts them into the initial sessions.create message; existing Markdown session-link handling supplies titles and navigation. flowchart LR
A[Transcript selection] --> B[Launcher attachment]
B --> C[Draft submission formatter]
C --> D[Sessions create request]
D --> E[New session transcript]
E --> F[Existing session link renderer]
Technical reviewBest possible solution: Keep source attribution in the existing initial-message formatter and reuse the established session-link renderer without adding persisted lineage state. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that annotations carry a session key which is omitted when the launcher builds the initial quoted message; no product execution was performed during this read-only review. Is this the best way to solve the issue? The change is the smallest complete addition for source navigation: it uses existing annotation data, preserves quote ordering and mention offsets, and introduces no competing state or renderer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d78611d842e5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +10, Tests 0, Docs 0. Total +10 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 27, 2026, 3:53 AM ET / 08:53 UTC. |
|
Merged via squash.
|
* fix: preserve completed Claude tool calls in chat history * fix: preserve completed Claude tool calls in chat history OpenClaw-Publication: d3a267f1-3ba5-4fc9-a4dd-3968148f8eb1 (cherry picked from commit a27b4e6) Follow-ups: 49492d7 fix: align Control UI tooling and docs with task card removal (#207747) [not selected for this narrow backport]; cebbb78 fix: keep tagged silent replies out of chat (#207738) [not selected for this narrow backport]; d4e1305 fix: hide desktop Details when there is nothing to show (#205093) [not selected for this narrow backport]; 11b2cf0 fix: keep the selected Review file compact when the tree is open (#203825) [not selected for this narrow backport]; 4be636b feat(ui): offer Add to Home agent when Home sidebar is open (#207773) [not selected for this narrow backport]; f766de4 fix: surface favorites and recommended models in picker search (#201450) [not selected for this narrow backport]; 61a7661 improve(ui): remove suggested-task cards from Control UI (#199167) [not selected for this narrow backport]; 48cc039 fix: keep long process names compact above mobile output (#203767) [not selected for this narrow backport]; 9316f05 fix: show the first message when session naming fails (#205607) [not selected for this narrow backport]; aa4a68f fix(ui): show chat completions as activity rows (#201891) [not selected for this narrow backport]; ec209d0 fix(ui): link selection sessions to their source session (#206509) [not selected for this narrow backport]; 3f475cc fix(ui): keep pre-final assistant text visible after a completed turn (#140835) [not selected for this narrow backport]; 05ec989 fix: keep chat photo previews sharp within their byte limits (#206461) [not selected for this narrow backport]; b3bdfb5 feat(ui): preview CSV chat attachments as tables (#206148) [not selected for this narrow backport]; 6b3ccab fix: show Waiting and Resumed for Claude CLI subagent handoffs (#206158) [not selected for this narrow backport]; 762aa00 fix: keep dictation recording when switching tabs or applications [not selected for this narrow backport]; d3f9fca fix: keep similar subagent names distinct in compact rows (#203777) [not selected for this narrow backport]; 864efbb improve: keep composer error cards on one line (#204337) [not selected for this narrow backport]; d7ed2dd fix: stop replaying Claude progress updates in active chats (#203970) [not selected for this narrow backport]; 269f884 fix: show Claude CLI document uploads only once in chat (#203866) [not selected for this narrow backport]; 4708bac fix(ui): show Linear artwork in chat tool activity (#204414) [not selected for this narrow backport] Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
When you highlight text in a chat and choose New session, the new session starts with your selection quoted, but nothing says which chat it came from. You can't jump back to the original conversation, and the agent in the new session can't look at it for context.
User Impact
The first message of a session started from a selection now ends the quote with a
From <session>line. Chat already turns a bare session key into a link labeled with that session's title, so the line shows the source chat's name, opens it on click, and gives the agent the key it needs forsessions_history. Quoting from several sessions lists each source once.Nothing changes in the sidebar: the new session stays a top-level session and does not become a sub-session of the source.
Accepted edge case: with
session.scope="global", the source key isglobal, so the line readsFrom globalas plain text with no link. Making that a link would mean passing the agent ID through the chat props for a rare config, so this PR doesn't.Why This Change Was Made
The selection already carried its source session key; it was dropped when the quote was turned into message text. Putting the key in the message text reuses the existing session-link rendering. It needs no new session field and no protocol change. A durable "came from" field was considered and declined for now.
Evidence
ui/src/e2e/chat-selection-to-main.e2e.test.ts› "starts a new session from the launcher with the selected excerpt attached" now expectsFrom agent:main:mainin thesessions.createmessage and passes locally (pnpm test:ui:e2e … -t 'starts a new session'). Without the fix, the message has noFromline and this assertion fails..markdown-session-linktitled with the source session, and the old text renders none. Both captures use this branch's build, so "before" shows the old message text, not a build frommain.oxfmt --check,oxlint, the pre-commit hook, andgit diff --checkare clean.be3c73e2, headd5871ffc) ran at P0–P2. It reported one P2, thesession.scope="global"case above, which is accepted as an edge case. No other findings.Clean comparison
Annotated comparison
Mocked Control UI, 1280×900, fixture data; old and new message text rendered by the same build at
d5871ffc.🦞 Made with OpenClaw