Skip to content

Configuration

Every environment variable, by the process that reads it, with its default

ProcessWhere its variables are set
GatewayThe container’s environment. From a checkout, also .env at the checkout’s root; the environment wins over the file.
Host/etc/slack-presence/host.env (root, mode 0600), read by slack-presence-host.service. Apply with systemctl restart slack-presence-host.
Runnerhost.env. The host passes a fixed list to each runner; runners started after the host restart get the new value.

provision.sh rewrites host.env only when run with SP_HOST_TOKEN. It writes only the variables marked “written by provision.sh”; lines added by hand are lost.

Gateway

VariableDefaultPurpose
PORT3170; the container image sets 8080Listen port, on all interfaces.
SP_DB./gateway.db; the image sets /data/gateway.dbSQLite database path.
SP_ORIGINhttp://localhost:<PORT>Public origin, for example https://computer.example.com. Used in Slack and GitHub callback URLs and the host URL.
SP_STORE_KEYunsetSecret the encryption key for stored secrets is derived from (openssl rand -hex 32). Unset: /setup and people cannot store secrets. Changed: every stored secret is unreadable.
SETUP_TOKENunsetToken that signs in to /setup.
GITHUB_ORGunsetGitHub organization that owns the GitHub App. Required for the GitHub step of /setup.
SLACK_APP_NAMEComputerName of the Slack app and bot that /setup creates, and the name the bot answers to.
SP_HOST_TOKENSemptyComma-separated host tokens accepted besides those /setup issues.
SP_PEOPLE[]JSON array of people, written to the people table at every start.
PERMISSION_MODEbypassPermissionsPermission mode of new sessions: default, acceptEdits, plan, auto or bypassPermissions.
SP_VERSIONthe checkout’s commit, else devVersion reported by /healthz. The image sets it from the SP_VERSION build argument.
SP_TUNNELunset1: development mode. The gateway creates the Slack app itself behind an ngrok tunnel.
NGROK_URL, PUBLIC_URLunsetWith SP_TUNNEL=1: a reserved ngrok domain, or a public URL from another tunnel.
SP_SLACK_API_URLSlack’s APIDevelopment only: base URL of the Slack Web API.
SP_GITHUB_API_URLhttps://api.github.comDevelopment only: base URL of the GitHub API.

Credentials

/setup stores these in the database, encrypted. An environment variable of the same name wins.

GroupNames
Slack appSLACK_APP_ID, SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, SLACK_SIGNING_SECRET, SLACK_STATE_SECRET
Slack app configuration tokenSLACK_CONFIG_TOKEN, SLACK_CONFIG_TOKEN_EXP, SLACK_CONFIG_REFRESH_TOKEN
Slack installationSLACK_BOT_TOKEN, SLACK_BOT_USER_ID, SLACK_BOT_ID, SLACK_TEAM_ID
GitHub AppGITHUB_APP_ID, GITHUB_APP_SLUG, GITHUB_APP_OWNER, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_WEBHOOK_SECRET, GITHUB_PRIVATE_KEY
GitHub installationGITHUB_INSTALLATION_ID, GITHUB_INSTALLATION_ACCOUNT
ModelCLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY

Host

Identity and connection

VariableDefaultPurpose
SP_GATEWAY_URLws://localhost:3171/hostThe gateway’s host endpoint, wss://<gateway>/host. Written by provision.sh.
SP_HOST_TOKENunsetBearer token for that endpoint, issued by /setup. Written by provision.sh.
SP_HOST_IDthe hostname; provision.sh writes shared-vmHost id. The people table routes people to it: keep it when the VM is replaced.
SP_DATA/dataData directory. Set by the unit.
SP_RUN/run/slack-presenceDirectory of runner sockets. Set by the unit.
SP_DEFINITIONunset; the unit sets /opt/slack-presence/current/definitions/computer.jsonWorkspace definition used until the gateway sends one, which is saved under <SP_DATA>/state/ and wins.
SP_VERSIONthe checkout’s commitRelease commit. The unit reads it from the release’s .sp-version.env.

Runners

