Skip to content

Configuration Reference

GSV configuration is a JSON object stored in the Gateway Durable Object. Configuration is applied by deep-merging user-provided overrides onto the default configuration. Arrays and primitives in overrides replace defaults; objects are merged recursively.

The full configuration type is GsvConfig (defined in gateway/src/config/index.ts). Defaults are in gateway/src/config/defaults.ts.


Model

Top-level model settings used by the agent LLM loop. Per-agent overrides are available via agents.list[].model.

KeyTypeDefaultDescription
model.providerstring"anthropic"LLM provider identifier. Used for API routing.
model.idstring"claude-sonnet-4-20250514"Model identifier passed to the provider API.

API Keys

Provider API keys. Stored as worker secrets or in config. All keys are optional; only the key for the active provider is required at runtime.

KeyTypeDefaultDescription
apiKeys.anthropicstringundefinedAnthropic API key.
apiKeys.openaistringundefinedOpenAI API key.
apiKeys.googlestringundefinedGoogle AI API key.
apiKeys.openrouterstringundefinedOpenRouter API key.

Timeouts

Timeout durations for LLM calls and tool execution.

KeyTypeDefaultDescription
timeouts.llmMsnumber300000 (5 min)Maximum duration in milliseconds for a single LLM API call.
timeouts.toolMsnumber60000 (1 min)Maximum duration in milliseconds for a single tool execution.
timeouts.skillProbeMaxAgeMsnumber600000 (10 min)Maximum age in milliseconds for cached skill binary probe results. Optional.

Auth

Authentication settings for client/node WebSocket connections.

KeyTypeDefaultDescription
auth.tokenstringundefinedShared secret token for authenticating WebSocket clients and nodes. Optional.

Transcription

Audio-to-text transcription settings for voice messages received from channels.

KeyTypeDefaultDescription
transcription.provider"workers-ai" | "openai""workers-ai"Transcription provider.

System Prompt

KeyTypeDefaultDescription
systemPromptstringundefinedDefault system prompt base text for all agents. When unset, the built-in default is used: "You are a helpful AI assistant running inside GSV." Per-agent overrides are available via agents.list[].systemPrompt.

User Timezone

KeyTypeDefaultDescription
userTimezonestring"UTC"IANA timezone string (e.g. "America/Chicago", "Europe/Amsterdam"). Used in message envelopes, cron scheduling, heartbeat active-hours evaluation, and the system prompt runtime section.

Channels

Per-channel access control and DM policy settings. Each key in the channels object is a channel name (e.g. "whatsapp", "discord").

KeyTypeDefaultDescription
channels.<name>.dmPolicy"open" | "allowlist" | "pairing"See belowDM access policy for the channel.
channels.<name>.allowFromstring[][]List of allowed sender IDs. Supports E.164 phone numbers, WhatsApp JIDs, and a "*" wildcard.

Default Channel Configuration

ChanneldmPolicyallowFrom
whatsapp"pairing"[]
discord"open"[]

Channels not listed in the config default to allowing all senders.

DM Policy Values

ValueBehavior
"open"Any sender can message. No access control.
"allowlist"Only senders in allowFrom can message. Others are silently blocked.
"pairing"Senders in allowFrom can message. Unknown senders trigger a pairing request that must be approved via CLI.

Sender ID Normalization

Sender IDs are normalized to E.164 format for comparison. WhatsApp JID suffixes (@s.whatsapp.net, @c.us), device suffixes (:0), and non-digit characters are stripped. A + prefix is added to numbers with 10 or more digits.


Session

Session lifecycle and routing configuration.

KeyTypeDefaultDescription
session.defaultResetPolicy.mode"manual" | "daily" | "idle""daily"Auto-reset mode for new sessions.
session.defaultResetPolicy.atHournumber4Hour of day (0-23) for "daily" mode reset.
session.defaultResetPolicy.idleMinutesnumberundefinedMinutes of inactivity before reset in "idle" mode.
session.mainKeystring"main"Canonical session key for the per-agent main session.
session.dmScopeDmScope"main"How direct-message sessions are keyed. See DM Scope values below.
session.identityLinksRecord<string, string[]>{}Maps canonical names to arrays of channel identity strings. Used to route multiple channel identities to a single session.

DM Scope Values

ValueBehavior
"main"All DMs route to the main session.
"per-peer"Each peer gets a separate session.
"per-channel-peer"Each channel+peer combination gets a separate session.
"per-account-channel-peer"Each account+channel+peer combination gets a separate session.

Identity links map multiple channel identities to a canonical name for session routing. Keys are canonical names; values are arrays of identity strings.

Identity strings may be:

  • A bare phone number: "+31628552611" — matches any channel after E.164 normalization.
  • A channel-prefixed identifier: "telegram:123456789" — matches only the specified channel. Channel name comparison is case-insensitive.

Skills

Skill availability and runtime eligibility overrides.

KeyTypeDefaultDescription
skills.entriesRecord<string, SkillEntryConfig>{}Per-skill policy entries, keyed by skill name, directory key, or location path.

