* feat(protocol): add session companion schemas * feat(gateway): add session companion service * feat(gateway): expose session companion rpc * fix(gateway): harden companion runtime limits * test(gateway): fix companion type assertions * test(gateway): align companion test target * feat(ui): replace observer HUD and side chat with session rail * docs: session rail companion for control ui * test(ui): align session rail client mock * fix(ui): drop stale chat search import * fix: satisfy session companion lint contracts * refactor(gateway): isolate companion state contract * fix(ui): keep session rail reachable while idle * fix(agents): clamp derived openai prompt cache keys at boundary * fix(ai): clamp chatgpt responses session_id affinity header * fix(ci): align session companion branch gates * fix(ui): require run id for sessionless terminal chat events * fix(agents): scope internal run events to transcript * chore: revert changelog edit (release generation owns changelog)
5.5 KiB
summary, read_when, title
| summary | read_when | title | ||
|---|---|---|---|---|
| Ephemeral side questions with /btw |
|
BTW side questions |
/btw (alias /side) asks a quick side question about the current
session without adding it to conversation history. It is modeled after
Claude Code's /btw, adapted to OpenClaw's Gateway and multi-channel
architecture.
In the Control UI, both commands route to the session rail companion instead of the detached BTW runner. The companion keeps a bounded multi-turn thread in Gateway memory and can use read-only session-history/search and workspace-read tools. TUI and external-channel behavior is unchanged.
/btw what changed?
/side what does this error mean?
What it does
- Snapshots the current session as background context (including any in-flight main-run prompt).
- Runs a separate, one-shot side query telling the model to answer only the side question and not resume or steer the main task.
- Delivers the answer as a live side result, not a normal assistant message.
- Never writes the question or answer to session history or
chat.history.
The main run, if one is active, is left untouched.
For Codex harness sessions, BTW forks the active Codex app-server thread into
an ephemeral child thread instead of running a separate provider call. This
keeps Codex OAuth and native tool/thread behavior intact, and the forked
thread keeps the parent thread's current approval policy, sandbox, and native
tool surface. The forked thread gets a boundary prompt telling the model that
everything before it is inherited reference context, not active instructions,
and that only messages after the boundary are live. /btw requires an
existing Codex thread; send a normal message first.
For CLI runtime aliases, BTW invokes the owning CLI backend in one-shot side-question mode: it seeds sanitized conversation context into a fresh CLI invocation with tool bundling and reusable session state disabled, and adds any no-resume/no-tools flags the backend supports. Direct (non-CLI) runtimes use a direct one-shot provider call instead.
What it does not do
/btw does not create a durable session, continue the unfinished main task,
or persist question/answer data to transcript history. Detached BTW results do
not survive a reload. The Control UI companion can rehydrate its in-memory
thread after a reload, but the thread is cleared by a session reset, Gateway
restart, idle expiry, or the rail's clear button.
Delivery model
Normal assistant chat uses the Gateway chat event. Detached BTW uses a
separate chat.side_result event so clients cannot mistake it for regular
conversation history. The Control UI does not consume that event; it calls the
session companion RPCs and renders their bounded exchange state in the rail.
Surface behavior
| Surface | Behavior |
|---|---|
| TUI | Rendered inline in the chat log, visibly distinct from a normal reply, dismissible with Enter or Esc. |
| External channels | Delivered as a clearly labeled one-off reply (Telegram, WhatsApp, Discord have no local ephemeral overlay). |
| Control UI / web | Routes /btw and /side to the expanded session rail companion. The read-only thread is keyed by session, rehydrates from Gateway memory, and can be cleared with the trash button. Esc collapses the rail. |
Selection popup (Control UI)
Highlighting text inside a chat message in the Control UI opens a small selection popup with two actions:
- More details immediately asks the session rail companion to explain the highlighted text in the context of the current session.
- Ask in side chat opens the rail and pre-fills its composer with a quoted draft so you can type your own question about the selection.
Both actions follow normal /btw semantics: the question and answer stay out
of session history and the main run is left untouched.
When to use it
Use /btw for a quick clarification, a factual side answer while a long run
is still in progress, or a temporary answer that should not enter future
session context.
/btw what file are we editing?
/btw summarize the current task in one sentence
/btw what is 17 * 19?
For anything you want to become part of the session's future working context, ask normally in the main session instead.