Errors

Every error code, and the mistakes that cause the common ones.

The library throws CoreError, with a code you can switch on. UnsupportedOperation is a CoreError with the code unsupported_operation.

import { CoreError } from "@supermux/core"

try {
  await core.sessions.create({ id, agent, cwd })
} catch (error) {
  if (error instanceof CoreError && error.code === "session_exists") { /* pick a new id */ }
  else throw error
}

Option checks are plain TypeErrors instead: everything supermux(), createCore() and the driver factories validate, and interrupt() or close() without a mode. Errors a driver throws itself, like a setup timeout from Claude Code or Codex, are passed on unchanged.

Codes

Input and options

CodeWhen
invalid_optionsAn option of createCore(), the accounts or a vault is invalid.
invalid_inputAn argument is wrong: an unknown configuration key, an answer of the wrong kind, an optionId the request doesn't have.
invalid_session_idA session id isn't letters, digits, _ and -, up to 128.
invalid_workdircwd isn't an existing absolute folder, or contains (or sits inside) the state directory.
invalid_auth_profileThe profile doesn't exist, or belongs to another agent.
unknown_agentNo agent with that id is registered.

Sessions

CodeWhen
session_existsA session with that id is already saved. Records stay after close; only forget removes them.
session_busyThe session is occupied: not idle for configure or fork, a whenBusy: "reject" send, or another operation on its id is running.
session_not_foundNo saved session has that id.
session_closedThe Session is closed.
session_failedThe session's runtime failed. Close it and resume it.
session_not_runningsteer() with no turn to steer.
queue_fullThe queue already holds limits.maxPending messages.
idempotency_conflictAn idempotencyKey came back with different input.
request_not_foundNo pending request has that id.
keeper_unconfirmedA keeper didn't answer, so the core couldn't tell if its agent still runs.
resume_identity_changed, session_identityA resume came back on a different conversation than the saved one.
fork_identity_unchangedThe agent reused the conversation instead of forking it.
activity_overflowToo much background activity at once; the session fails.
core_closedA new call after the core began closing.
unsupported_operationThe agent can't do that. The message says which.

State directory

CodeWhen
state_lockedAnother process holds the state directory. A lock left by a process that's gone is reclaimed.
state_unsafeA symbolic link, or a file of another user, where the core reads or writes.
invalid_session_recordA saved record can't be read.
store_closedThe store was used after the core released it.

Accounts

CodeWhen
unknown_accountNo account has that id.
account_existsThat id exists, or the same rotating login is already held by another account.
account_expiredA Codex token account expired and can't be refreshed.
account_secret_missingThe account's secret isn't in the vault.
account_home_conflictAn account home already exists and isn't empty.
account_refresh_failedRefreshing a Codex token failed.
account_identity_mismatchA guided login signed in as another email than asked for.
login_failed, login_timeout, login_cancelledA guided login failed, ran out of time, or was cancelled.
invalid_account_id, invalid_account_recordA bad account id, or an unreadable accounts file.

Context, tools and subagents

CodeWhen
invalid_contextA malformed context or patch. Instructions can't change after the session is created.
context_unsupportedThe agent can't apply an item of the context, for example skills on Cursor.
missing_mcp_serversA session names an MCP server that isn't registered with this core.
mcp_socket_in_useAnother live core owns this state directory's MCP socket.
subagent_not_found, subagent_unavailableAn unknown subagent, or an action the agent can't do right now.

Drivers and host

CodeWhen
setup_timeoutAn ACP agent didn't start within setupTimeoutMs.
protocol_version, auth_methodAn ACP agent speaks another protocol version, or doesn't offer that sign-in method.
connection_closedThe connection to an ACP agent closed.
abortedAn operation was cut short because the core was closing.
conversation_lostAntigravity no longer has the conversation. Start a new session.
runtime_closed, busyA runtime was used after it closed, or an ACP agent got a prompt while one is running.
already_live, host_closingFrom the Host layer.

Common mistakes

You seeWhyFix
invalid_workdir running the QuickstartYou ran it from your home folder, and the state directory is under it.Run it from a project folder.
session_existsYou reused an id from an earlier run.Use a new id, or forget() the old one.
unsupported_operation on configuration: { model }Only Codex, Grok Build and Antigravity switch model per session.Set model for the agent in supermux().
A turn that never endsA permission request or question is waiting.Answer it, refuse it, or interrupt.
invalid_input "optionId is not among the request options"A fixed option id; ACP agents use their own.Match options by kind.
Messages don't run after Stopinterrupt() pauses the queue.Call session.pending.continue().
core.sessions.live(id) is undefinedIt starts nothing.Use core.sessions.resume(id).
Agents still running after your script endedNo core.close({ agents: "shutdown" }).Close with shutdown, or sessions.close(id, { mode: "shutdown" }).
forget() fails with session_busyThe agent still runs behind its keeper.sessions.close(id, { mode: "shutdown" }) first.
state_lockedAnother process uses the state directory.One process per state directory.

On this page