SkillEntryConfig

Each entry in skills.entries configures a single skill.

KeyTypeDefaultDescription
enabledbooleanundefinedHard toggle. When false, the skill is hidden from the prompt. When undefined or true, default visibility rules apply.
alwaysbooleanundefinedOverrides skill frontmatter always flag. When true, the skill is always included regardless of runtime requirements.
requiresSkillRequirementsConfigundefinedOverrides skill frontmatter runtime requirements.

SkillRequirementsConfig

KeyTypeDescription
hostRolesstring[]Restrict to hosts with these roles ("execution", "specialized").
capabilitiesstring[]Require all listed capabilities on the same host. Valid values: "filesystem.list", "filesystem.read", "filesystem.write", "filesystem.edit", "text.search", "shell.exec".
anyCapabilitiesstring[]Require at least one of these capabilities on the same host. Same valid values as capabilities.
binsstring[]Require all listed binaries to be available (probe status true) on the selected host.
anyBinsstring[]Require at least one of these binaries on the selected host.
envstring[]Require all listed environment variable keys on the selected host.
configstring[]Require all dotted config paths to resolve to non-empty values in the runtime config.
osstring[]Restrict to hosts matching one of these OS identifiers (e.g. "darwin", "linux"). Comparison is case-insensitive.

Agents

Multi-agent configuration: agent definitions, channel-to-agent bindings, and default heartbeat settings.

KeyTypeDefaultDescription
agents.listAgentConfig[][]List of agent configurations.
agents.bindingsAgentBinding[][]Rules mapping channels/chats to specific agents.
agents.defaultHeartbeatHeartbeatConfigSee belowDefault heartbeat configuration applied to all agents.

AgentConfig

Each entry in agents.list defines an agent.

KeyTypeDefaultDescription
idstringAgent identifier. Required.
defaultbooleanfalseWhether this is the default agent. The first agent with default: true is used when no binding matches. If no agent is marked default, "main" is used.
model.providerstringInherits top-level model.providerLLM provider override for this agent.
model.idstringInherits top-level model.idModel ID override for this agent.
systemPromptstringInherits top-level systemPromptSystem prompt base text override for this agent.
heartbeatHeartbeatConfigInherits agents.defaultHeartbeatHeartbeat configuration override for this agent.

AgentBinding

Bindings route inbound channel messages to a specific agent based on match criteria. Bindings are evaluated in order; the first match wins.

KeyTypeDescription
agentIdstringAgent ID to route to. Required.
match.channelstringChannel name to match (e.g. "whatsapp", "discord"). Optional.
match.accountIdstringAccount ID to match (for multi-account channels). Optional.
match.peer.kind"dm" | "group"Peer kind to match. Optional.
match.peer.idstringPeer ID to match. Optional.

All match fields are optional. Omitted fields match any value.

HeartbeatConfig

KeyTypeDefaultDescription
everystring"30m"Interval between heartbeats. Duration string (e.g. "30m", "1h", "2h30m"). "0" or "0m" disables heartbeats.
promptstring"Read HEARTBEAT.md if it exists in your workspace. Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK."Custom prompt injected when a heartbeat fires.
target"last" | "none" | string"last"Delivery target for heartbeat responses. "last" sends to the last active channel. "none" discards the response. Any other string is treated as a specific channel name.
activeHours.startstring"08:00"Start of active hours in HH:MM format. Heartbeats are skipped outside active hours.
activeHours.endstring"23:00"End of active hours in HH:MM format.
activeHours.timezonestringundefinedTimezone for active hours evaluation. "user" uses userTimezone, "local" uses system local time, or specify an IANA zone. Optional.

Duration String Format

Duration strings support hours (h), minutes (m), and seconds (s) components. They can be combined: "2h30m", "1h", "30m", "90s". The value "0" or "0m" parses to 0 milliseconds.


Compaction

Automatic context compaction settings. Compaction summarizes older messages when the conversation approaches the model's context window limit.

KeyTypeDefaultDescription
compaction.enabledbooleantrueWhether automatic context compaction is enabled.
compaction.reserveTokensnumber20000Token headroom reserved below the context window for the model's response and system prompt.
compaction.keepRecentTokensnumber20000Estimated token budget for recent messages kept verbatim (not summarized).
compaction.extractMemoriesbooleantrueWhether to extract durable memories to the daily memory file during compaction.

Cron

Cron job scheduler configuration.

KeyTypeDefaultDescription
cron.enabledbooleantrueWhether the cron scheduler is active.
cron.maxJobsnumber200Maximum number of cron jobs.
cron.maxRunsPerJobHistorynumber200Maximum number of run history entries retained per job.
cron.maxConcurrentRunsnumber4Maximum number of cron jobs executing concurrently.

Configuration Merging

User-provided configuration is a deep-partial type (GsvConfigInput). The mergeConfig function deep-merges overrides onto the default config:

  • Objects are merged recursively.
  • Arrays in overrides replace the base array entirely.
  • Primitives (string, number, boolean) in overrides replace the base value.
  • undefined values in overrides are ignored (base value preserved).