Appendix: Agent-worker Configuration
Configure named Telegram, LINE, Discord, and Slack workers, credential precedence, runtime paths, transport modes, and local reply behavior.
Audience: Agent operators and integration maintainers
Agent-worker configuration#
.ait/agent-workers.json declares named messaging workers for one AIT Repository. RC.8 supports telegram, line, discord, and slack. The default location can be overridden with AIT_AGENT_CONFIG_PATH.
Read ait-agent-worker: Messaging and Reply Runtime first for the executable's role, complete command surface, message-to-reply path, transport modes, native Codex provider, runtime admission, and security limits. This appendix is the field-by-field authoring reference.
Canonical document shape#
{
"version": 1,
"workers": {
"telegram/support": {
"kind": "telegram",
"name": "support",
"mode": "poll",
"username": "support_bot",
"env_path": ".ait/agent-runtime/telegram.env",
"request_timeout_seconds": 30,
"local_reply": {
"model": "gpt-5.4-mini",
"reasoning_effort": "low",
"sandbox": "workspace-write",
"turn_timeout_seconds": 300
}
}
}
}The author file is the direct version plus workers object shown above. An internal diagnostic projection may wrap it as config; do not write that wrapper into the repository file.
Worker keys use exact <kind>/<name> form. The kind and name must be nonempty, the name must not contain /, and an explicit kind must match the key. version is integer 1 for the current contract. Invalid normalization issues cause worker startup to fail closed.
Common worker fields#
| Field | Type and behavior |
|---|---|
kind | telegram, line, discord, or slack; normally derived from the key. |
name | Nonempty instance name; normally derived from the key. |
runtime_root | Optional path for worker runtime files; default .ait/agent-runtime. Relative paths resolve from the Repository root; ~ uses the process home directory when available. |
sync_state_path | Optional state-file path. Default <runtime_root>/<kind>-<safe-name>-sync.json. |
env_path | Optional credential environment-file path. Default <runtime_root>/<kind>.env. |
web_url | Optional normalized browser base URL associated with replies. |
request_timeout_seconds | Optional positive request timeout. inf, infinite, or none disables supported generic timeouts; Telegram also accepts null and unlimited. |
local_reply | Optional local reply-provider object, documented below. |
created_at, updated_at | Command-managed timestamps. |
pid_file, log_file, termination_context_path | Command-managed lifecycle paths when present; do not use them to configure reply behavior. |
The runtime target is derived from .ait/config.json: solo_local runs locally; a remote workflow requires a valid default remote URL. The Repository default_model supplies the Telegram model fallback when no worker model is set.
Credential sources and precedence#
Credential fields must be nonempty strings. Resolution order is:
- the worker entry;
- the current process environment;
- the worker
env_pathfile.
Other behavior fields come from the worker entry or their compiled default; the env file does not override them. Environment files accept KEY=VALUE lines, blank lines, # comments, and one matching pair of single or double quotes around a value. They are not shell scripts.
Keep secrets out of a committed manifest. Prefer an owner-readable env file or the process environment, and use the exact variable names in the environment appendix.
local_reply#
Unknown fields in this nested object are rejected.
| Field | Contract |
|---|---|
program | Optional nonempty reply-provider executable. |
args | Optional array of strings without NUL characters. |
timeout_seconds | Optional finite positive number. |
append_turn_analysis | Optional boolean. |
codex_program | Optional nonempty Codex executable override. |
model | Optional nonempty model name. |
reasoning_effort | none, minimal, low, medium, high, xhigh, max, or ultra. |
sandbox | read-only, workspace-write, or danger-full-access. |
turn_timeout_seconds | Positive number, numeric string, or inf, infinite, none, or unlimited. |
Sandbox choice is an execution boundary, not a messaging preference. Grant only the access required by the worker's Repository task.
Telegram fields#
| Field | Contract and default |
|---|---|
token | Required bot token, or supply AIT_TELEGRAM_BOT_TOKEN/BOT_TOKEN. |
username | Optional; a leading @ is removed. |
mode | poll (default) or webhook. |
bind_host / bind_port | Webhook listener; defaults 127.0.0.1 and 8090. |
webhook_path | HTTP path; default /webhook. |
webhook_secret | Optional secret or AIT_TELEGRAM_WEBHOOK_SECRET. |
poll_timeout_seconds | Integer at least 5; default 45. |
background_sync_enabled | Boolean; default false. |
background_sync_interval_seconds | Number at least 5; default 30. |
openai_api_key | Optional worker credential; placeholder values are rejected. |
openai_base_url | Optional normalized base URL; default https://api.openai.com/v1. |
openai_model | Optional model; falls back to the Repository default model, then gpt-5.4-mini. |
openai_reasoning_effort | Optional string; default low. |
openai_timeout_seconds | Optional positive timeout; inherits the request timeout when omitted. |
openai_max_output_tokens | Integer at least 64; default 700. |
turn_merge_window_seconds | Nonnegative number; default 0.35. |
turn_merge_max_messages | Positive integer; default 4. |
decoupled_reply_enabled | Boolean; default true. |
reply_markdown_enabled | Boolean; default true. |
owner_bootstrap_enabled | Boolean; default true. |
stt_mode | off (default) or local-stt. |
stt_model | Local speech-to-text model name. |
stt_device | Device selector; default auto. |
stt_compute_type, stt_language | Optional strings. |
stt_include_audio_uploads | Boolean; default false. |
stt_program | Optional local speech-to-text executable path. |
stt_timeout_seconds | Positive number from 0.1 through 3600; default 120. |
expected_concurrent_workers, workers_per_shard | Optional positive integers. |
event_loop_backend | Optional backend string. |
LINE fields#
| Field | Contract and default |
|---|---|
token | Required channel access token, or AIT_LINE_CHANNEL_ACCESS_TOKEN/LINE_CHANNEL_ACCESS_TOKEN. |
secret | Required channel secret, or AIT_LINE_CHANNEL_SECRET/LINE_CHANNEL_SECRET. |
api_base_url | Default https://api.line.me. |
bind_host / bind_port | Defaults 127.0.0.1 and 8091. |
webhook_path | Default /callback. |
Discord fields#
| Field | Contract and default |
|---|---|
application_id | Required string, or AIT_DISCORD_APPLICATION_ID/DISCORD_APPLICATION_ID. |
public_key | Optional credential for interaction verification. |
bot_token | Optional credential for gateway or API use. |
turn_timeout_seconds | Optional positive timeout; default is at least 300 seconds when request timeout is set. |
api_base_url | Default https://discord.com/api/v10. |
http_user_agent | Default curl/8.7.1. |
bind_host / bind_port | Defaults 127.0.0.1 and 8092. |
interaction_path | Default /interactions. |
The selected worker command determines whether public_key, bot_token, or both are required for that service mode.
Slack fields#
| Field | Contract and default |
|---|---|
app_token | Optional credential for socket mode. |
signing_secret | Optional credential for HTTP command verification. |
api_base_url | Default https://slack.com/api. |
http_user_agent | Default ait-agent-worker/0.1. |
bind_host / bind_port | Defaults 127.0.0.1 and 8093. |
command_path | Default /command. |
ack_text | Default ait is thinking.... |
response_type | Default in_channel. |
The selected Slack command determines whether socket credentials or an HTTP signing secret is mandatory.
Verification#
Use the agent-worker inspection and launch commands from the complete CLI reference. Diagnostic output reports only whether credentials are set; it does not print their values. Test webhook listeners on loopback before exposing them through a trusted reverse proxy.