Reference

Troubleshooting

Diagnose a missing binary, model, provider key, memory key, MCP handshake, or compiler failure.

Updated Nov 13, 20264 min readv0.3.0-beta
On this page10 sections

Failures usually surface as a subsystem refusal, not a crash. This page maps documented symptoms to a check and a fix.

Start with doctor

Shell
sofuu doctor

doctor prints sections for QTSQ linkage, the brain file, the resolved context window, config and API key state, protocol probes, and capabilities. It exits non-zero on failure and treats a store held by another process as busy, not broken. doctor --json emits the same entries as structured output.

Quick map

SymptomCheckFix
Installer stops at platform detectionuname -s, uname -mPublished platform or source build.
Installer stops at checksumsha256sum -c / shasum -a 256 -cRe-download; do not bypass verification.
Local model does not loadFile format, OS librariesSupported file, provider plugin, or remote endpoint.
E_DIM on recallDimension in doctor outputReopen with the store's space and dimension.
MCP connect failssofuu mcp test "<cmd>"Fix the command, transport, or secret.
Compile refuses a profile or base--profile, --baseValid profile name, existing base binary.

Install

Unsupported platform. The installer maps uname -m to arm64 or x86_64 and uname -s to darwin or linux, and exits otherwise. Published builds cover macOS arm64 and Linux x86_64 / arm64; other targets need a source build.

Checksum or signature failure. The script verifies the archive and the extracted binary, and refuses to run without sha256sum or shasum. A mismatch means a corrupted or substituted download; fetch it again.

Missing from PATH. The install lands in /usr/local/bin when writable, otherwise ~/.local/bin when it is on PATH. Start a new shell, or set SOFUU_INSTALL_DIR and add it to PATH.

Provider configuration

No API key. doctor warns that the active provider has no key and that providers will answer 401. Keys live in ~/.sofuu/config.json, with OPENAI_API_KEY and ANTHROPIC_API_KEY as fallback.

Wrong base URL. An OpenAI-compatible endpoint needs the version path, for example http://127.0.0.1:11434/v1. Check the port and the path; doctor prints the endpoint it resolved. Set both with /model and /provider.

Local inference (preview)

The built-in GGUF and SafeTensors engine is an experimental preview: loading depends on the model file and the OS libraries present. Confirm the extension and that the path resolves from the working directory. If it still fails, use the llamacpp provider plugin or a remote endpoint.

Memory

Wrong dimension (E_DIM). memory.open(path, vecDim) fixes the dimension, and every stored or queried vector must match. sofuu.ai.embed() produces 64 dimensions; sofuu.ai.embedLocal() produces 768. doctor prints the store's declared space and dimension.

Wrong key. A store from another machine, or one whose ~/.sofuu/brain.key was lost, refuses with a message naming the file as a container this key cannot open. Restore the key file or set SOFUU_BRAIN_KEY to its exact 64-hex-character value; without a backup there is no recovery.

Plaintext mode. { plaintext: true } is a deliberate zero-KDF open, not a recovery path. doctor reports whether the brain is encrypted under the machine key or still on the legacy password. Start a new file rather than toggling the flag on an existing store.

Store busy (E_LOCKED). One writer at a time. A sofuu serve process or a second agent holding the brain produces this refusal; doctor reports it as a skipped check. Close the other process.

MCP

Stdio command not found. The client spawns that command. sofuu mcp test "<cmd>" reports the handshake, protocol version, and tool count; confirm its interpreter (npx, for example) is on PATH. An unresolvable {"secret":"NAME"} refuses the connect.

Wrong transport. A bare {url} means Streamable HTTP. A legacy HTTP+SSE endpoint must request transport: 'sse'; the client does not infer it.

Session expiry or a lost reply. Streamable HTTP carries an Mcp-Session-Id and deletes it on disconnect: reconnect and re-list tools. A request queued for reconnection never ran; one already dispatched that loses its reply is outcome-unknown, so verify the effect before retrying.

Compiler

Profile. --profile accepts lean, full, and micro (also mcp). Flags select one base; the last wins, and an unknown name is rejected. The micro base omits the agent loop and inference.

Missing base. --base <path> must be an existing executable; a missing path fails instead of falling back. A cross-target build appends to a base built for that target, so that build's toolchain must exist.

Kaze mismatch. The embedded engine reports 0.1 and writes bytecode format 2; standalone Kaze is 1.0 with format 4. Bytecode is not interchangeable, and a compiled Kaze agent refuses an incompatible runtime base.

Runs and resume

sofuu logs lists runs and status; sofuu logs --last-error prints the post-mortem card: failed step, code, context snapshot, and a recovery hint. sofuu resume <id> continues from the newest valid checkpoint; a redacted or truncated one is refused, and --step=N targets a step.

What to include in a bug report

  • The full sofuu version line: version, commit revision, QuickJS version, architecture.
  • Platform and install path, plus sofuu doctor --json with keys and private paths redacted.
  • The smallest reproduction: the file, the exact command, and the exit status.
  • For model failures, the file format — not the weights; for MCP failures, the server command or URL, transport, and negotiated protocol version.

File issues at github.com/sofuu-runtime/sofuu/issues.