Skip to content

feat(daemon): annotate selection with fork's session clip on fork Runs#934

Merged
edwin-zvs merged 1 commit into
mainfrom
program-fork-run-session-clip
Jul 21, 2026
Merged

feat(daemon): annotate selection with fork's session clip on fork Runs#934
edwin-zvs merged 1 commit into
mainfrom
program-fork-run-session-clip

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

When a selection Run (with or without the optional instruction) is dispatched to an interactive fork, the daemon now appends the fork's @{session:<id>} clip to the selected text at dispatch time — the same convention selection verbs (spec 0089) and instant dispatch (spec 0066) already follow. The Program document immediately shows where the work went, and the clip renders the fork's live state in place.

  • The annotated block keeps its pending shimmer, re-declared with a plain "Running" tooltip (the clip changes the block's content id, so the shimmer decl targets the post-clip id via keep_pending).
  • Best-effort: if the selection anchor no longer applies verbatim (concurrent edit / ambiguity), the Run proceeds without a clip instead of failing — the fork already exists and is booting.
  • Shift+Run (owner-targeted) and non-fork callers are unchanged: no session clip — the work happens in the session the user is already looking at.
  • The execute response returns the post-annotation program/blocks and a re-snapshot of the active run, so clients render the clip without waiting for the broadcast.

Spec 0076 updated with the annotation decision.

Verification

  • cargo test --workspace — green (exit 0).
  • New/extended e2e tests:
    • program_selection_fork_run_delivers_and_submits_prompt now also asserts the clip lands in the returned + persisted markdown and the block shimmers with the "Running" tooltip.
    • program_selection_owner_run_adds_no_session_clip asserts the Shift/owner path stays clip-free.

🤖 Generated with Claude Code

A selection Run dispatched to an interactive fork now appends the fork's
@{session:<id>} clip to the selected text at dispatch time — the same
convention selection verbs (spec 0089) and instant dispatch (spec 0066)
already follow — so the Program shows where the work went and renders the
fork's live state in place. The annotated block keeps its pending shimmer
with a plain 'Running' status. Best-effort: a drifted/ambiguous anchor
skips the clip instead of failing the run. Owner-targeted (Shift) runs
and non-fork callers add no clip. Spec 0076 updated.
@edwin-zvs
edwin-zvs merged commit 547eee6 into main Jul 21, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the program-fork-run-session-clip branch July 21, 2026 20:02
@edwin-zvs edwin-zvs mentioned this pull request Jul 22, 2026
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.

1 participant