Config schema, example config and validating loader
config/schema.json mirrors design §5 (terminals, executors, projects with routing, retry, timeouts). agentd/config.py loads YAML, validates with jsonschema when available or a small built-in draft-07 subset, adds cross-reference checks, and maps token_key to the environment variable injected by agent-access exec.
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
# plane-agentd example configuration (design.md §5). Values that are secrets are *Vault key names* only;
|
||||
# agentd reads the token from the environment variable of the same name, injected by
|
||||
# agent-access.py exec --secret-env PLANE_WINDOW10_API_TOKEN=PLANE_WINDOW10_API_TOKEN ...
|
||||
# Copy to config/agentd.local.yaml (git-ignored) or point AGENTD_CONFIG at your file.
|
||||
plane: {base_url: https://plane.kappiee.com, workspace: kappiee}
|
||||
vault: {client: ~/.local/share/server-access-client/agent-access.py, config: https://nas.tail9531b.ts.net:8443/identity/agent.json}
|
||||
|
||||
agentd:
|
||||
state_dir: state # relative to the repo root; JSON state, logs, heartbeat, local run dirs
|
||||
helpers_dir: /home/ubuntu/Documents/wjj/project/gwent-design/tools # win10-ps.sh / win10-put.sh
|
||||
interval: 120 # seconds between ticks in --loop mode
|
||||
max_rounds_per_thread: 8 # rebuild the executor thread (with a handoff summary) after this many rounds
|
||||
comment_max_chars: 6000
|
||||
cli_terminal: oregon # identity used by `agentd new/comment/state/assign`
|
||||
|
||||
terminals:
|
||||
win10:
|
||||
transport: warpgate-ssh
|
||||
target: win10
|
||||
os: windows
|
||||
launch: schtasks
|
||||
repo: 'C:\Users\Administrator\Documents\GwentAssistantProject\gwent'
|
||||
run_root: 'C:\Users\Administrator\Documents\GwentAssistantProject\gwent\runtime\agentd'
|
||||
bins: {codex: 'C:\Users\Administrator\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe'}
|
||||
plane_user: window10
|
||||
token_key: PLANE_WINDOW10_API_TOKEN
|
||||
concurrency: 1
|
||||
busy_processes: [codex] # do not start while a codex.exe we did not start is running
|
||||
capabilities: [android, game]
|
||||
executors: [codex]
|
||||
oregon:
|
||||
transport: local
|
||||
os: linux
|
||||
launch: subprocess
|
||||
repo: /home/ubuntu/Documents/wjj/project/gwent
|
||||
plane_user: oregon
|
||||
token_key: PLANE_OREGON_API_TOKEN
|
||||
concurrency: 2
|
||||
bins: {claude: /home/ubuntu/.local/bin/claude} # cron has a minimal PATH
|
||||
executors: [claude-code, codex, shell]
|
||||
|
||||
executors:
|
||||
codex:
|
||||
adapter: codex
|
||||
run: "codex exec --json -C '{repo}' -s workspace-write -m {model} -c 'model_reasoning_effort=\"{effort}\"' {tier} -o '{out}' -"
|
||||
resume: "codex exec resume {thread} --json -m {model} -c 'model_reasoning_effort=\"{effort}\"' {tier} -o '{out}' -"
|
||||
tier_arg: "-c 'service_tier=\"{tier}\"'"
|
||||
thread_from: events.jsonl:thread.started.thread_id
|
||||
last_message: '{out}'
|
||||
models: [gpt-6.1-sol, gpt-6-astra]
|
||||
default_effort: medium
|
||||
claude-code:
|
||||
adapter: claude-code
|
||||
run: "claude -p --model {model} --output-format json --permission-mode {perm}"
|
||||
resume: "claude -p --resume {thread} --model {model} --output-format json --permission-mode {perm}"
|
||||
permission_mode: acceptEdits
|
||||
thread_from: json:session_id
|
||||
last_message: json:result
|
||||
models: [sonnet, opus, haiku]
|
||||
shell:
|
||||
adapter: shell
|
||||
run: '{script}'
|
||||
resume: false
|
||||
|
||||
projects:
|
||||
GWENT:
|
||||
id: 79cb5a60-aa4f-4138-9864-1dd70426e665
|
||||
key_prefix: GW
|
||||
webhook_secret_key: PLANE_WEBHOOK_GWENT
|
||||
states: {backlog: Backlog, todo: Todo, running: In Progress, waiting: Waiting, review: Review, done: Done}
|
||||
reviewer: oregon # Plane user that gets [review] items
|
||||
answerer: oregon # Plane user that gets [question]/[blocked] and failures (default: reviewer)
|
||||
protocol_file: /home/ubuntu/Documents/wjj/project/gwent/design/board-protocol.md
|
||||
routing:
|
||||
by_assignee: {window10: win10, oregon: oregon}
|
||||
by_label:
|
||||
'model:astra': {model: gpt-6-astra, effort: high}
|
||||
'model:sol': {model: gpt-6.1-sol, tier: fast}
|
||||
'model:opus': {model: opus}
|
||||
'exec:claude': {executor: claude-code}
|
||||
'needs-game': {serialize_group: game}
|
||||
default_executor: {win10: codex, oregon: claude-code}
|
||||
retry:
|
||||
transient_max: 3
|
||||
backoff_minutes: [2, 5, 10]
|
||||
# transient_patterns / env_patterns default to the built-in lists in agentd/core.py
|
||||
timeout_hours: 4
|
||||
max_rounds_per_thread: 8
|
||||
notify: {ntfy_topic: gwent, 'on': [waiting, review, failed]} # phase 3, not used yet; 'on' must be quoted (YAML 1.1 boolean)
|
||||
@@ -0,0 +1,145 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "plane-agentd configuration",
|
||||
"type": "object",
|
||||
"required": ["plane", "terminals", "executors", "projects"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"plane": {
|
||||
"type": "object",
|
||||
"required": ["base_url", "workspace"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"base_url": {"type": "string"},
|
||||
"workspace": {"type": "string"},
|
||||
"timeout": {"type": "integer", "minimum": 1}
|
||||
}
|
||||
},
|
||||
"vault": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"client": {"type": "string"},
|
||||
"config": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"agentd": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"state_dir": {"type": "string"},
|
||||
"helpers_dir": {"type": "string"},
|
||||
"interval": {"type": "integer", "minimum": 10},
|
||||
"max_rounds_per_thread": {"type": "integer", "minimum": 1},
|
||||
"comment_max_chars": {"type": "integer", "minimum": 500},
|
||||
"cli_terminal": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"terminals": {"type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/definitions/terminal"}},
|
||||
"executors": {"type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/definitions/executor"}},
|
||||
"projects": {"type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/definitions/project"}}
|
||||
},
|
||||
"definitions": {
|
||||
"strings": {"type": "array", "items": {"type": "string"}},
|
||||
"terminal": {
|
||||
"type": "object",
|
||||
"required": ["transport", "os", "launch", "repo", "plane_user", "token_key", "executors"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"transport": {"enum": ["local", "warpgate-ssh"]},
|
||||
"target": {"type": "string"},
|
||||
"os": {"enum": ["linux", "windows"]},
|
||||
"launch": {"enum": ["subprocess", "nohup", "schtasks"]},
|
||||
"repo": {"type": "string"},
|
||||
"plane_user": {"type": "string"},
|
||||
"token_key": {"type": "string"},
|
||||
"concurrency": {"type": "integer", "minimum": 1},
|
||||
"capabilities": {"$ref": "#/definitions/strings"},
|
||||
"executors": {"type": "array", "items": {"type": "string"}, "minItems": 1},
|
||||
"bins": {"type": "object", "additionalProperties": {"type": "string"}},
|
||||
"run_root": {"type": "string"},
|
||||
"busy_processes": {"$ref": "#/definitions/strings"},
|
||||
"helpers_dir": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"executor": {
|
||||
"type": "object",
|
||||
"required": ["run"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"adapter": {"enum": ["codex", "claude-code", "shell"]},
|
||||
"run": {"type": "string"},
|
||||
"resume": {"type": ["string", "boolean"]},
|
||||
"thread_from": {"type": "string"},
|
||||
"last_message": {"type": "string"},
|
||||
"models": {"$ref": "#/definitions/strings"},
|
||||
"default_effort": {"type": "string"},
|
||||
"permission_mode": {"type": "string"},
|
||||
"tier_arg": {"type": "string"},
|
||||
"script": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"route": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"executor": {"type": "string"},
|
||||
"model": {"type": "string"},
|
||||
"effort": {"type": "string"},
|
||||
"tier": {"type": "string"},
|
||||
"serialize_group": {"type": "string"},
|
||||
"script": {"type": "string"},
|
||||
"timeout_hours": {"type": "number", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"project": {
|
||||
"type": "object",
|
||||
"required": ["id", "states", "reviewer", "routing"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {"type": "string"},
|
||||
"key_prefix": {"type": "string"},
|
||||
"webhook_secret_key": {"type": "string"},
|
||||
"states": {
|
||||
"type": "object",
|
||||
"required": ["todo", "running", "waiting", "review", "done"],
|
||||
"additionalProperties": {"type": "string"}
|
||||
},
|
||||
"reviewer": {"type": "string"},
|
||||
"answerer": {"type": "string"},
|
||||
"protocol_file": {"type": "string"},
|
||||
"intro": {"type": "string"},
|
||||
"routing": {
|
||||
"type": "object",
|
||||
"required": ["by_assignee"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"by_assignee": {"type": "object", "minProperties": 1, "additionalProperties": {"type": "string"}},
|
||||
"by_label": {"type": "object", "additionalProperties": {"$ref": "#/definitions/route"}},
|
||||
"default_executor": {"type": "object", "additionalProperties": {"type": "string"}}
|
||||
}
|
||||
},
|
||||
"retry": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"transient_max": {"type": "integer", "minimum": 0},
|
||||
"backoff_minutes": {"type": "array", "items": {"type": "number", "minimum": 0}, "minItems": 1},
|
||||
"transient_patterns": {"$ref": "#/definitions/strings"},
|
||||
"env_patterns": {"$ref": "#/definitions/strings"}
|
||||
}
|
||||
},
|
||||
"timeout_hours": {"type": "number", "minimum": 0},
|
||||
"max_rounds_per_thread": {"type": "integer", "minimum": 1},
|
||||
"notify": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"ntfy_topic": {"type": "string"},
|
||||
"on": {"$ref": "#/definitions/strings"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user