---
title: Shared chat engine for non-Claude sessions (unified turn engine)
---
# Shared chat engine for non-Claude sessions

## What it is

### What it does

**Shared chat engine for non-Claude sessions** makes Codex, Pi, Gemini, OpenClaw and
the other non-Claude engines store and display a conversation the **same way Claude
does**, so their chats look consistent. It lives at **Settings → Chat → "Shared chat
engine for non-Claude sessions"** and is **on by default**.

The most visible effect: when one of these engines continues a turn **on its own** (a
"self-resume" — for example, after its own background tool finishes and the app
re-invokes it), its new reply now opens a **fresh chat message** instead of being
merged onto — and hiding — the previous reply. That hidden-final-message glitch, and
the older "the dot stays amber while the engine is still typing" glitch, are what this
fixes.

Claude is the gold standard the others are being brought up to. Claude itself is **not
changed by this toggle yet** — it moves onto the same shared engine last, behind the
same switch, so its hard-won behavior can always be restored instantly.

## Where to find it

**Settings → Chat** — the toggle **Shared chat engine for non-Claude sessions**.

## How it behaves

### Why it exists

Each non-Claude engine used to run its own stripped-down copy of Claude's turn logic,
which is why their chats rendered rougher and kept hitting the same class of bug. The
shared engine routes them all through ONE "seal a turn" step that writes the same turn
information Claude writes — so a fix lands once, for every engine.

### Turning it off (rollback)

Two ways:

1. **Settings → Chat** — flip the toggle **off**. That reverts the non-Claude engines to
   their older, separate behavior instantly (saved per user).
2. **`AMC_DISABLE_UNIFIED_TURN_ENGINE=1`** — an environment kill switch that forces it
   off for the whole app no matter what the setting says (the absolute override).

With it off, non-Claude chats behave byte-for-byte as they did before this feature.

## For agents

### Under the hood (for agents with repo access)

- Setting `unifiedTurnEngineEnabled` (default `true`). `getSettings()` does not merge
  defaults, so the `?? true` fallback in `unified-turn-engine-flag.ts` is the effective
  default for everyone who hasn't explicitly toggled it off.
- The shared "seal a turn" leaf is `external-turn-finalize.ts` (`finalizeExternalTurnRow`
  + `buildExternalTurnMetadata`). The self-resume "new turn" marker
  (`metadata.turnBoundary`) is armed in `maybeResumeOnStream` — on a `needs_you` bounce
  ONLY, never a `stalled` mid-turn bounce — in `base-external-session-manager.ts`.
- Invariants the-unified-turn-path-is-a-kill-switch–no-new-hardcoded-provider-branch in `provider-registry-contract.md`; program tracker
  `docs/plans/2026-06-11-unified-turn-lifecycle-design.md`.

## Related

Switching between AI providers explains how a non-Claude engine is chosen in the first place; this page covers how its conversation is then stored and displayed. The provider's own CLI keeps its own transcript.