VariableDefaultPurpose
SP_IDLE_MS7200000Milliseconds without a message before the host stops a runner.
SP_POOL_SIZE2Spare runners kept started for new sessions. 0: no pool.
SP_LAUNCHsystemd on Linux, detached elsewheresystemd: runners are transient systemd user units. detached: detached processes that log to <SP_RUN>/logs/.
SP_SYSTEMD_RUNsystemd-run --user --slice=slack-presence-runners.slice -p MemoryHigh=<60% of RAM, at most 12G> -p MemoryMax=<75% of RAM, at most 16G>Command prefix that starts a runner unit. Setting it replaces the memory limits too. See Resource limits.
SP_RUNNER_USERunset: runners run as the host’s userStart runners as this user through sudo. Where the host runs as sp-host, the install sets agent, with SP_RUNNER_PATH.
SP_RUNNER_PATHunsetPATH of runners and workspace commands when SP_RUNNER_USER is set.

Workspaces

The four durations accept a number of seconds or a unit: 300, 500ms, 30s, 5m, 2h, 1d.

VariableDefaultPurpose
SP_FETCH_INTERVAL5mHousekeeping period: clone, fetch, fast-forward, prune.
SP_FETCH_TIMEOUT2mTimeout of one housekeeping fetch.
SP_FORK_FETCH_TIMEOUT5sTimeout of the fetch at session start. On timeout the session starts from the refs already fetched.
SP_FORK_FETCH_FRESH60sSession start skips its fetch when the clone was fetched this recently and nothing was pushed since. 0: always fetch.
SP_FORK_RETENTION_DAYS14Idle days before a session directory is removed, if it holds nothing uncommitted or unpushed.
SP_ARTIFACTS_IDLE_HOURS24Idle hours before a session’s git-ignored build and dependency directories are removed.

Telemetry

VariableDefaultPurpose
SP_TELEMETRY_URLunset: records are validated and discardedCollector base URL. Written by provision.sh when passed.
SP_TELEMETRY_CREDENTIALunset: records are spooled, not sentThe host’s signed credential for the collector. Written by provision.sh when passed.
SP_REGIONunknownRegion label on telemetry records. Passed to runners. Written by provision.sh when passed.
SP_SUBSTRATEunsetLabel for where runners run, for example vm. Passed to runners. Written by provision.sh when passed.

See Telemetry.

Model proxy

Not in the public code yet: launch blocker 3 (model proxy). The host and runner read these variables; the proxy they point at is not in the public repository.
VariableDefaultPurpose
SP_MODEL_PROXYunset; the sp-host install sets /run/oc-modelproxy/control.sockThe proxy’s control socket. Unset: the host uses no proxy.
SP_MODEL_SOCKET/run/oc-modelproxy/api.sockThe proxy’s API socket, which the harness connects to. Passed to runners.
SP_CODEX_BIN/usr/local/lib/codex/bin/codexCodex CLI a Codex session runs. Passed to runners.
SP_CODEX_PEER_CHECKonoff: any local process can use a Codex session’s model connection. Only for hosts whose runners are not systemd units. Passed to runners.

Passed from the host to runners

The host sets each of these on every runner, to its own value or empty; a runner treats empty as unset. Nothing else from the host’s environment reaches a runner. Credentials go over the runner’s socket, not the environment.

VariableDefault in the runnerPurpose
MODELclaude-opus-5-5Model id of the default tier. See Models and harnesses.
SP_COMPACT_AT120000Tokens in a turn’s last request above which the conversation is compacted between turns. 0: off. See Context and compaction.
SP_CONTEXT_WINDOW183000Tokens. Claude Code’s auto-compact window, applied inside a turn. 0: Claude Code’s default.
SP_PROMPT_CACHE_TTL1h on Anthropic’s API; Claude Code’s default through another base URLClaude Code’s prompt cache lifetime, 5m or 1h, for the conversation and its subagents.
SP_PROMPT_GUARDonoff: the runner no longer withholds copies of its system prompt from its posts.
FOLD_AT4Progress cards in one Slack message before a long turn folds into its history.
PERMISSION_MODEPassed through; a session’s mode comes from the gateway.
SP_COMMITTER_NAME, SP_COMMITTER_EMAILComputer, computer@users.noreply.opencomputer.devCommitter identity of commits made in sessions.
SP_REAL_GH, SP_REAL_OPENCOMPUTERfound on PATHThe real gh and opencomputer binaries behind the shims in the release’s bin/.
SP_RUN, SP_DATA, SP_DEFINITION, SP_VERSION, SP_REGION, SP_SUBSTRATE, SP_MODEL_SOCKET, SP_CODEX_BIN, SP_CODEX_PEER_CHECKAs for the host, above.
PATH, HOME, USER, SHELL, LANG, TMPDIRTMPDIR: the system temporary directoryThe runner’s process environment.
CLAUDE_CONFIG_DIR, DISABLE_AUTOUPDATERRead by Claude Code.
GIT_CONFIG_GLOBAL, GIT_CONFIG_NOSYSTEMRead by git.
NODE_OPTIONS, NODE_PATH, NODE_EXTRA_CA_CERTS, LD_PRELOAD, LD_LIBRARY_PATH, BASH_ENVSet, empty unless the host has a value, so a session cannot change them for later runners.
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and their lower-case formsOutbound proxy settings, as above.
SP_FAKE_SLACK, SP_SLACK_API_URLDevelopment only.

