Skip to content

Latest commit

History

History
443 lines (361 loc) · 21.7 KB

File metadata and controls

443 lines (361 loc) · 21.7 KB

Configuration reference

The agents.yaml schema. Every field below is sourced from the Zod schema in packages/sdk/src/internal/parser/schema.ts and the config types in packages/sdk/src/internal/types/config.ts. For a tutorial, see Configure an agent.

Top-level structure

version: "1"providers: { <name>: <provider-config> }defaults:
provider: <name> | "all"identity: <identity-name>environments: { <name>: EnvironmentDecl }tunnels: { <name>: TunnelDecl }vaults: { <name>: VaultDecl }memory_stores:{ <name>: MemoryStoreDecl }skills: { <name>: SkillDecl }files: { <name>: FileDecl }identities: { <name>: IdentityDecl }agents: { <name>: AgentDecl }channels: { <name>: ChannelDecl }deployments: { <name>: DeploymentDecl }
FieldTypeRequiredDescription
versionstringyesSchema version. Currently "1".
providersmapyesOne block per provider; each holds its credentials.
defaults.providerstringnoDefault target for plan/apply. all targets every declared provider.
defaults.identitystringnoLogical name of the default declared Identity used by identity-aware resources and Forward Sessions.
environmentsmapnoCloud runtimes.
tunnelsmapnoExisting Qoder BYOC tunnels referenced by sessions; OpenCMA does not manage their lifecycle.
vaultsmapnoCredential stores.
memory_storesmapnoPersistent agent context (Qoder, Volcengine Ark).
skillsmapnoReusable capability modules.
filesmapnoLocal files uploaded to the Files API (Bailian, Volcengine Ark).
identitiesmapnoStable end-user identities. Provider support is capability-gated.
agentsmapnoThe core managed-agent resources.
channelsmapnoExternal messaging channels bound to an Identity and Agent. Provider support is capability-gated.
deploymentsmapnoRepeatable run units.

Secrets use ${VAR_NAME} and resolve from .env (walking up to the project root). agents init appends agents.state.json and .env to .gitignore.

Identity

Managed identities use the integrating product's stable end-user id:

identities:
chen:
provider: qoderexternal_id: user_456name: Chenenabled: truemetadata:
department: engineering

agents apply creates or updates the remote Identity and stores its provider id in state. To reference an Identity managed outside this project, use the mutually exclusive external-reference form:

identities:
chen:
provider: qoderidentity_id: idn_019eabc123

External references are verified and recorded but never updated or deleted.

Channel

channels:
support-dingtalk:
provider: qoder # optional; inherits defaults.provideragent: support-agent # required for mode: fixed; ignored for mode: pairingidentity: chen # optional; inherits defaults.identity. ignored for mode: pairingtype: dingtalkmode: fixed # optional; defaults to fixedname: Support DingTalk # optional; defaults to the YAML keyenabled: true # optional; defaults to truecredentials:
client_id: ${DINGTALK_CLIENT_ID}client_secret: ${DINGTALK_CLIENT_SECRET}options:
include_tool_calls: falseinclude_thinking: false
FieldTypeRequiredDescription
providerstringnoProvider name; inherits defaults.provider.
agentstringconditionalLogical Agent name. Required for fixed mode; ignored for pairing mode.
identitystringconditionalLogical Identity name; inherits defaults.identity. Required for fixed mode; ignored for pairing mode.
typestringyesProvider-specific channel type. Qoder supports dingtalk, feishu, and wecom; wechat is QR-only.
modefixed | pairingnofixed (default) binds the channel to one Identity/Template. pairing creates a transport-only channel for Schedules/Sinks.
namestringnoDisplay name; defaults to the YAML key.
enabledbooleannoDefaults to true.
credentialsmapconditionalProvider-specific credentials. Required for credential-based channel types.
optionsmapnoProvider-specific response options, e.g. include_tool_calls, include_thinking.

The declaration intentionally uses logical agent and identity references. Provider adapters resolve remote ids and map type, credentials, and options to provider wire fields. Qoder Channels in fixed mode require the referenced Agent to use Forward delivery. pairing mode omits Identity/Template binding and is intended for Schedule sinks such as scheduled group broadcasts. Credential-based Qoder support currently covers DingTalk, Feishu, and WeCom; personal WeChat remains QR-only.

Managed tool config

