@stigmer/runner
v0.4.0
Published
Embeddable Temporal worker that runs Stigmer's agent sessions — handles agent execution and MCP server management
Maintainers
Readme
@stigmer/runner
Embeddable Temporal worker that runs Stigmer's agent sessions: it drives the Stigmer and Claude harnesses, orchestrates MCP servers, and reports status and artifacts back to the Stigmer backend.
It is the single runtime behind three surfaces:
- the CLI daemon (
stigmer up) running agents locally, - cloud deployments (Kubernetes / sandbox) running managed executions, and
- the desktop app, which embeds the runner as a subprocess to run sessions on the user's own machine.
This document is the operational reference for the package: how it runs, what it needs, and every environment variable that configures it. You should not need to read config.ts or main.ts to operate or embed the runner.
You usually don't start the runner by hand.
stigmer upruns it for local agent execution, and the desktop app embeds it automatically. Invoke thestigmer-runnerbinary directly only for advanced operation or embedding — which is what this document covers.
The deep manager-mode IPC protocol (see Manager mode), the desktop-vs-web embedding walkthrough, and the SDK-level
RunnerAdapter/executionTargetsurfaces are documented separately — see Related documentation.
Install and build
The runner is a workspace package in the Stigmer monorepo. Build it from the repo root:
make build-runnerThis runs npm run build in backend/services/runner (tsc -p tsconfig.build.json) and then writes a build fingerprint (see The stale-build guard). The compiled output lands in dist/, with a stigmer-runner CLI entry point at dist/main.js.
Requires a Node.js whose built-in node:sqlite is available unflagged — >= 22.13 in the 22.x line, and >= 23.4 after that (23.0–23.3 lack it). The durable local checkpointer depends on it, and the runner probes for it at boot (src/preflight.ts), refusing to start with an actionable error rather than crashing on the import.
The slim embedding artifact
The plain dist/ resolves its dependencies from node_modules at runtime — ~508 MB unpacked, which is unshippable inside a desktop app (#170). For embedding, build the slim artifact:
make build-runner-slim # or: npm run build:slimThis produces dist-slim/: a tree-shaken esbuild bundle of the whole runner (main.js), and a staged node_modules containing only the packages that genuinely cannot be bundled (the platform-pruned Temporal native bridge and the few packages that ship native code). node dist-slim/main.js accepts the same modes, environment variables, and IPC protocol as dist/main.js. It also holds attach/main.js, the attach entry (below) bundled on its own, which starts the main.js beside it with the same Node. See scripts/bundle-slim.mjs for the full layout, scripts/verify-slim-artifact.mjs for the boot verification that gates releases, and the embedding guide for how apps stage it.
Why the slim bundle is CommonJS, not ESM. The runner loads its heavy modules lazily (
@connectrpc/connect-node, LangChain, the activity factories, via dynamicimport()) after the harnesses boot. An ESM esbuild bundle hoists every externalimportto the top of the output and evaluates them before any code runs; a CJS bundle preserves the source's lazy evaluation order (the module-order regression of #170 was an ESM bundle). The metapackage.jsondeliberately omits"type": "module"sonode main.jsruns as CommonJS — do not add it back, and do not flipformatto"esm"inbundle-slim.mjs(see its header). The authenticated boot check inverify-slim-artifact.mjsboots the artifact as a release would.
The slim build is also published to npm as @stigmer/runner-slim (with per-platform @stigmer/runner-slim-<platform> support packages) alongside the full @stigmer/runner package on every release.
The sandbox image (Dockerfile.sandbox) ships the same directory as its runner layer: dist-slim/ at /runner/dist, started by the layer's own Node at /runner/bin/node (the repository's .nvmrc version), on a base image that holds the agent's tools. The server's drivers launch it with the command in backend/services/stigmer-server/src/sandbox/runner-launch.ts: /runner/bin/start (layer/start.sh), which refuses a base image the runner cannot run on (no glibc, not root, no bash, git or the standard text tools) in one line that names the contract, refuses a layer whose /runner/RELEASE names another release than the server's STIGMER_SERVER_RELEASE (stigmer/stigmer#1831), clears NODE_OPTIONS and NODE_PATH, and execs that Node. The image's release lane runs verify-slim-artifact.mjs inside the built image, through the start script, before any tag but main-<sha> names it, and publishes the layer alone (ghcr.io/stigmer/runner-layer, amd64 and arm64) after booting it on Ubuntu and seeing it refuse Alpine; deploy/runner-layer/Dockerfile adds it to an operator's own base (the self-hosting guide's "Bring your own base image").
Run modes
The runner has two run modes, selected at boot by one environment variable (src/main.ts): STIGMER_RUNNER_MODE=manager selects manager mode; otherwise the runner is static. Do not confuse the run mode (process topology) with the execution location (MODE=local|cloud) or the transport (STIGMER_PROXY_ENDPOINT) — those are independent axes covered in Execution location vs transport.
| Run mode | Selector | Topology | Used by |
|----------|----------|----------|---------|
| Static | STIGMER_RUNNER_MODE unset or not manager (default) | One Worker polling one task queue; blocks until shutdown | CLI daemon, cloud deployments |
| Manager | STIGMER_RUNNER_MODE=manager | Shared Temporal connection; dynamic per-session / per-execution Workers; stdin/stdout JSON IPC | Desktop app |
Static mode
Static mode creates a single Temporal Worker that polls one task queue and runs until it receives SIGTERM / SIGINT. This is the right mode when the set of work is fixed at startup (a daemon or a pod dedicated to a queue).
On a signal it drains the worker: every turn in flight yields at its engine's next step boundary within the drain grace (STIGMER_DRAIN_GRACE_MS), so a step that was running finishes, and the workflow continues the turn on the next runner from where it was. A second signal stops the turns in flight at once; they continue too, and the step each was running is run again. Then it releases the harnesses, closes its Temporal connection and flushes telemetry, and the process exits on its own, normally within milliseconds of the drain. As the CLI entry (stigmer-runner), a process still alive 5 s after that is made to exit, with one log line naming the resources that kept it alive (src/exit-backstop.ts). That line means a leaked handle to fix, not a slow shutdown to tune.
As a library:
import { createStigmerRunner } from "@stigmer/runner";
const runner = await createStigmerRunner({
taskQueue: "stigmer_runner",
temporalAddress: "localhost:7233",
stigmerEndpoint: "http://localhost:7234",
});
process.on("SIGTERM", () => runner.shutdown());
await runner.start(); // blocks until shutdownThe stigmer-runner CLI runs this mode by default, reading its configuration from the environment.
Manager mode
Manager mode keeps a single shared Temporal connection and a single set of activities, then spins Workers up and down on demand — one per session (session:{sessionId}). This is what the desktop app needs: it adds and removes Workers as the user opens and closes sessions, without restarting the process.
As a library:
import { createStigmerRunnerManager } from "@stigmer/runner";
const manager = await createStigmerRunnerManager({
temporalAddress: "localhost:7233",
stigmerEndpoint: "http://localhost:7234",
});
await manager.addSession("ses_abc123");
// ... later
await manager.removeSession("ses_abc123");
await manager.shutdown();As a subprocess, the host launches stigmer-runner with STIGMER_RUNNER_MODE=manager and drives it over a line-delimited JSON protocol on stdin/stdout (addSession, removeSession, updateToken, shutdown). The protocol surface is intentionally small and is specified in detail elsewhere — see Related documentation.
The attach entry (a sandbox that waits to be attached)
dist/attach/main.js is a second entry, for sandbox platforms that snapshot a started sandbox once and start every later sandbox from that snapshot (Agent Substrate's golden snapshot). It is not a run mode of the runner: it starts a small waiter (src/attach/waiter.ts) that loads none of the runner's machinery (Node built-ins, the runner's secret-name list and claim reader, and the codecs' connection subpath: 13 modules, pinned by src/attach/__tests__/import-graph.test.ts and scripts/verify-attach-boot.mjs, and in the slim artifact by scripts/bundle-slim.mjs's check of the bundle's inputs, one rule in scripts/attach-graph-rule.mjs), answers GET /readyz, and waits for one POST /attach carrying the task queue to serve and the runner's secrets. The first accepted push starts the runner, dist/main.js in static mode, with the sandbox's environment plus that queue and those secrets, exactly the environment a sandbox pod gives it at start; the waiter then supervises it as a restart policy would. A later push for the same queue (a driver pushes on every wakeup) may only rotate STIGMER_TOKEN, for a token of the same token_type and, when the first named a session, the same session; every other secret must be the first push's. A push that arrives while a crashed runner waits out its restart delay starts it at once. A restart uses the latest pushed token, not the one the live runner renewed, so a composition whose tokens are renewed also pushes the renewed token while the sandbox runs. Every refusal answers {"error", "code"}, and the code is stable (PushRefusalCode in src/attach/push.ts): secrets_changed, for one, tells a driver that the runner must start fresh to take new secrets. A snapshot therefore never holds a runner or a credential. It must not: every clone of one snapshot shares the snapshotted process's random state, so a runner in the snapshot would give unrelated sessions the same keys and identifiers (the waiter's header has the measurement).
A push is accepted only for the queue whose sandbox name (sbx-<code>-<12 hex>, the server's own derivation) is this sandbox's, may set only the runner's secret variables, and must carry an unexpired JWT or no token (src/attach/push.ts). Who can reach the waiter is the driver's to restrict: on Agent Substrate, its router reaches every actor, so no actor's egress policy may reach the router. The sandbox's own processes reach it over loopback too, which is why a later push can change nothing but the token. The first accepted push is not authenticated and fixes the sandbox's queue and secrets for its life: a sandbox whose first push did not come from its driver cannot be repaired, only replaced. Non-secret connection settings (the Temporal server's CA, a client certificate, the server name) belong in the sandbox's own environment, not in a push. The waiter holds port 80 by default; an agent's own servers inside the sandbox use other ports.
SIGTERM does not stop the attach entry; SIGINT does. On Agent Substrate the entry is the actor's main process, and SIGTERM is how a worker that is rolling, scaling down or draining asks for its actors to be suspended: the driver then has 30 minutes to suspend the sandbox, and a process that has exited cannot be suspended, so the sandbox would crash and lose every file written since it last slept. So the entry logs SIGTERM once and keeps serving pushes and supervising the runner, and a turn in flight runs on, until the server suspends the sandbox durably (the server's Substrate sweep). A platform that sends SIGTERM and never suspends ends the entry at its grace period.
The agent host (where the engines run)
In every run mode, and in a library embedding, the runner runs every harness's engine (the Stigmer one and Claude's) in a second process, the agent host: the runner's own entry started as main.js agent-host, on the same Node, with a private pipe on file descriptor 3 (src/agent-host/). The runner keeps the turn runtime, its credentials and all its control-plane traffic; the host runs the engines and every process an agent's turn starts there (its shell, its hooks, its MCP servers). The runner's own process loads no engine's SDK. The two meet at the harness adapter contract (src/harness/types.ts): the runner's remote adapter (src/agent-host/remote-adapter.ts) forwards each turn to the host and treats everything the host sends back as untrusted, and which harnesses are hosted is one set in src/harness-adapters.ts (HOSTED_HARNESSES).
The host is handed none of the runner's keys. Everything it calls that needs one goes through the runner's local proxy on 127.0.0.1 (src/agent-proxy/): model calls, the model registry, its telemetry (forwarded to the operator's collector with the collector's login, below), and on a runner behind the platform proxy the checkpoints. The platform's own MCP servers (memory, channels, the conversation tools) never carry the runner's own key: they carry a credential scoped to the run (in a hosted sandbox, the sandbox's session token until #2080), and a turn for which none can be had runs without them and says so. In a container shape the host's environment is an allow-list, so an ambient cloud identity in the runner's (AWS_ACCESS_KEY_ID and its siblings, AWS_WEB_IDENTITY_TOKEN_FILE, GOOGLE_APPLICATION_CREDENTIALS, Azure client secrets) does not reach it; on a local shape the host gets the runner's environment minus the runner's secret variables, as the agent's tools always did there. Each model lane serves its provider's model calls only, not the rest of the provider's API. The host authenticates with a token minted at each host start, and a model call is served only while a turn of the execution it names is running. On a runner that calls its providers directly, the proxy adds the operator's key or signs with the runner's cloud identity for each model backend (Anthropic, OpenAI, Bedrock, Vertex, Foundry), from the same settings as before; on a runner behind STIGMER_PROXY_ENDPOINT, it forwards to that proxy with the runner's own token. The proxy listens on loopback only and needs no configuration.
A turn's skills and plugins are read from the store one file at a time (src/shared/archive-reader.ts): the server lists a version's files and serves one file's bytes under the turn's own credential, the runner checks every byte against the listing's SHA-256, and the Stigmer engine's file tools read .stigmer/skills/ and .stigmer/plugins/ through that reader in every conversation (src/activities/execute-deep-agent/store-content-backend.ts). A conversation without a computer writes no skill or plugin to disk at all. One with a computer, whose commands may run a skill's scripts or a plugin's hooks, also gets each as a tree (src/shared/archive-tree.ts): where the runner separates, the runner unpacks it as root under /runner/mounts/<session> and the agent reaches it through a link in the platform folder, so a command is refused a write to it; elsewhere it is held to its archive at every turn start. The archive itself is cached on the agent's volume, under the platform folder's archives/, and used only while its SHA-256 matches, so a woken sandbox unpacks again without a download.
A conversation without a computer (src/shared/computer.ts) gets no workspace and touches no disk: no folder is provisioned, no lock or git runs, nothing is captured for review, and no File, output or skill is copied anywhere. The turn's input carries workspace: { computer: false } (src/harness/types.ts NoComputerWorkspace), and the Stigmer engine's file tools stand on one store-backed layer shared by every graph of the turn (src/activities/execute-deep-agent/computerless-files.ts): the agent's notes in the conversation's saved state, the conversation's Files and earlier outputs read from the store when opened (src/shared/inputs-reader.ts), this turn's outputs held in the runner's memory and returned as Files when the turn ends (src/shared/outputs-buffer.ts), and long results set aside in the runner's artifact storage with only their keys in the state (src/shared/offload-store.ts). The runner answers each of these over the host's pipe, under the turn's own credential; the store's signed links never reach the host. The saved state itself is unchanged: a local runner keeps checkpoints.db, one behind the platform proxy its HTTP store.
The turn runtime's own work on the agent's paths (provisioning the workspace, the .stigmer link, skill, plugin and File mounts, the file-review capture, write-back's commits) goes through src/shared/agent-fs.ts, which the runner routes to the host: each file operation and each process is performed there, so a link, a git hook or a core.fsmonitor the agent planted never acts with the runner's rights. src/harness/__tests__/runtime-touches-no-agent-path.test.ts holds the runtime's graph to that. The one exception is git that talks to GitHub with a repository's token: the runner runs it itself, in a bare repository of its own under ~/.stigmer/git (src/shared/workspace/runner-git.ts), never in the agent's clone, and moves commits to and from the clone as git bundles written and read through the host. So no process the agent can read ever holds the token, and what reaches GitHub is the session branch alone, whatever the clone's configuration says. That repository is a cache: deleted, it is fetched again, and on Kubernetes it sits on the runner container's own disk.
In a container shape (root, Linux, started through the runner layer's /runner/bin/start, which exports STIGMER_RUNNER_LAYER=1), the runner starts the host as a user of its own, stigmer-agent (uid and gid 10001), through setpriv (src/shared/agent-identity.ts), with the agent's home (STIGMER_AGENT_HOME, else /home/stigmer-agent) as HOME, so nothing an agent runs can read the runner's process, files or keys. At boot it adds the user when the image lacks it, hands the agent its home and workspace (on the first such boot, moving the agent's session state into that home, src/shared/agent-handover.ts), and proves the drop works; a runner that cannot drop exits 78. It keeps only SETUID, SETGID, CHOWN, KILL (to end a host that will not exit, which root cannot signal without it) and DAC_OVERRIDE (to write its own state on a volume it shares with the server). There the host's environment is an allow-list (src/agent-host/environment.ts), with STIGMER_AGENT_ENV_PASSTHROUGH naming extra variables; a credential under an allowed prefix (NODE_AUTH_TOKEN, an OpenTelemetry *_HEADERS name the runner does not hold) is held back unless named there, and the collector's login (OTEL_EXPORTER_OTLP_HEADERS and its per-signal forms) is a runner secret that never reaches it: the host exports through the runner's local proxy. The agent's home may hold none of the runner's own files: a STIGMER_AGENT_HOME above the runner's home or inside its ~/.stigmer is refused with exit 78 before the handover moves anything. src/__tests__/agent-separation.container.test.ts proves it in a container (STIGMER_TEST_CONTAINER=1). A workspace root inside the runner's home that the agent cannot pass (the default ~/.stigmer/workspaces/runner under a driver's /root) is refused the same way, naming WORKSPACE_ROOT_DIR. Local shapes (stigmer up, the all-in-one image, which runs it, and the desktop app) run the host as the same user, whose keys are their own.
The locked host. A conversation without a computer runs its Stigmer turns in a locked host (src/agent-host/fence.ts, hosting.ts): the same entry started with Node's permission model on (--permission, or --experimental-permission where that is the spelling) and one grant, a read of the runner's install root (the slim artifact's folder, a checkout's repository root, an embedder's node_modules folder). It may not write a file, start a process or a worker thread, or load a native addon, so the runner's entry loads Temporal's worker only from the modes that run one (src/main.ts; src/agent-host/__tests__/import-graph.test.ts). There is one locked host per turn slot (TEMPORAL_MAX_CONCURRENCY of them), and each serves one turn at a time (src/agent-host/host-pool.ts), so a turn shares its process with no other turn while it runs. Each is capped at STIGMER_TURN_MEMORY_MB of heap (--max-old-space-size); a turn that grows past it ends its own host, settles with "This turn ran out of memory (512 MB) and was stopped. Start a new turn or simplify the request.", and only that slot's host starts again. On a runner that serves every conversation each locked host starts at its slot's first such turn, never at boot; on one that serves only conversations without a computer (STIGMER_RUNNER_SERVES=computerless) all start at boot. Each proves its lock in its hello: the runner accepts it only with the exact flags it built, Node's own answers refusing writes, processes, workers and a read of the home folder, and V8's own heap limit within the cap. A runner that can't start it locked (a Node without the model, or the runner run from source under tsx: run npm run build && node dist/main.js instead) logs the reason once and refuses every turn without a computer with that sentence, never running one unlocked. The locked host holds no file: the turn's saved state crosses to the runner as the serializer's rows, the runner holds every op to the turn's own thread and hands it to the open host, which writes it into the session's checkpoints.db as before (src/shared/checkpointer/relayed-rows.ts). The local proxy admits a locked host only for the turn opened in its own slot, and forwards each of its model, checkpoint and engine-session calls under that turn's own run credential (src/agent-proxy/). Its memory, channels and conversation tools are the server's /v1/mcp/ lane (or the configured bridge) over HTTP, under the run's credential, and a server that doesn't answer there leaves them off for the turn with a note in the conversation; its web_fetch and MCP servers are held to the strict address rule whatever the overrides below say. Node calls its permission model a seat belt for trusted code, not a sandbox: what keeps such a turn off the machine is that it has no tool that reaches a disk or runs a program; the lock makes a bug do either loudly. scripts/verify-agent-host-boot.mjs --fenced boots a build's locked host, boots the Stigmer harness there, and proves Node refuses it a read and a process.
Elsewhere the host starts with the environment the agent's tools have always seen: the runner's own, without the runner's secrets (src/agent-host/environment.ts). Its log lines are relayed through the runner's console unchanged. A host that exits is started again after one second, backing off to thirty; a turn running on it settles as an internal failure at once, and the next turn waits for the new host. The host exits when its pipe closes, so a runner that is killed leaves no host behind. scripts/verify-agent-host-boot.mjs (part of npm run verify:dist, and of verify-slim-artifact.mjs for the slim artifact) proves a build starts as the host, and with --fenced as the locked host.
The Claude engine
A Claude turn runs Anthropic's engine: the Agent SDK (@anthropic-ai/claude-agent-sdk) and its per-platform package holding the claude executable, exactly as npm publishes them. The runner finds it at boot (src/activities/execute-claude/engine-home.ts): first its own install of the SDK (a checkout's development dependency, or an embedder's install beside @stigmer/runner), then the home for its pinned version under STIGMER_ENGINES_DIR (default ~/.stigmer/engines). A published runner pins the version in claude-engine.json beside its entry, written from the lockfile with each package's registry URL and integrity, and loads no other version. Boot logs [claude] engine ready <version> (<where>).
- The images (the cloud sandbox, the runner layer, compose, Helm and the all-in-one) carry the engine in a layer of their own: the runner layer at
/runner/engines, which its start script names asSTIGMER_ENGINES_DIR, and the all-in-one at/opt/stigmer/engines. - A local runner (the desktop app,
stigmer up, thelocal-processdriver) carries only the pin. Its first Claude turn downloads the SDK and this machine's platform package from npm (120 to 140 MB), checks each against the pinned integrity before extracting it, and installs the home atomically under a lock, so runners sharing a machine download once (src/activities/execute-claude/engine-fetch.ts). The turn shows "Downloading Claude (one time): N%" while it does; a failed download ends the turn with a sentence saying so, and the next turn tries again. An install removes another version's home unused for 30 days. - Behind a proxy, the runner's Node 22 honours
HTTPS_PROXYfor the download only withNODE_USE_ENV_PROXY=1set beside it (measured; Node calls it experimental). - A runner started from the runner layer never downloads: its agent host runs as the agent user, which must never install an engine later turns run. Without the engine it refuses Claude turns.
Anthropic's conditions for running the engine in a product bind every path: its bytes are never changed or re-signed, it runs on the API-key method only, and a Claude turn runs on the organization's own Anthropic key, never one of Stigmer's (src/harness/README.md, "The Claude engine").
Traces: every run as OpenTelemetry GenAI spans
The runner sends every run to the operator's tracing tool over OTLP, in OpenTelemetry's conventions for generative AI (src/gen-ai-conventions.ts): each turn an invoke_agent <agent> root span in a trace whose id is derived from the run id (src/run-trace-id.ts), so a run that resumed after an approval stays one trace; each model call a chat <model> span with its provider, model and tokens; each tool call an execute_tool <tool> span; a sub-agent an invoke_agent <name> span under its task call. It is configured only by the standard variables (src/otel-export.ts): an endpoint turns it on, OTEL_EXPORTER_OTLP_PROTOCOL picks http/protobuf (the default), http/json or grpc, and OTEL_EXPORTER_OTLP_HEADERS (with its per-signal forms) is the collector's login, a runner secret held in custody like the model keys. The conversation's text rides the spans only with OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true, and never shows more than the saved conversation does (src/shared/telemetry-content.ts). The agent host never holds the login: it exports to the local proxy's otlp lane, which forwards to the collector (src/agent-proxy/otlp-forward.ts). The operator's guide is docs/guides/self-hosting/tracing.mdx.
A note for embedders: OpenTelemetry
When you embed the runner as a library (createStigmerRunner / createStigmerRunnerManager), the factory does not initialize OpenTelemetry — tracing and metrics mutate global state, which the embedding process should own. The factory still wires the Temporal OTel interceptor internally when the standard settings export traces, but you must initialize the tracer/meter providers yourself if you want spans and metrics exported, and with your provider's id generator each turn of a run is a trace of its own, grouped by the Session's id. The stigmer-runner CLI initializes OTel for you in every mode. The agent host is a process of the runner's own, not the embedder's: when the settings export it sends its spans and metrics through the runner's local proxy under the runner's service name, with stigmer.runner.process=agent-host on the resource.
Execution location vs transport
Two settings are easy to conflate but are deliberately independent:
MODE— execution location. Where the agent runs and whose filesystem it sees.localallows local-path workspaces on the host filesystem;cloudruns in a server-provisioned sandbox (git-only).STIGMER_PROXY_ENDPOINT— transport. How credentials and artifacts move. When set, the runner routes model traffic through the Stigmer proxy and pushes artifacts through it, instead of talking to providers and storage directly.
These are orthogonal. The desktop runner is the canonical case where they diverge: it executes locally (MODE=local, so local-path workspaces work) yet still routes model traffic and artifact uploads through the proxy. Coupling the two — forcing "proxy implies cloud" — is exactly what previously broke local-path sessions, which is why the env path (MODE) and both library factories (executionMode) treat them separately.
Library factories —
executionMode. BothcreateStigmerRunnerandcreateStigmerRunnerManageraccept an optionalexecutionMode: "local" | "cloud"that sets execution location independently of proxy transport. When omitted, the staticcreateStigmerRunnerderives it for backward compatibility (proxy ⇒ cloud, otherwiselocal); the manager defaults tolocal. SetexecutionMode: "local"together withproxyEndpointto express the desktop case — local execution with proxy transport.
Credential modes
The transport setting drives two credential modes:
- Direct mode (local / OSS): the runner calls its model providers with the keys or cloud identity you configure;
STIGMER_TOKENis optional against a trusted-local server, which verifies no credential, and is the runner's own API key against a self-hosted server with sign-in on (the run's per-run credential arrives with each dispatch; seesrc/shared/run-credential.ts).STIGMER_PROXY_ENDPOINTis unset. - Proxy mode (cloud / managed runners):
STIGMER_PROXY_ENDPOINTandSTIGMER_TOKENare required. The organization's own provider keys are saved on the Models & providers page, and the proxy validates your token and injects the key upstream, so the key never reaches the runner or the sandbox. The agent host's model calls go to the runner's local proxy, which forwards them toSTIGMER_PROXY_ENDPOINTunder the run credential of the turn that made them, and underSTIGMER_TOKENonly for a turn whose dispatch carried none; the runner's own calls for a turn (its checkpoint saver, session titles, structured output, memory selection) read the turn's credential first the same way (src/shared/run-credential-store.ts).
A runner shared by many organizations
STIGMER_RUNNER_SERVES=computerless makes a runner that serves only conversations without a computer, which a server can share across organizations (src/runner-serves.ts). Its STIGMER_TOKEN is a static key the server accepts at its Temporal door alone, so it is used for nothing else: the runner discovers no bootstrap (its Temporal address is TEMPORAL_SERVICE_ADDRESS, else the backend endpoint's own host and port, the server's door), adopts no minted runner token and renews nothing. Every turn arrives with its own credential sealed with the server's payload key (sealed_execution_context_token), which the runner opens at the activity boundary with the same codec it decodes Temporal's payloads with, so the boot refuses to start without STIGMER_PAYLOAD_ENCRYPTION_KEY. A seal that does not open fails the turn with a sentence, never running it without its credential; in MODE=cloud a turn that carries no credential at all is refused the same way. A turn whose conversation has a computer is refused with a sentence naming the setting, whatever routed it there. Static mode only: the manager refuses the setting.
Required infrastructure
| Component | When | Purpose |
|-----------|------|---------|
| Temporal | Always | The runner is a Temporal Worker. It needs a reachable Temporal frontend and a namespace. You may set these explicitly (TEMPORAL_SERVICE_ADDRESS, TEMPORAL_NAMESPACE), but when a token is present the runner self-discovers them from the control plane at boot — see the env reference below. |
| Stigmer backend | Always | The control plane (STIGMER_BACKEND_ENDPOINT) for status updates, blueprints, and (local) artifact serving. |
| Stigmer proxy + token | Proxy/cloud only | The proxy (STIGMER_PROXY_ENDPOINT) injects the organization's own provider keys (saved on the Models & providers page) and brokers artifact storage; STIGMER_TOKEN authenticates to it. |
In local/direct mode, only Temporal and the Stigmer backend are required, and both default to localhost.
The stale-build guard
The runner runs from compiled dist/ output. A stale dist/ — source changed but not rebuilt — silently runs old code, which has historically cost hours of debugging (structured-output failures, naming mismatches, env-resolution regressions).
To prevent this, npm run build writes dist/.build-fingerprint: a JSON file with a SHA-256 hash of all src/**/*.ts files (excluding node_modules and __tests__), plus a build timestamp and file count. At startup, checkBuildFreshness() recomputes the hash and compares it. On mismatch, the runner prints a clear error and exits with code 78:
!!! STALE RUNNER BUILD — REFUSING TO START !!!
dist/ was built at <timestamp> (hash <hash>)
src/ has changed since (current hash <hash>)
Run 'make build-runner' or 'make desktop-dev' to rebuild.The check is skipped gracefully when the fingerprint file is absent — for example under tsx (npm run start), in CI, or on a first build — so it never blocks development workflows that run from source.
Environment variable reference
All configuration is environment-driven. Every variable the runner's source reads is named here, except the few src/__tests__/readme-environment.test.ts lists as deliberate exceptions, each with its reason (the operating system's home directory, a backend value not yet supported); the test fails when any other name appears nowhere in this file, so a new setting cannot land undocumented. That its row says the right thing is read in review. Defaults are checked by hand against the module each row cites or that reads the variable. "Applies to" indicates the run mode, execution location, or credential mode a variable is relevant to.
Core configuration
| Variable | Applies to | Required | Default | Purpose |
|----------|-----------|----------|---------|---------|
| STIGMER_RUNNER_MODE | All | No | static | Selects the run mode. Set to manager for dynamic per-session/per-execution Workers; any other value (or unset) means static mode. |
| STIGMER_ATTACH_PORT | The attach entry | No | 80 | Port the attach waiter listens on (src/attach/entry.ts), 80 being the port a Substrate router reaches without a CONNECT tunnel. Not passed to the runner. |
| STIGMER_SANDBOX_NAME_FILE | The attach entry | No | /run/ate/actor-name | File holding this sandbox's name, read on every push because each clone of a snapshot has its own (a Substrate template projects it with an actor-metadata volume). A push for a queue whose sandbox name differs is refused. Not passed to the runner. |
| STIGMER_RUNNER_ARCHIVE_CACHE_BYTES | All | No | 67108864 (64 MiB) | The size, in bytes, of the process-wide cache of skill and plugin file listings and bytes the turns read from the store (src/shared/archive-reader.ts). Every entry is keyed by the run's organization, so no turn is served from another organization's entry. |
| STIGMER_RUNNER_INPUT_CACHE_BYTES | All | No | 67108864 (64 MiB) | The size, in bytes, of the process-wide cache of the Files a conversation without a computer opens, read from the store when the agent opens one instead of copied to disk (src/shared/inputs-reader.ts). Every entry is keyed by the run's organization and the File's id. |
| STIGMER_RUNNER_MOUNTS_DIR | Separating runners | No | /runner/mounts | Where a runner that separates the agent (root, Linux, the runner layer) unpacks the read-only skill and plugin trees of a conversation with a computer, one folder per session (src/shared/archive-tree.ts). It and every ancestor must be root-owned and closed to writes by others, or the runner writes no skill there. For tests; deployments leave it unset. |
| STIGMER_SANDBOX_ENVIRONMENT | Sandboxes | No | (none) | The sandbox's Environment as JSON, {network, packages}, set by the docker and agent-sandbox drivers and, on Substrate, by the attach waiter from the first push (src/environment/spec.ts). The runner installs the packages once its agent's home is handed over (apt as root, the other managers as the agent into /opt/stigmer/environment, first on the agent's PATH); each turn waits for the install. Unset: no Environment. |
| STIGMER_SERVER_RELEASE | The start script | No | (none) | The server's release, set when the server is a release by the built-in agent-sandbox, docker and substrate drivers, and by a composition's own driver once it hands SandboxDriverConfig.serverRelease on (SERVER_RELEASE_ENV in the server's src/sandbox/runner-launch.ts); a sandbox started without it is not checked. The layer's start script (layer/start.sh) refuses a layer whose /runner/RELEASE names another release, and warns about one that names none. Read by the start script only, not by the runner. |
| MODE | All | No | local | Execution location: local (host filesystem, local-path workspaces) or cloud (server-provisioned sandbox, git-only). Independent of STIGMER_PROXY_ENDPOINT. Also the default for the two guards below. |
| STIGMER_WEB_FETCH_ALLOW_PRIVATE | All (the Stigmer harness's web_fetch) | No | follows MODE: strict in cloud, relaxed in local | The web_fetch address guard's override. true lets the agent fetch loopback and private-network addresses on any runner (link-local, which holds the cloud metadata endpoint, stays refused); false refuses them on a local runner too. For embedders whose execution location and network differ; managed cloud deployments never set it. It never reaches a conversation without a computer, which is always strict. See src/tools/url-guard.ts. |
| STIGMER_MCP_ALLOW_STDIO | All | No | follows MODE: forbidden in cloud, allowed in local | The MCP transport guard's override. true lets a cloud runner start stdio MCP servers, which download a package and run it as a subprocess holding the execution's secrets; false forbids them on a local runner too. For rolling the policy back without a redeploy; managed cloud deployments never set it. It never reaches a conversation without a computer, which starts no stdio server. See src/shared/mcp-transport-guard.ts. |
| STIGMER_TASK_QUEUE | Static mode | No | stigmer_runner | Temporal task queue the static Worker polls. Unused in manager mode, where each Worker derives its own queue. |
| TEMPORAL_SERVICE_ADDRESS | All | No | (discovered) | Address of the Temporal frontend. Resolution order: an explicit value always wins; otherwise, if STIGMER_TOKEN is set, the runner discovers it from the control plane at boot (getRunnerBootstrapConfig); otherwise it falls back to localhost:7233. Discovery failure aborts startup with an actionable error (no silent fallback). When the address is the backend endpoint's own host and port, the runner reaches Temporal through the Stigmer server, as a sandboxed runner does: its STIGMER_TOKEN is its Temporal API key, TLS follows the endpoint's scheme, and the STIGMER_TEMPORAL_* settings below must be unset (src/temporal-lane.ts). |
| TEMPORAL_NAMESPACE | All | No | default | Temporal namespace. |
| STIGMER_TEMPORAL_API_KEY | All | No | — | Temporal frontend API key (Temporal Cloud, or a frontend with an authorizer); implies TLS. Taken into the credential store at boot, so agent tools never see it. |
| STIGMER_TEMPORAL_TLS | All | No | — | true or 1: TLS to the frontend against the system's trusted roots. A CA, a client certificate or an API key implies it. |
| STIGMER_TEMPORAL_TLS_SERVER_NAME | All | No | — | Host-name (SNI) override for the frontend's certificate. |
| STIGMER_TEMPORAL_TLS_SERVER_CA_CERT_DATA / _PATH | All | No | — | The frontend's CA, as PEM text or a file path (one form, not both). |
| STIGMER_TEMPORAL_TLS_CLIENT_CERT_DATA / _PATH, STIGMER_TEMPORAL_TLS_CLIENT_KEY_DATA / _PATH | All | No | — | Mutual TLS: the client certificate and its key, both or neither (half a pair stops the boot). The key's _DATA form is taken into the credential store; a _PATH key is a file the agent's tools can read, so prefer _DATA. These are Stigmer's own names: Temporal's TEMPORAL_API_KEY and TEMPORAL_TLS_* belong to the user's own Temporal work and are never read. |
| STIGMER_BACKEND_ENDPOINT | All | In cloud mode | http://localhost:7234 (local) | Stigmer backend endpoint for status, blueprints, and local artifact serving. A bare host:port is normalized to http:// (or https:// for port 443). |
| STIGMER_TOKEN | Cloud or proxy mode | Yes (cloud/proxy) | (none) | Auth token for the Stigmer backend / proxy. Required when MODE=cloud or STIGMER_PROXY_ENDPOINT is set; optional in local/direct mode. On a runner with STIGMER_RUNNER_SERVES=computerless it is a static key used only as the Temporal API key behind the server. |
| STIGMER_PROXY_ENDPOINT | Proxy/cloud | No | (none) | Stigmer proxy endpoint. When set, activates proxy transport: model traffic and artifact uploads are routed through the proxy. |
| GIT_CONFIG_COUNT | Git workspaces | No | (none) | git's own per-command configuration, honoured as git honours it: a runner that sets it (a container's safe.directory, for one) keeps it, and the settings that hand a repository's token to the runner's own git are appended after it (src/shared/workspace/git-credential.ts), never in its place. |
| WORKSPACE_ROOT_DIR | All | No | ~/.stigmer/workspaces/runner (fallback) | Root directory for agent workspaces. If unset, the runner warns and creates an isolated fallback directory — it never falls back to the process working directory. |
| STIGMER_ENGINES_DIR | All | No | ~/.stigmer/engines; /runner/engines under the runner layer | Where the Claude engine lives: one home per version, <dir>/claude/<version>/node_modules/@anthropic-ai/, holding the Agent SDK and its platform package exactly as npm publishes them. The runner layer's start script sets it to the engine the layer carries. A local runner (the desktop app, stigmer up, the local-process driver) that finds none downloads the version its claude-engine.json pins into it on the first Claude turn; on a machine that cannot download, put the two packages there yourself. The runner's own install of the SDK, when it has one, is used first. See The Claude engine. |
| TEMPORAL_MAX_CONCURRENCY | All | No | 5 | Maximum concurrent Temporal activity executions (per session Worker in manager mode). Also the number of locked hosts, one per turn slot, that turns without a computer run in. |
| STIGMER_RUNNER_SERVES | Static mode | No | all | Which conversations the runner serves: all, or computerless for a runner shared by many organizations that serves only conversations without a computer (see A runner shared by many organizations; src/runner-serves.ts). Any other value stops the boot with a sentence; the manager refuses computerless. |
| STIGMER_TURN_MEMORY_MB | All | No | 512 | The heap, in megabytes, each locked host may grow to (--max-old-space-size): one host per turn slot and one turn per host, so a turn without a computer that outgrows it ends only itself, with a sentence naming the cap. A whole number of at least 128; anything else stops the boot with a sentence. |
| STIGMER_CHECKPOINTER_TYPE | All | No | sqlite (local), http (cloud) | LangGraph checkpointer backend for the Stigmer harness's agent state: sqlite (a durable per-session file under the platform dir, so a paused or interrupted run resumes across invocations), http (the proxy-backed saver), or memory (ephemeral; test runs only — a paused run cannot resume on it). The same setting places the Claude harness's conversation: a per-session transcript file under the session directory (sqlite), the platform's engine-sessions lane through the local proxy (http), or memory. |
| STIGMER_CHECKPOINTER_PROXY_ENDPOINT | http checkpointer | No | value of STIGMER_PROXY_ENDPOINT | Endpoint for the HTTP checkpointer; falls back to the proxy endpoint. |
| STIGMER_PRIMARY_MODEL | All | No | gpt-4.1 | Default LLM model identifier. |
| STIGMER_IDLE_TIMEOUT_SECONDS | All | No | (none) | Reserved. Parsed from the environment but not currently honored by the runtime — no component reads it today. Documented for completeness; setting it has no effect. |
Artifact storage
| Variable | Applies to | Required | Default | Purpose |
|----------|-----------|----------|---------|---------|
| ARTIFACT_STORAGE_TYPE | All | No | proxy if STIGMER_ARTIFACT_PROXY_ENDPOINT or STIGMER_PROXY_ENDPOINT is set, else local | Selects the artifact backend: local (filesystem, served by the Stigmer backend), proxy (presigned URLs via the proxy), or none (storage deliberately disabled: artifact features are refused rather than stored). An explicit value always wins. Storage follows transport, not execution location (src/shared/artifact-storage.ts). |
| STIGMER_ARTIFACT_PROXY_ENDPOINT | Proxy storage | No | value of STIGMER_PROXY_ENDPOINT | Endpoint the proxy artifact store presigns against, when artifact traffic must reach a different host than LLM traffic (the checkpointer-override pattern). |
| LOCAL_ARTIFACT_PATH | Local storage | No | ~/.stigmer/data/artifacts | Filesystem root of the local artifact store. Must equal the stigmer-server's ARTIFACT_LOCAL_BASE_PATH — in local mode the server writes an artifact to <ARTIFACT_LOCAL_BASE_PATH>/<key> and the runner reads it from <LOCAL_ARTIFACT_PATH>/<key>, so a mismatch makes every artifact read and offload fail to resolve. The defaults align out of the box; the CLI local daemon sets both explicitly. |
Payload encryption (Temporal history at rest)
The encryption codec encrypts every Temporal payload the runner produces (AES-256-GCM), so a run's fetched values never rest in workflow history or the Temporal UI. Payloads the runner did not encrypt (orchestrator inputs, signals, pre-rollout histories) pass through untouched. A key without its id — or a malformed key — fails the boot rather than silently running plaintext.
Keys come from two sources with strict precedence: the env vars below (the operator's explicit choice — self-hosted deployments and cloud sandboxes), or, when the env is silent, server-managed per-identity keys delivered by getRunnerBootstrapConfig (desktop-class runners on cloud; held in memory only, re-fetched each boot). See src/encryption/config.ts.
| Variable | Applies to | Required | Default | Purpose |
|----------|-----------|----------|---------|---------|
| STIGMER_PAYLOAD_ENCRYPTION_KEY | All | With STIGMER_RUNNER_SERVES=computerless | (unset — encryption off) | Base64-encoded 32-byte AES-256 key. Setting it enables the codec, which also opens a turn's sealed run credential. |
| STIGMER_PAYLOAD_ENCRYPTION_KEY_ID | Payload encryption | With the key | (none) | Identifier stamped on every encrypted payload so rotation can tell keys apart. Required when the key is set. |
| STIGMER_PAYLOAD_ENCRYPTION_SECONDARY_KEY | Payload encryption | No | (unset) | Decrypt-only key accepted during rotation windows (payloads written under the previous key stay readable). |
| STIGMER_PAYLOAD_ENCRYPTION_SECONDARY_KEY_ID | Payload encryption | With the secondary key | (none) | Key id of the secondary key. |
Credentials and providers
| Variable | Applies to | Required | Default | Purpose |
|----------|-----------|----------|---------|---------|
| OPENAI_API_KEY | Direct mode (Stigmer/OpenAI) | When using OpenAI directly | (empty) | OpenAI API key for the Stigmer harness in direct mode. Not needed in proxy mode. |
| ANTHROPIC_API_KEY | Direct mode (Stigmer/Anthropic) | When using Anthropic directly | (empty) | Anthropic API key for the Stigmer harness in direct mode. Not needed in proxy mode. |
| ANTHROPIC_BASE_URL | Direct mode (Stigmer/Anthropic, public backend) | No | (empty: api.anthropic.com) | The address of an LLM gateway in front of Anthropic (the API root, without /v1). A value that is not an http(s) URL stops the runner at startup; ignored, with a warning, under the proxy or a non-public backend. |
| STIGMER_LLM_REQUEST_TIMEOUT_MS | Stigmer harness | No | 0 (no timeout) | Per-attempt bound on a Stigmer-harness LLM request, in milliseconds. On a streamed reply (every agent turn) it bounds the wait for the reply to begin, and a timed-out attempt is retried like any other passing failure; on a reply that does not stream (structured extraction, session subjects) it bounds the whole reply, and a timed-out attempt is not retried (src/shared/model-retry.ts). 0 or unset means no explicit timeout. |
| STIGMER_CLOUD_API_URL | All | No | (unset) | Explicit override for the origin serving /v1/proxy/model-registry (model resolution and pricing). When unset, fetches go to STIGMER_PROXY_ENDPOINT (proxy mode) or STIGMER_BACKEND_ENDPOINT (direct/local mode — the local stigmer-server serves the registry). |
| STIGMER_AUTH_TOKEN | Pricing/registry fetch | No | value of STIGMER_TOKEN | Fallback bearer token for model-pricing and model-registry requests when STIGMER_TOKEN is not set. |
| GITHUB_TOKEN | Deep-agent git writeback | When writing back to GitHub | (none) | Token used by the deep-agent harness for git writeback operations. |
| STIGMER_RUNNER_HITL_SECRET | All | No | (a random secret per process) | Master secret the per-execution approval fingerprint keys derive from (src/shared/fingerprint-secret.ts). Set it to keep a pending approval valid across runner restarts and replicas; without it a restart re-keys, so a pending approval is asked again (never silently accepted). Taken into the credential store at boot, so agent tools never see it. |
Model backends
Where the Stigmer harness's models are served when the runner talks to providers directly. Under STIGMER_PROXY_ENDPOINT the proxy owns provider routing, and the runner warns that a non-public backend is ignored. The model backends guide is the one explanation of each backend, its credentials and its errors; the rows below index what the runner reads.
| Variable | Applies to | Required | Default | Purpose |
|----------|-----------|----------|---------|---------|
| STIGMER_ANTHROPIC_BACKEND | Anthropic models | No | public | Where Anthropic models are served: public (Anthropic's API), vertex, bedrock or foundry. An unknown value stops the runner at startup. |
| OPENAI_BASE_URL | OpenAI models | No | https://api.openai.com/v1 | The OpenAI SDK's own variable: an OpenAI-compatible endpoint, including its /v1. |
| CLOUD_ML_REGION | vertex | Yes (vertex) | (none) | The Vertex AI region, or global. Credentials come from Application Default Credentials. |
| ANTHROPIC_VERTEX_PROJECT_ID | vertex | No | (the credentials' project) | The Google Cloud project the Vertex calls are billed to. |
| ANTHROPIC_VERTEX_BASE_URL | vertex | No | (the region's endpoint) | A Vertex endpoint instead of the one the region names. |
| AWS_REGION | bedrock | Yes (bedrock) | (none) | The Bedrock region; the runner never assumes one. |
| ANTHROPIC_BEDROCK_BASE_URL | bedrock | No | https://bedrock-runtime.<region>.amazonaws.com | A Bedrock runtime endpoint instead of the region's. |
| AWS_BEARER_TOKEN_BEDROCK | bedrock | No | (the AWS credential chain) | A Bedrock API key, instead of the AWS chain (environment keys, IAM role / IRSA). Taken into the credential store at boot. |
| STIGMER_BEDROCK_INFERENCE_PREFIX | bedrock | No | (none) | The inference-profile geography (us, eu, global, …) for models Bedrock serves only through a profile. |
| STIGMER_BEDROCK_MODEL_MAP | bedrock | No | (none) | Overrides, canonical=bedrockId pairs separated by commas; consulted before the built-in mapping. A malformed value stops the runner at startup. |
| ANTHROPIC_FOUNDRY_RESOURCE | foundry | One of the two | (none) | The Microsoft Foundry resource name. |
| ANTHROPIC_FOUNDRY_BASE_URL | foundry | One of the two | (none) | A full Foundry endpoint, instead of the resource name. |
| ANTHROPIC_FOUNDRY_API_KEY | foundry | No | (a Microsoft Entra ID token) | A Foundry API key, instead of the runner's Azure identity. Taken into the credential store at boot. |
| STIGMER_FOUNDRY_DEPLOYMENT_MAP | foundry | No | (none) | Custom deployment names, canonical=deployment pairs separated by commas. A malformed value stops the runner at startup. |
Observability
| Variable | Applies to | Required | Default | Purpose |
|----------|-----------|----------|---------|---------|
| OTEL_EXPORTER_OTLP_ENDPOINT | All | No | (none) | OTLP endpoint for traces and metrics (or the per-signal ..._TRACES_ENDPOINT, ..._METRICS_ENDPOINT). When unset, OpenTelemetry is disabled with zero overhead. See traces and the embedder note on who initializes OTel. |
| OTEL_EXPORTER_OTLP_PROTOCOL | All | No | http/protobuf | grpc, http/protobuf or http/json (and the per-signal forms). Any other value refuses the runner's start. Before 2026-10 the runner spoke gRPC only: a gRPC collector port needs grpc set. |
| OTEL_EXPORTER_OTLP_HEADERS | All | No | (none) | The collector's login, key=value pairs comma-separated (and the per-signal ..._TRACES_HEADERS, ..._METRICS_HEADERS). A runner secret: taken into custody at boot, never in an agent's environment; a sandboxed runner receives it on STIGMER_SANDBOX_RUNNER_SECRETS. |
| OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT | All | No | (off) | true (or span_only, span_and_event) puts the conversation's text on the spans, within the saved conversation's rules. |
| OTEL_SDK_DISABLED | All | No | (unset) | true turns every exporter off, whatever else is set. |
| OTEL_BSP_MAX_EXPORT_BATCH_SIZE | All | No | 512, or 32 with content on | Spans per export. With content on a span carries up to 64 KiB, so the default drops to 32 to keep a batch under a gRPC collector's 4 MiB; a value set here wins. |
Advanced and debug
These tune internal behavior or support testing. Most operators never set them.
| Variable | Default | Purpose |
|----------|---------|---------|
| STREAMING_MIN_INTERVAL_MS | 500 | Minimum time between streaming status updates (rate limit). |
| STREAMING_MAX_INTERVAL_MS | 5000 | Maximum time before a forced keepalive status update. Clamped up to the min if set lower. |
| STREAMING_BURST_THRESHOLD | 50 | Event count that triggers an immediate status update (burst protection). |
| STIGMER_PROGRESS_CAPTURE_MIN_INTERVAL_MS | 2000 | Minimum time between two mid-run captures of the "N files changed so far" strip. Each capture stages the working tree with git (git workspaces) or reads the touched files (other workspaces), so this bounds that cost however often status is written. Read once at startup; a non-numeric or negative value keeps the default, and 0 captures on every status write. |
| CURSOR_STREAM_STALL_TIMEOUT_MS | 180000 (3 min) | How long a turn may go with nothing open and nothing arriving before the run is cancelled and the execution fails with a stall error, for every harness (the name predates the harnesses that read it). A tool call or delegated task that is still running holds it, so a long silent build is not a stall (src/harness/open-operations.ts). Embedders set it through the cursorStreamStallTimeoutMs option. |
| STIGMER_OPEN_OPERATION_MAX_MS | 3600000 (60 min) | The backstop for one open operation: a tool call or delegated task still running after this long is stopped and the execution fails with a sentence naming it. It exists for what has no bound of the runner's own (an engine's opaque tool); every operation the runner runs itself is bounded well below it. Embedders set it through the openOperationMaxMs option. |
| STIGMER_DRAIN_GRACE_MS | 25000 (25 s) | How long a static runner's shutdown waits for the turns in flight to reach a step boundary (Temporal's shutdownGraceTime). A turn that reaches one stops there and continues on the next runner; one still mid-step when it runs out is stopped there and continues too, running that step again. Keep it under the host's own termination grace: the default sits under Kubernetes' 30 s, and the agent sandbox's pod, whose grace is 600 s, sets 540 s. Embedders set it through the drainGraceMs option. The desktop manager has none: it exits at once. |
| STIGMER_LIVENESS_INTERVAL_MS | 30000 (30 s) | How often a working turn says what it has open: the runner sends a stigmer.run.liveness preview naming each open operation and its age at this interval while the turn runs, and at once when what is open changes, so a watcher that reconnects learns within the interval. From 1000 to under 60000; any other value falls back to the default with a warning. Embedders set it through the livenessIntervalMs option. |
| STIGMER_SHELL_TIMEOUT_MAX_SECONDS | 3300 (55 min) | The most the Stigmer harness's model may raise one shell command's timeout to; a command's default bound is 120 s, and a larger request is clamped to this and the result says so. A command the agent starts in the background (execute with background: true) is bounded by this unless it asks for less; it is stopped, and awaited, when its turn's invocation ends, an approval pause included, and the agent can stop it sooner with stop_background_command (src/shared/shell/background-commands.ts). The session's log carries each one's life as stigmer.background_command.status beside the call that started it, with its output previewed under that call (src/activities/execute-deep-agent/background-facts.ts), so the console shows it running and how it ended; a person can stop one alone (SessionCommandController.stopBackgroundCommand), which the runtime reads every 2 s while a command runs (src/harness/background-stops.ts). Kept under STIGMER_OPEN_OPERATION_MAX_MS, so the shell's own bound fires first. Embedders set it through the shellTimeoutMaxSeconds option. |
| STIGMER_SHELL_BACKGROUND_ENABLED | true | Whether the Stigmer harness's model may start a shell command in the background. false turns it off: execute is declared without background, stop_background_command is not bound, and no turn waits at its end for a command, so every command runs in the foreground, a turn never waits on one, and a sandbox never stays awake for one. Any other value keeps it on with a warning. Embedders set it through the shellBackgroundEnabled option. |
| WORKSPACE_LOCK_TIMEOUT_MS | 900000 (15 min) | How long a turn waits for another session's lock on the same workspace before the execution fails with "workspace is in use by another session" (src/shared/workspace/workspace-lock.ts). Embedders use the workspaceLockTimeoutMs option. |
| STIGMER_MCP_BRIDGE_ENDPOINT | (none) | The MCP bridge the runner's own attachments (memory, channel messaging, conversation participation) connect to, as https://…. An embedded runner that discovers its Temporal coordinates from a server also learns the bridge from it, when the server names one (STIGMER_RUNNER_BOOTSTRAP_MCP_BRIDGE_ENDPOINT); a value set here wins. Neither selects the local shape: a spawned stigmer mcp-server stdio child against the local backend. |
| SKIP_MCP_CONNECT_BACKFILL | false | When true, skips MCP Connect backfill. |
| STIGMER_MCP_PUBLIC_ENDPOINT | (none) | The server's public endpoint. A server that provisions this runner's sandbox sets it from its own configuration (STIGMER_SANDBOX_MCP_PUBLIC_ENDPOINT). Fills STIGMER_SERVER_ADDRESS (as host:port) for MCP servers that declare it and carry no value; without it, only stdio servers are filled, from STIGMER_BACKEND_ENDPOINT. A value already present is never overridden. |
| V3_EVENT_RECORD_DIR | (none) | Directory to record deep-agent harness events (debugging/fixtures). |
Related documentation
- Manager-mode IPC protocol — the line-delimited JSON command/response contract and its versioned handshake (current protocol version
1). A short pointer also lives atdocs/ipc-protocol.md; the code definition issrc/ipc-protocol.ts. - Embedding integration guide — building a desktop client (local execution) and a web client (cloud execution), including the per-audience configuration each one passes.
- SDK
RunnerAdapterandexecutionTarget— the local-execution surfaces in@stigmer/react-sdkand@stigmer/client. The embedding guide covers them today; a dedicated SDK reference is forthcoming. - Public API —
src/index.tsexportscreateStigmerRunnerandcreateStigmerRunnerManagerwith typed options and inline examples. - Adding a harness — the turn runtime, the adapter contract, the contract kit, and the checklist of files inside and outside the runner a new harness touches.
