---
title: Re-run from here (edit a message & re-run in a new session)
---

# Re-run from here

## What it is

**Pick any message in a conversation and re-run the chat from that point in a brand-new session.**
You can reword one of your own messages and resend it, or — if you anchor on one of the AI's replies —
write a fresh next message. Either way Omniscio forks a **new** session that **shows the whole conversation
up to the point you picked** (so it reads like the same chat continued, not a blank new session), runs
your message there, and drops you into the new chat. The **original conversation is never changed** —
re-running always forks; it never edits in place or rewinds the session you started from.

This is the answer to "can I edit a message I already sent?" — you can't change a sent message _in
place_ (the agent already saw it, and the transcript is the real context the CLI resumes from), but you
**can** edit it and re-run from there into a clean fork. The fork runs on the **same engine the
conversation was already on** — a Codex conversation continues on Codex, a Gemini one on Gemini —
and carries that session's engine, model and thinking level, so you get the same assistant with your
correction applied rather than a different one.

## Where to find it

### How to use it

1. Hover the message you want to re-run from and open its actions:
   - On **one of your messages**, choose **"Edit & re-run from here"** (the `⋯` menu). A box opens
     **pre-filled with that message** so you can reword it.
   - On an **AI reply**, choose **"Re-run from here"** (the `⋯` menu). The box opens **empty** — type
     the next message you want to send.
2. Edit or type your message, then press **Ctrl+Enter** (or click **"Re-run in new session"**).
3. Omniscio opens a new session that **shows the earlier conversation** (cloned into it) with your edited
   message in place, and runs it. You land in the new chat. A clickable **"Spawned by …"** note at the
   top links back to the original, which is left exactly as it was.

**What carries over:** everything in the conversation up to the message you picked — for your own
message, everything _before_ it (your edited text replaces it); for an AI reply, everything _up to and
including_ that reply (you continue after it). The new session **shows** that earlier conversation — a
visible clone of your and the AI's turns — so it reads like the same chat, with your edited message in
its place. If the history is too large for the model's memory, Omniscio keeps the most recent part that fits
for the AI and shows a small note that **the assistant only remembers the recent part** (you still see
all of it above). Attachments in the earlier turns show a light **"[attachment]"** marker rather than
the original file (v1), and the new session continues on the **same engine and model** the source
session was running — unless that session's model cannot run on its own engine (an old row), in which
case the fork still lands on the right engine using that engine's default model.

## How it behaves

### Over the CLI (agents)

The same fork is available to external agents over the CLI control server:
`POST /session/:id/rerun-from-message` with body `{ messageId, editedText }` (`:id` is the SOURCE
session). It **spawns a paid session** (on the source session's own engine), so it is **approval-gated** by default — it lands as a
pending inbox row (`202`) and forks only after the user approves; toggle at Settings → CLI Control →
"Re-run from a message" (`requireApprovalForCliSessionRerun`). Unlike the lifecycle routes there is no
in-app inline carve-out — every token-bearer call is gated. Full request/response shape + the anchor
rule: the `omniscio-control` skill's [sessions surface](/.claude/skills/omniscio-control/sessions.md). Never
call it on your own initiative — only when the user explicitly asks (it costs money).

## For agents

### How it works

- **The action lives on the message bubble.** [MessageBubble.tsx](../../src/renderer/src/components/ui/MessageBubble/MessageBubble.tsx)
  adds the item to its action menu for non-aside operator/agent rows,
  opening [RerunFromMessageModal.tsx](../../src/renderer/src/components/ui/RerunFromMessageModal.tsx).
- **Boundary rule (pure core).** `selectCarriedMessages` in
  [rerun-from-message.ts](../../src/main/services/rerun-from-message.ts) decides what's carried: an
  operator anchor → everything before it; an agent anchor → everything up to and including it.
- **Visible clone + invisible AI context.** `buildClonedHistory` keeps the operator + agent turns of
  the carried conversation, and the orchestrator hands them to `createSessionWithPrompt` as
  `clonedHistory`, which `persistRerunVisibleClone` writes as **visible** rows — inserted between the
  "Spawned by" note and your edited message so the fork reads top-to-bottom as the same chat. Separately,
  `buildRerunInitialPrompt` wraps the SAME carried conversation as an invisible `<previous-conversation>`
  prefix (trimmed with the shared `transcriptCharCap`, reused from
  [context-transfer-service.ts](../../src/main/services/context-transfer-service.ts)) and appends your
  message; that prefix is what reaches the CLI as the first turn (`initialPrompt`), while `displayText`
  is just your edited message. Because the clone is display-only, **the prompt the AI receives is
  byte-identical to a fork with no clone** — the same "send context, show only the question" mechanism
  that powers _Ask about this page_, now with the context also shown.
- **Fork + link back.** It calls the one session-spawn chokepoint `createSessionWithPrompt` with
  `parentSessionId` set, which stamps the new session's origin and pins the clickable "Spawned by" note
  (see [session-provenance.md](session-provenance.md)). The source session is read, never written.
- **IPC.** The renderer calls the `session:rerun-from-message` channel; the handler resolves the source
  session, then runs the orchestrator. Invariants are locked in
  `rerun-from-message-contract.md`.

## Related

- [edit-a-user-message.md](edit-a-user-message.md) — the broader "can I change a sent message?" question
  (in-place edit still isn't possible; re-run-from-here is the fork-based answer)
- [session-provenance.md](session-provenance.md) — the "Spawned by" link back to the original
- [asides.md](asides.md) — the other fork mechanism (a one-off side question against the same session)
- [start-a-new-session.md](start-a-new-session.md) — a fully fresh session with no carried context
