Skip to main content
This page covers debugging helpers for streaming output, especially when a provider mixes reasoning into normal text.

Runtime debug overrides

Use /debug in chat to set runtime-only config overrides (memory, not disk). /debug is disabled by default; enable with commands.debug: true. This is handy when you need to toggle obscure settings without editing fluffbuzz.json. Examples:
/debug reset clears all overrides and returns to the on-disk config.

Session trace output

Use /trace when you want to see plugin-owned trace/debug lines in one session without turning on full verbose mode. Examples:
Use /trace for plugin diagnostics such as Active Memory debug summaries. Keep using /verbose for normal verbose status/tool output, and keep using /debug for runtime-only config overrides.

Temporary CLI debug timing

FluffBuzz keeps src/cli/debug-timing.ts as a small helper for local investigation. It is intentionally not wired into CLI startup, command routing, or any command by default. Use it only while debugging a slow command, then remove the import and spans before landing the behavior change. Use this when a command is slow and you need a quick phase breakdown before deciding whether to use a CPU profiler or fix a specific subsystem.

Add temporary spans

Add the helper near the code you are investigating. For example, while debugging fluffbuzz models list, a temporary patch in src/commands/models/list.list-command.ts might look like this:
Guidelines:
  • Prefix temporary phase names with debug:.
  • Add only a few spans around suspected slow sections.
  • Prefer broad phases such as registry, auth_store, or rows over helper names.
  • Use time() for synchronous work and timeAsync() for promises.
  • Keep stdout clean. The helper writes to stderr, so command JSON output stays parseable.
  • Remove temporary imports and spans before opening the final fix PR.
  • Include the timing output or a short summary in the issue or PR that explains the optimization.

Run with readable output

Readable mode is best for live debugging:
Example output from a temporary models list investigation:
Findings from this output: Those findings are enough to guide the next patch without keeping timing code in production paths.

Run with JSON output

Use JSON mode when you want to save or compare timing data:
Each stderr line is one JSON object:

Clean up before landing

Before opening the final PR:
The command should return no temporary instrumentation call sites unless the PR is explicitly adding a permanent diagnostics surface. For normal performance fixes, keep only the behavior change, tests, and a short note with the timing evidence. For deeper CPU hotspots, use Node profiling (--cpu-prof) or an external profiler instead of adding more timing wrappers.

Gateway watch mode

For fast iteration, run the gateway under the file watcher:
This maps to:
The watcher restarts on build-relevant files under src/, extension source files, extension package.json and fluffbuzz.plugin.json metadata, tsconfig.json, package.json, and tsdown.config.ts. Extension metadata changes restart the gateway without forcing a tsdown rebuild; source and config changes still rebuild dist first. Add any gateway CLI flags after gateway:watch and they will be passed through on each restart. Re-running the same watch command for the same repo/flag set now replaces the older watcher instead of leaving duplicate watcher parents behind.

Dev profile + dev gateway (—dev)

Use the dev profile to isolate state and spin up a safe, disposable setup for debugging. There are two --dev flags:
  • Global --dev (profile): isolates state under ~/.fluffbuzz-dev and defaults the gateway port to 19001 (derived ports shift with it).
  • gateway --dev: tells the Gateway to auto-create a default config + workspace when missing (and skip BOOTSTRAP.md).
Recommended flow (dev profile + dev bootstrap):
If you don’t have a global install yet, run the CLI via pnpm fluffbuzz .... What this does:
  1. Profile isolation (global --dev)
    • FLUFFBUZZ_PROFILE=dev
    • FLUFFBUZZ_STATE_DIR=~/.fluffbuzz-dev
    • FLUFFBUZZ_CONFIG_PATH=~/.fluffbuzz-dev/fluffbuzz.json
    • FLUFFBUZZ_GATEWAY_PORT=19001 (browser/canvas shift accordingly)
  2. Dev bootstrap (gateway --dev)
    • Writes a minimal config if missing (gateway.mode=local, bind loopback).
    • Sets agent.workspace to the dev workspace.
    • Sets agent.skipBootstrap=true (no BOOTSTRAP.md).
    • Seeds the workspace files if missing: AGENTS.md, SOUL.md, TOOLS.md, IDENTITY.md, USER.md, HEARTBEAT.md.
    • Default identity: C3‑PO (protocol droid).
    • Skips channel providers in dev mode (FLUFFBUZZ_SKIP_CHANNELS=1).
Reset flow (fresh start):
Note: --dev is a global profile flag and gets eaten by some runners. If you need to spell it out, use the env var form:
--reset wipes config, credentials, sessions, and the dev workspace (using trash, not rm), then recreates the default dev setup. Tip: if a non‑dev gateway is already running (launchd/systemd), stop it first:

Raw stream logging (FluffBuzz)

FluffBuzz can log the raw assistant stream before any filtering/formatting. This is the best way to see whether reasoning is arriving as plain text deltas (or as separate thinking blocks). Enable it via CLI:
Optional path override:
Equivalent env vars:
Default file: ~/.fluffbuzz/logs/raw-stream.jsonl

Raw chunk logging (pi-mono)

To capture raw OpenAI-compat chunks before they are parsed into blocks, pi-mono exposes a separate logger:
Optional path:
Default file: ~/.pi-mono/logs/raw-openai-completions.jsonl
Note: this is only emitted by processes using pi-mono’s openai-completions provider.

Safety notes

  • Raw stream logs can include full prompts, tool output, and user data.
  • Keep logs local and delete them after debugging.
  • If you share logs, scrub secrets and PII first.