Skip to Content
Qube

Environment variables

Environment variables matter when you run Qube from source or self-host the web server. The installed desktop app is configured almost entirely through its in-app Settings screen, and most people never touch these.

Environment variables matter when you run Qube from source or self-host the web server. The installed desktop app is configured almost entirely through its in-app Settings screen, and most people never touch these.

In development, Next.js loads variables from .env.local (copy the provided .env.example as a starting point). In a desktop build, the release pipeline bakes the connector key into an env.json next to the server; everything else can be set in the app.

Variables you are most likely to need

VariablePurpose
COMPOSIO_API_KEYKey for connected apps. Required when building from source; released desktop builds already embed a built-in key, and you can also set your own in Settings → Advanced → Composio API Key. Get one at the Composio dashboard.
QUBE_DATA_DIRDirectory for durable state (.memory/, .agents/, browser profiles, logs, SQLite). Defaults to the current working directory in source runs; the desktop app points it at the application data directory.
WORKSPACE_PATHAbsolute path to the file workspace. Defaults to ./workspace under the working directory (a legacy ./playground folder is used if it already exists). Hard Reset deletes the workspace only when it lives inside QUBE_DATA_DIR; remove an external path separately.
WORKSPACE_DIR_NAMEFolder name for the workspace when WORKSPACE_PATH is not set (default workspace).
LWC_SECRETSecret used to sign ChatGPT sign-in session cookies. If unset, Qube generates and persists one in .memory/lwc-secret.txt, so this is mainly needed for stable multi-deploy hosting. Generate with openssl rand -hex 32.
PORTPort for the local web server (the dev script uses 3010; the desktop sidecar defaults to 3010).

ChatGPT sign-in

VariablePurpose
LWC_SECRETSigning secret for session cookies (see above). Rotating it signs everyone out.
LWC_CLIENT_VERSIONPins the Codex client version used for ChatGPT model discovery. By default Qube tracks the latest @openai/codex release automatically; only pin it if discovery misbehaves.
LWC_DEFAULT_MODELFallback ChatGPT model for requests that don't name one.

Browser and computer use

See Browser automation and Computer use for the full feature context.

VariableDefaultPurpose
CHROME_PATH—Absolute path to the Chrome/Chromium/Edge binary to launch.
BROWSER_HEADED (or BROWSER_HEADLESS=0)headlessSet to 1 to show a real OS browser window in addition to the side panel.
BROWSER_CDP_PORT9222Chrome DevTools Protocol port for the managed browser.
BROWSER_MCP_DISABLEDoffSet to 1 to disable the built-in browser automation service.
BROWSER_MCP_COMMAND / BROWSER_MCP_ARGS_JSONbuilt-in serviceReplace the built-in browser service with a custom command.
PLAYWRIGHT_BROWSERS_PATHOS cacheOverride where Playwright-bundled Chromium is looked for.
COMPUTER_USE_DISABLEDoffSet to 1 to disable OS-level computer control entirely.
COMPUTER_USE_COMMANDocu/open-computer-useOverride the computer-use driver command.
COMPUTER_USE_TIMEOUT_MS60000Timeout for a driver call.
COMPUTER_TAKEOVER_TTL_MS900000 (15 min)How long a browser takeover request waits for you.
COMPUTER_USE_KERNELonThe describe → permission → verify kernel wrapper; set to 0 to disable.
BROWSER_CDP_ENDPOINThttp://127.0.0.1:9222CDP endpoint the built-in browser service connects to.

Agent execution limits

VariableDefaultPurpose
PI_HARNESS_TIMEOUT_MS300000 (5 min)Rolling timeout for one interactive chat round; re-armed by every goal continuation.
PI_HARNESS_MAX_STEPS60 (1–500)Max model/tool steps in one pass of an interactive run.
QUBE_VERIFICATION_ROUNDS2 (0–10)Extra passes allowed to repair a failed completion check.
PI_MAX_CONCURRENT_RUNS32 (1–128)How many chats can run at the same time.
QUBE_RUN_STALE_MS45000After this long without progress, a run record is treated as stale.
PI_HARNESS_MAX_TOTAL_MS3600000 (1 h)Absolute wall clock for one chat run; goal continuation extends the rolling timeout only up to this.
QUBE_SILENT_CONTINUATIONS8Silent nudge rounds for a stalled turn or a failed tool call; 0 disables them.
QUBE_GOAL_CONTINUATIONS30 (0–500)Continuation rounds while TodoWrite goals are unfinished; 0 disables goal continuation.
QUBE_GOAL_STALL_ROUNDS3 (1–20)Consecutive goal rounds with no progress (no completed item, no successful tool call) before stopping.
QUBE_GOAL_ERROR_ROUNDS2 (0–10)Consecutive provider/tool-error rounds tolerated while goals remain open.
QUBE_GOAL_INHERITED_ROUNDS5 (0–50)Rounds granted to a checklist inherited from an earlier turn before it must be re-written or cancelled.
PI_TASK_TIMEOUT_MS180000Rolling timeout for one background task run (reset by each productive round).
PI_TASK_MAX_TOTAL_MS1800000 (30 min)Absolute wall clock for one background task run.
PI_TASK_HEARTBEAT_STEPS12Max tool steps for a check-in run.
PI_TASK_SCHEDULED_STEPS20Max tool steps for a scheduled task run.
PI_TASK_MAX_ROUNDS12 (1–50)Continuation rounds inside a background run while its plan has open items.
PI_TASK_STALL_ROUNDS3 (1–20)Consecutive no-progress background rounds before the run stops.
PI_SUBAGENT_TIMEOUT_MS180000Timeout for a subagent.
PI_MCP_TIMEOUT_MS45000Startup/communication timeout for custom MCP servers.
PI_CONNECTOR_TIMEOUT_MS30000Timeout for connector (Composio) tool calls.
PERMISSION_TIMEOUT_MS300000How long an approval card waits before timing out.
ASK_USER_TIMEOUT_MS300000How long a single-question prompt (ask_user tool) waits for an answer. The multi-question panel (ask_question tool) uses PERMISSION_TIMEOUT_MS instead.
QUBE_HEARTBEAT_CONNECTOR_TIMEOUT_MS6000Timeout for each read-only connector check during the check-in sweep.

