When to use a harness
Register an agent harness when a model family has its own native session runtime and the normal FluffBuzz provider transport is the wrong abstraction. Examples:- a native coding-agent server that owns threads and compaction
- a local CLI or daemon that must stream native plan/reasoning/tool events
- a model runtime that needs its own resume id in addition to the FluffBuzz session transcript
What core still owns
Before a harness is selected, FluffBuzz has already resolved:- provider and model
- runtime auth state
- thinking level and context budget
- the FluffBuzz transcript/session file
- workspace, sandbox, and tool policy
- channel reply callbacks and streaming callbacks
- model fallback and live model switching policy
Register a harness
Import:fluffbuzz/plugin-sdk/agent-harness
Selection policy
FluffBuzz chooses a harness after provider/model resolution:- An existing session’s recorded harness id wins, so config/env changes do not hot-switch that transcript to another runtime.
FLUFFBUZZ_AGENT_RUNTIME=<id>forces a registered harness with that id for sessions that are not already pinned.FLUFFBUZZ_AGENT_RUNTIME=piforces the built-in PI harness.FLUFFBUZZ_AGENT_RUNTIME=autoasks registered harnesses if they support the resolved provider/model.- If no registered harness matches, FluffBuzz uses PI unless PI fallback is disabled.
auto mode, PI fallback is
only used when no registered plugin harness supports the resolved
provider/model. Once a plugin harness has claimed a run, FluffBuzz does not
replay that same turn through PI because that can change auth/runtime semantics
or duplicate side effects.
The selected harness id is persisted with the session id after an embedded run.
Legacy sessions created before harness pins are treated as PI-pinned once they
have transcript history. Use a new/reset session when changing between PI and a
native plugin harness. /status shows non-default harness ids such as codex
next to Fast; PI stays hidden because it is the default compatibility path.
If the selected harness is surprising, enable agents/harness debug logging and
inspect the gateway’s structured agent harness selected record. It includes
the selected harness id, selection reason, runtime/fallback policy, and, in
auto mode, each plugin candidate’s support result.
The bundled Codex plugin registers codex as its harness id. Core treats that
as an ordinary plugin harness id; Codex-specific aliases belong in the plugin
or operator config, not in the shared runtime selector.
Provider plus harness pairing
Most harnesses should also register a provider. The provider makes model refs, auth status, model metadata, and/model selection visible to the rest of
FluffBuzz. The harness then claims that provider in supports(...).
The bundled Codex plugin follows this pattern:
- provider id:
codex - user model refs:
openai/gpt-5.5plusembeddedHarness.runtime: "codex"; legacycodex/gpt-*refs remain accepted for compatibility - harness id:
codex - auth: synthetic provider availability, because the Codex harness owns the native Codex login/session
- app-server request: FluffBuzz sends the bare model id to Codex and lets the harness talk to the native app-server protocol
openai/gpt-* refs continue to use the
normal FluffBuzz provider path unless you force the Codex harness with
embeddedHarness.runtime: "codex". Older codex/gpt-* refs still select the
Codex provider and harness for compatibility.
For operator setup, model prefix examples, and Codex-only configs, see
Codex Harness.
FluffBuzz requires Codex app-server 0.118.0 or newer. The Codex plugin checks
the app-server initialize handshake and blocks older or unversioned servers so
FluffBuzz only runs against the protocol surface it has been tested with.
Codex app-server tool-result middleware
Bundled plugins can also attach Codex app-server-specifictool_result
middleware through api.registerCodexAppServerExtensionFactory(...) when their
manifest declares contracts.embeddedExtensionFactories: ["codex-app-server"].
This is the trusted-plugin seam for async tool-result transforms that need to
run inside the native Codex harness before the tool output is projected back
into the FluffBuzz transcript.
Native Codex harness mode
The bundledcodex harness is the native Codex mode for embedded FluffBuzz
agent turns. Enable the bundled codex plugin first, and include codex in
plugins.allow if your config uses a restrictive allowlist. Native app-server
configs should use openai/gpt-* with embeddedHarness.runtime: "codex".
Use openai-codex/* for Codex OAuth through PI instead. Legacy codex/*
model refs remain compatibility aliases for the native harness.
When this mode runs, Codex owns the native thread id, resume behavior,
compaction, and app-server execution. FluffBuzz still owns the chat channel,
visible transcript mirror, tool policy, approvals, media delivery, and session
selection. Use embeddedHarness.runtime: "codex" with
embeddedHarness.fallback: "none" when you need to prove that only the Codex
app-server path can claim the run. That config is only a selection guard:
Codex app-server failures already fail directly instead of retrying through PI.
Disable PI fallback
By default, FluffBuzz runs embedded agents withagents.defaults.embeddedHarness
set to { runtime: "auto", fallback: "pi" }. In auto mode, registered plugin
harnesses can claim a provider/model pair. If none match, FluffBuzz falls back
to PI.
Set fallback: "none" when you need missing plugin harness selection to fail
instead of using PI. Selected plugin harness failures already fail hard. This
does not block an explicit runtime: "pi" or FLUFFBUZZ_AGENT_RUNTIME=pi.
For Codex-only embedded runs:
runtime: "auto" and disable
the fallback:
FLUFFBUZZ_AGENT_RUNTIME still overrides the configured runtime. Use
FLUFFBUZZ_AGENT_HARNESS_FALLBACK=none to disable PI fallback from the
environment.
Native sessions and transcript mirror
A harness may keep a native session id, thread id, or daemon-side resume token. Keep that binding explicitly associated with the FluffBuzz session, and keep mirroring user-visible assistant/tool output into the FluffBuzz transcript. The FluffBuzz transcript remains the compatibility layer for:- channel-visible session history
- transcript search and indexing
- switching back to the built-in PI harness on a later turn
- generic
/new,/reset, and session deletion behavior
reset(...) so FluffBuzz can
clear it when the owning FluffBuzz session is reset.
Tool and media results
Core constructs the FluffBuzz tool list and passes it into the prepared attempt. When a harness executes a dynamic tool call, return the tool result back through the harness result shape instead of sending channel media yourself. This keeps text, image, video, music, TTS, approval, and messaging-tool outputs on the same delivery path as PI-backed runs.Current limitations
- The public import path is generic, but some attempt/result type aliases still
carry
Pinames for compatibility. - Third-party harness installation is experimental. Prefer provider plugins until you need a native session runtime.
- Harness switching is supported across turns. Do not switch harnesses in the middle of a turn after native tools, approvals, assistant text, or message sends have started.