WORKDIR is also on the list and applies only in one-machine mode.

API relay

Not in the public code yet: launch blocker 4 (API on a self-hosted instance).

Read by slack-presence-wire.service.

VariableDefaultPurpose
SP_WIRE_LISTEN127.0.0.1:7071Address the relay listens on.
SP_WIRE_SOCKET<SP_RUN>/wire/wire.sockThe host’s socket the relay connects to.
SP_RUN/run/slack-presenceAs for the host.
SP_VERSIONdevRelease commit reported to clients.
SP_REGIONunsetRegion reported to clients.

One-machine mode

npm start in a checkout runs everything in one process, with no gateway or host (see Run from source). It reads .env and these variables, plus PORT, PERMISSION_MODE, MODEL, SLACK_APP_NAME, NGROK_URL, PUBLIC_URL, FOLD_AT, SP_COMPACT_AT, SP_CONTEXT_WINDOW and SP_PROMPT_CACHE_TTL:

VariableDefaultPurpose
WORKDIRunset: workspaces/<session> in the checkoutOne existing directory that every session works in.
STREAMINGonoff: replies update by message edits, not Slack’s native streaming.
FLUSH_MS600Minimum milliseconds between timed flushes of a streamed reply.

The host does not pass STREAMING and FLUSH_MS to runners, so on a computer they keep their defaults.

provision.sh inputs

Not in the public code yet: launch blocker 6 (install path).

Read from the environment of each provision.sh run. See Host VM and Upgrade.

VariableDefaultPurpose
REPO_URLrequiredHTTPS clone URL of the code.
REPO_REFmainBranch or tag to deploy.
REPO_TOKENunsetGitHub token for a private REPO_URL, used for this run only.
CODE_ONLY01: skip apt packages and toolchains.
SP_GATEWAY_URL, SP_HOST_TOKEN, SP_HOST_IDWith SP_HOST_TOKEN: written to host.env, and the host is started. Without: the existing host.env is kept.
SP_TELEMETRY_URL, SP_TELEMETRY_CREDENTIAL, SP_REGION, SP_SUBSTRATEunsetWritten to host.env with the above.
SP_DEFINITION_NAMEcomputerThe shipped definitions/<name>.json the host uses until the gateway sends a definition. Remembered across runs.
CLOUDdetectedaws or none. Selects how the data disk is found.
DATA_VOLUME_IDunsetEC2: the EBS volume id of the data volume, needed on first use.
DATA_DEVICEunsetBlock device path of the data volume; overrides discovery.
DATA_WAIT_SECS900Seconds to wait for the data volume to be attached.
FORMAT_IF_BLANK1Format a data device with no partitions and no filesystem signature as ext4. 0: fail instead.
ALLOW_NO_DATA_VOLUME01: use a plain /data directory on the root disk. For throwaway test VMs.
AGENT_UID1500Uid and gid of the agent user. Must be the same on every VM that mounts the volume.
NODE_MAJOR24Node.js major version.
GO_SERIES, GO_VERSION1.27, unsetGo series (latest patch) or an exact version.
PLAYWRIGHT_VERSION1.64.1Playwright version whose browser and libraries are installed.
CODEX_VERSION0.163.0Pinned Codex CLI version.
INSTALL_DOCKER01: install Docker and add agent to the docker group, which is root-equivalent.
WIRE_PORT7071Loopback port of the API relay.