managed_tool_config declares the provider-operated tools an Agent Harness runs itself, rather than tools the model calls through the sandbox. Schedule management is the current use: enabling create_forward_schedule, list_forward_schedules, and delete_forward_schedule lets an end user create and cancel Schedules in natural language from a Web or IM Channel conversation.

enabled_tools replaces the provider's whole enabled set, so an empty array turns every managed tool off. Omitting the field entirely sends nothing: because Qoder Forward Template updates are merge-style, an undeclared field leaves whatever the remote Template already had. Declare it whenever the tools matter — a Template recreated from scratch (after a destroy, a manual deletion, or lost state) otherwise comes back with no managed tools and no error.

Provider configuration

Each provider under providers is validated by the provider's own config schema.

Bailian (Aliyun AgentStudio)

FieldTypeRequiredDescription
api_keystringyesDashScope API key.
workspace_idstringyesBailian workspace id (llm-...).
base_urlstringnoOverride the derived endpoint (https://<workspace_id>.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio).

Qoder

FieldTypeRequiredDefaultDescription
api_keystringyesQoder PAT.
gatewaystringnohttps://api.qoder.com/api/v1/cloudCloud gateway base URL.

Claude

FieldTypeRequiredDescription
api_keystringyesAnthropic API key.
betastringnoOptional anthropic-beta header value.

Volcengine Ark (Managed Agents)

FieldTypeRequiredDescription
api_keystringyesVolcengine Ark API key.

Environment

environments:
<name>:
name: <string> # optionaldescription: <string> # optionalprovider: <string> # optional; pin to one providerenvironment_id: <string> # optional; reference an existing provider environment without managing itconfig:
type: cloud | self_hostednetworking: { ... }packages: { ... }setup_script: <string>metadata: { <key>: <string> }
FieldTypeRequiredDescription
environment_idstringnoExisting environment ID. When present, OpenCMA never creates, updates, or deletes the remote environment. Removing this line later is blocked as an ownership error — release first with agents state rm (see Use BYOC environments).
config.type"cloud" | "self_hosted"yesEnvironment type. self_hosted is used for Qoder BYOC.
config.networking.type"unrestricted" | "limited"noNetwork policy.
config.networking.allow_mcp_serversbooleannoAllow outbound MCP.
config.networking.allow_package_managersbooleannoAllow package managers.
config.networking.allowed_hostsstring[]noAllow-list for limited networks.
config.packages.apt | pip | npm | cargo | gem | gostring[]noPreinstalled packages.
config.setup_scriptstringnoSandbox setup script. Qoder runs it with /bin/bash -lc after package installation; maximum UTF-8 size is 64 KB. Other providers currently reject this field.
metadatamap<string,string>noFree-form metadata.

Qoder accepts only apt, npm, and pip in package requests. Its API may return empty cargo, gem, and go arrays as reserved response fields, but declaring non-empty values for them is rejected locally. Setup scripts run while a new sandbox is prepared, time out after 10 minutes, and a non-zero exit prevents the Session from starting. Keep scripts idempotent and use vault-backed credentials instead of embedding secrets.

For a managed Qoder self_hosted environment, config accepts only type and optional setup_script; networking and packages belong to cloud environments. External environment_id references remain unmanaged.

Tunnel (Qoder BYOC)

tunnels:
internal-network:
tunnel_id: tnl_00xxxx

Tunnels are existing Qoder resources allocated by the BYOC administrator. They are passed only when a Qoder session/deployment is created and are never created, updated, or deleted by OpenCMA. See Use BYOC environments for a complete setup and lifecycle guide.

Vault

vaults:
<name>:
display_name: <string>provider: <string> # optionalcredentials: [ CredentialDecl ]metadata: { <key>: <string> }

CredentialDecl is a discriminated union on type:

static_bearer

FieldTypeRequiredDescription
namestringyesCredential name.
type"static_bearer"yes
mcp_server_urlstringyesMCP server URL.
access_tokenstringyesBearer token (string or number, coerced).
protocol"sse" | "streamable_http"noMCP transport.

environment_variable

FieldTypeRequiredDescription
namestringyesCredential name.
type"environment_variable"yes
secret_namestringyesSecret name.
secret_valuestringyesSecret value (string or number, coerced).
networking.type"unrestricted" | "limited"no

Memory store

memory_stores:
<name>:
description: <string>provider: <string> # optionalmetadata: { <string>: <string> } # optionalentries: [ { key: <string>, content: <string> } ]

Supported on Qoder, Claude (beta), and Volcengine Ark (Bailian: unsupported).

Declarative entries are managed seeds: apply creates or updates those paths but preserves additional memories written by agents. Runtime CRUD and version commands are documented in examples/memory/.

Skill

skills:
<name>:
source: <string> # path to skill directorydescription: <string> # optionalversion: <string> # optionalorigin: "custom"| "official" # optionalprovider: <string> # optional

File

files:
<name>:
source: <string>name: <string> # optionalpurpose: <string> # optionalprovider: <string> # optional

Agent

agents:
<name>:
description: <string>model: <string> | { <provider>: <string> }instructions: <string> | <path>environment: <string>tunnel: <string> # optional; Qoder BYOC tunnel nameprovider: <string>tools: { builtin: [...], default_permission: allow, mcp: [...], permissions: {...} }mcp_servers: [ { name, type?, url? } ]skills: [ <string> | { type, skill_id, version? } ]vault: <string>memory_stores: [ <string> ]default_memory_store: # Qoder Forward only; requires defaults.identityname: <string> # 1-255 charactersdescription: <string> # optional; up to 1024 charactersdelete_on_destroy: <boolean> # optional; defaults to false (retain)environment_variables: { <key>: <string> } # Qoder onlymanaged_tool_config: { enabled_tools: [ <string> ] } # Qoder Forward delivery onlyresources: [ SessionResource ]multiagent: { type: "coordinator", agents: [...] }metadata: { <key>: <string> }

Qoder Forward default Memory Store

Qoder creates one writable, system-managed Memory Store for an (Identity, Template) pair when its first Forward Session is created. default_memory_store lets OpenCMA manage the display metadata and destroy policy of that provider-created Store; it does not declare a second, ordinary entry under the top-level memory_stores collection.

defaults:
provider: qoderidentity: support-useridentities:
support-user:
external_id: support-user # managed by OpenCMAagents:
support:
# ...delivery:
qoder:
type: forwarddefault_memory_store:
name: "Support group memory"description: "Confirmed support knowledge and operating rules"delete_on_destroy: false

Apply behavior:

  • Requires Qoder Forward delivery and defaults.identity.
  • Locates the Store mounted as system_managed: true and access: read_write, then idempotently updates its name and optional description.
  • Does not create an initialization Session. Before the first real Session has created the Store, apply reports the reconciliation as pending. Run apply again after a Session exists.
  • name changes the provider Store's display name, so it can be meaningful instead of remaining the provider-generated default.

Destroy behavior:

delete_on_destroyResult
omitted or falseRetain the Store, its Memories, and all version history. This is the default.
truePermanently delete the Store, its Memories, and all version history after its system mount has been removed.

For permanent deletion, OpenCMA captures and persists the Store ID before archiving the Template and deleting the Identity. Qoder may remove the system mount asynchronously, so OpenCMA uses bounded retries for a still mounted conflict. If the conflict remains, it tries archive → delete, matching the lifecycle verified against the live Qoder service. A cleanup that still cannot finish is retained in state and reported as a partial destroy; a later agents destroy resumes it even when all ordinary resources are already gone.

If the preflight cannot resolve the Identity, Template, or Store lookup, destroy aborts before deleting any project resource. Authentication, permission, and non-retryable validation errors fail immediately. --cascade does not override this field.

delete_on_destroy: true requires an OpenCMA-managed Identity. An external identity_id is never deleted by OpenCMA, so it keeps the system Store mounted and fails configuration validation. Permanent deletion is irreversible; keep the default false unless data removal is explicitly required.

FieldTypeRequiredDescription
modelstring | map<provider,string>yesSingle model or a per-provider map.
instructionsstringyesInline text or a path to a file (resolved relative to the config).
environmentstringnoEnvironment name.
tunnelstringnoQoder BYOC tunnel name from tunnels; unsupported for other providers.
providerstringnoPin the agent to one provider.
tools.builtinstring[]yes (in tools)Lowercase tool names.
tools.default_permission"allow" | "ask"noPermission inherited by enabled builtins; defaults to allow.
tools.permissionsmap<string,"allow"|"ask">noCase- and separator-insensitive overrides for enabled builtins. Unknown and duplicate normalized names are rejected.
tools.mcp[]McpToolkitDecl[]noSelect tools from an official MCP server.
mcp_servers[]{ name, type?, url? }noURL (url/http) or official MCP server.
skills[]string | AgentSkillRefnoSkill name or { type: "official"|"custom", skill_id, version? }.
vaultstringnoVault name.
filesstring[]noFile declarations inherited by a Qoder Forward Template. These files are created through the Forward File API.
memory_storesstring[]noBound memory stores.
default_memory_store.namestringyes (with default_memory_store)Display name for Qoder Forward's writable system-managed Store; 1–255 characters.
default_memory_store.descriptionstringnoDisplay description for the system-managed Store; up to 1024 characters.
default_memory_store.delete_on_destroybooleannoPermanently delete the Store during destroy. Defaults to false (retain).
environment_variablesmap<string,string>noQoder runtime variables. Managed Sessions use Qoder's KEY=VALUE;... wire format; Forward Templates store the map as defaults and Forward Sessions send it under config.environment_variables.
managed_tool_config.enabled_toolsstring[]noProvider-operated tools the Agent Harness exposes, e.g. create_forward_schedule, list_forward_schedules, delete_forward_schedule. Qoder Forward delivery only; declaring it on managed delivery is a validation error.
resourcesSessionResource[]noResources attached to every managed Session created for the Agent.
multiagent.type"coordinator"noDeclare a coordinator agent.
multiagent.agentsstring[]yes (with multiagent)Agents it orchestrates.
metadatamap<string,string>noFree-form metadata.

For Qoder Forward delivery, a locally declared Environment is created only through the Forward Environment API. An external environment_id may reference an Environment from either the Managed API or the Forward API; OpenCMA does not create or mutate such a reference and resolves its API domain when checking existence. Referenced custom Skills, Vaults and Credentials, Files, and explicit Memory Stores are created through their Forward APIs. A locally managed Environment, Skill, Vault, File, or Memory Store cannot be shared by Managed and Forward Agents under one logical declaration; declare separate resources for the two API domains. Explicit Forward Memory Stores require defaults.identity and are mounted read-only to that Identity and Template.

Session resources

Qoder and Claude managed Sessions support a provider-neutral GitHub repository resource:

agents:
reviewer:
# ...resources:
- type: github_repositoryurl: https://github.com/acme/private-repo.gitauthorization_token: ${GITHUB_TOKEN}checkout: { branch: main } # or: { commit: <full-sha> }mount_path: /data/workspace/private-repo # optional

Keep authorization_token in .env; never put its value directly in agents.yaml. Qoder mount paths must start with /data/. If the field is omitted for Qoder, OpenAgentPack sends /data/workspace/<repo-name> automatically; for the URL above that is /data/workspace/private-repo. Qoder requires this /data path for the repository mount to take effect. Other providers retain their own path semantics.

Mount roots are provider invariants: Qoder uses /data, Claude uses /workspace, and Bailian and Ark use /mnt. A relative uploaded-file path is resolved under the target root. An explicit absolute path must already use the matching root and is passed through unchanged; OpenAgentPack rejects mismatched absolute paths instead of silently rewriting them. For GitHub Session resources, when the path is omitted Qoder derives /data/workspace/<repo-name> and Claude derives /workspace/<repo-name>.

MCP toolkit (tools.mcp[])

tools:
mcp:
- type: mcp_toolkitmcp_server_name: WebSearch # mcpServerName also accepteddefault_config: { enabled: false } # defaultConfig also acceptedconfigs:
- name: bailian_web_searchenabled: true

Deployment

deployments:
<name>:
agent: <string>agent_version: <number> # optionalenvironment: <string> # optionaltunnel: <string> # optional; Qoder BYOC only (see note below)vaults: [ <string> ]memory_stores: [ <string> ]resources: [ DeploymentResource ]initial_events: [ InitialEvent ] # 1..50schedule: { expression: <cron>, timezone: <tz> }description: <string>provider: <string>metadata: { <key>: <string> }

initial_events is a discriminated union; schedule.expression must be a 5-field cron expression.

Deployment tunnel caveat: Qoder's deployment API does not accept tunnel_id, so the tunnel is dropped from the deployment payload and server-side runs execute without it (validate/plan emits a warning). Use sessions for private-network MCP access; see Use BYOC environments.

Initial events

TypeFields
user.messagecontent
system.messagecontent
user.define_outcomedescription?, rubric? | rubric_file?, max_iterations? (int 1–20)

Deployment resources

TypeFields
filefile_id?, source?, mount_path?
memory_storememory_store, access? (read_write|read_only), instructions?
github_repositoryurl, checkout? (branch/commit), mount_path?, authorization_token?