Memory, compaction and UI

VariableDefaultPurpose
QUBE_COMPACTION_ENABLEDenabledSet to false to disable automatic context compaction (the manual compaction endpoint still works).
QUBE_COMPACTION_CONTEXT_TOKENS128000Assumed model context window when the provider reports none.
QUBE_COMPACTION_RESERVE_TOKENS20000Headroom below the window that triggers compaction.
QUBE_COMPACTION_KEEP_RECENT_TOKENS15000Recent history kept verbatim alongside the summary.
QUBE_COMPACTION_SUMMARY_TOKENS4096Maximum size of a generated summary.
QUBE_COMPACTION_TOOL_CHARS2000Per-tool-output truncation when serializing history for a summary.
QUBE_COMPACTION_SUMMARY_MAX_CHARS24000Character cap on a stored summary.
QUBE_TOOL_OUTPUT_INLINE_CHARS16000Tool results larger than this are saved to .memory/tool-outputs/ and paged back on demand.
QUBE_TOOL_OUTPUT_MAX_CHARS24000Maximum characters of a tool result kept in the conversation.
QUBE_TOOL_OUTPUT_READ_CHARS30000Characters returned per page when the agent reads a stored tool result.
QUBE_TOOL_OUTPUT_MAX_FILES200Stored tool results kept per chat.
QUBE_TOOL_OUTPUT_RETENTION_HOURS168 (7 days)How long stored tool results are kept.
QUBE_READ_FILE_MAX_CHARS30000Default character limit when the agent reads a file.

ACP and experimental flags

VariablePurpose
QUBE_MODELDefault model as provider:model for ACP editor sessions; falls back to the app's configured default.
PI_DURABLE_ENABLEDSet to 1 to route chat through the experimental SQLite-backed durable harness instead of the default in-memory Pi harness. Unfinished migration path — not recommended for daily use.

Model settings that are not environment variables

A few model parameters are set by the app rather than by environment variables:

  • Temperature — there is no temperature control in the interface. The agent uses 0.3 when the chat request does not include one. However, the Settings dialog keeps a temperature value of 0.7 and writes it to the browser's local storage (qube-temperature) whenever you save Preferences or close Settings, and chat requests send that stored value. In practice, chats use 0.7 once Settings has been opened at least once.
  • Reasoning effort — chosen per chat in the composer's model picker (Off, Low, Medium, High; non-reasoning models show only Off).
  • Context window and price — taken from the provider's model list where available and used for compaction and the usage meter; otherwise QUBE_COMPACTION_CONTEXT_TOKENS applies.

Build and release variables

These are read by build scripts and CI, not by the running app:

VariablePurpose
TAURI_BUILDSet by the desktop build so Next.js produces the standalone server the sidecar runs.
GITHUB_TOKEN / GH_TOKEN, GITHUB_REPOSITORY, GITHUB_REF_NAME, GITHUB_API_URLUsed by scripts/build-updater-json.mjs in the release workflow to assemble latest.json for the updater.

The desktop shell itself sets PORT, HOSTNAME=127.0.0.1, QUBE_DATA_DIR, QUBE_DESKTOP=1 and QUBE_APP_VERSION for the sidecar; you do not set these yourself.

How settings interact

  • In-app Settings (providers, custom instructions, run on start, keep-alive) are stored in .memory/app-settings.json and related files under QUBE_DATA_DIR; they apply regardless of how the server was launched.
  • Environment variables fill in what the app settings don't cover and are useful for containers and CI. When both exist, the in-app setting generally wins for user-facing preferences, while build-time variables such as COMPOSIO_API_KEY are read directly.
Edit on GitHub

On this page