Skip to content

Watch reference

Flags, defaults, endpoints and error codes for abt watch, the long-running service that auto-dispatches entrypoint workflows from external events (Slack, Jira, GitHub, cron). The abt watch guide covers setup and operation. Kubernetes deployment, leader election and distributed-mode limits are in Deploying to Kubernetes.

abt watch run listens and dispatches in one process (replicas: 1 only). abt watch produce and abt watch consume split this into a leader-elected trigger plane (replicas: N safe) and a competing-consumer execution plane over a Redis Streams queue. abt watch list prints declared triggers without running anything. abt watch dlq lists and replays jobs that a consume --acks-late worker gave up on.

None of the five commands takes -s/--select. run and produce take positional [ENTRYPOINTS]... (workflow names with a trigger: ref in workflows/), or --all, or -t/--tags (every given tag must appear in the workflow's own tags:). Giving none of the three exits with code 2. An unknown name also exits with code 2 and lists the valid entrypoints. consume takes no selector: it runs whatever the queue delivers. A triggers/*.yaml resource is dormant until it sets enabled: true, and list, produce, consume and run skip disabled triggers. See Triggers. A selection that matches no enabled trigger is valid. The watcher logs no active sources and checks again on every reconcile, so a trigger you enable later starts without a restart.

abt watch run --all --health-port 8080
abt watch produce --all --queue redis://localhost:6379 --health-port 8080
abt watch consume --queue redis://localhost:6379 --health-port 8080
abt watch list
abt watch dlq list --queue redis://localhost:6379

abt watch run

Trigger listening and dispatch in one process.

Flag Default Description
[ENTRYPOINTS]... - Positional workflow name(s) to watch
--all - Watch every entrypoint workflow with a trigger: ref
-t/--tags - Only watch entrypoint workflows whose own tags: include every given tag (repeat the flag to require several)
--max-concurrent 5 Max parallel workflow dispatches
--target / --profiles-dir profile default / next to the project profiles.yaml target and location used for every dispatched run (and profile reloads). --target also reads ABT_TARGET
--dispatch-retry-attempts 3 Attempts per dispatch on transient errors (timeouts, connection errors, rate limits, provider overload/5xx; exponential backoff). Other workflow errors fail immediately. Also reads ABT_WATCH_DISPATCH_RETRY_ATTEMPTS
--cooldown 30s Ignore duplicate events for the same workflow and thread for this duration
--reconcile-interval 60s How often to re-compile the manifest for changes
--partial-parse/--no-partial-parse --no-partial-parse Use partial_parse cache during reconcile
--health-port - Port for the health endpoint (K8s probes)
--max-reconcile-failures 3 Consecutive reconcile failures tolerated before liveness flips unhealthy
--shutdown-timeout 30s Seconds to wait for in-flight dispatches on SIGTERM

Duplicate events match on the key {workflow_name}:{source_type}:{scope_id}:{thread_id}:{event_id} within --cooldown.

Checkpoint threads. A triggered dispatch runs with --thread-id {source_type}:{scope_id}:{thread_id}, which is the dedup key without the workflow name and event_id. For Slack this matches the key the slack_thread source derives (slack:C0123:1699.0001). A reaction_added event keeps its own event_ts as event_id, so adding, removing and re-adding one reaction count as three events. The thread-root lookup runs after the trigger's filters and calls conversations.replies. Its scopes are listed in Slack integration. If the lookup fails, the reaction dispatches with the reacted message's ts as its thread. The CLI flag is the top layer of thread-id resolution, so it outranks a checkpoint.thread_id pinned in YAML.

Concurrent dispatches. Dispatches share one workspace (target/, logs/abt.log) and can overlap, including dispatches with different vars:. Each run reads its own manifest and context files, which are replaced atomically. The watch service owns the single logs/abt.log.

Source restarts. When an event source stream raises an error, the runner restarts it after 5 seconds, then 10, then 20, capped at --reconcile-interval. After three restarts in a row, the source is dropped until the next reconcile re-adds it. A successful event resets the counter. The Slack poll fallback (used without app_token) tracks errors per channel and sleeps for the worst channel's error count.

Reconcile. Changes to agent and workflow files are picked up at the next reconcile. A lower --reconcile-interval picks them up sooner, at the cost of more compile work.

abt watch produce

Trigger plane only. It runs the sources and publishes dispatch requests to the queue, and it never dispatches a workflow itself. Needs the queue extra.

Flag Default Description
[ENTRYPOINTS]... - Positional workflow name(s) to trigger
--all - Trigger every entrypoint workflow with a trigger: ref
-t/--tags - Only trigger entrypoint workflows whose own tags: include every given tag (repeat the flag to require several)
--queue - Queue URL, e.g. redis://host:6379. Also reads ABT_WATCH_QUEUE. Required
--target / --profiles-dir profile default / next to the project profiles.yaml target and location used for every dispatched run (and profile reloads). --target also reads ABT_TARGET
--cooldown 30s Seconds to suppress duplicate events for the same workflow and thread. Dedup happens here, before publish
--reconcile-interval 60s Seconds between manifest reconciliation checks
--partial-parse/--no-partial-parse --no-partial-parse Use partial_parse cache during reconcile
--health-port - Port for the health endpoint (K8s probes)
--max-reconcile-failures 3 Consecutive reconcile failures before inner.healthy turns false (the status stays 200, see Health endpoint)
--replica-group derived Lease key for leader election. Defaults to a name derived from the entrypoint names, --tags or --all, so unrelated watch produce fleets contend for different leases
--lease-seconds 15.0 Leadership lease duration. Only one replica runs sources at a time; others stand by
--stream-maxlen 10000 Approximate cap on the dispatch stream. A larger cap survives longer worker downtime before trimming undelivered entries, at the cost of Redis memory. Once that many entries wait unread, every publish emits [WATCH_METRIC] {"event":"queue_overflow","unread":N,"maxlen":M}: the stream is about to drop the oldest unread jobs. The producer also logs unread entries reached the stream cap, at most once a minute. Alert on the metric

Publish retries. A publish is attempted three times, waiting 0.5 seconds and then 1 second between attempts (about 1.5 seconds in total). After the last attempt, the event is dropped and its dedup claim is released, so a redelivery is processed.

abt watch consume

Execution plane. It reads the queue and runs each request through abt dispatch. Consumers take no selector, no manifest preload and no trigger credentials. Needs the queue extra.

Flag Default Description
--queue - Queue URL, e.g. redis://host:6379. Also reads ABT_WATCH_QUEUE. Required
--target / --profiles-dir profile default / next to the project profiles.yaml target and location used for every dispatched run (and profile reloads). --target also reads ABT_TARGET
--max-concurrent 5 Max parallel agent dispatches
--dispatch-retry-attempts 3 Attempts per agent dispatch on transient integration errors (exponential backoff); 1 under --acks-late. Also reads ABT_WATCH_DISPATCH_RETRY_ATTEMPTS
--shutdown-timeout 30s Seconds to wait for in-flight dispatches on shutdown
--acks-late/--no-acks-late --no-acks-late Ack when the agent's run finishes instead of on read (Celery's acks_late=True): a crashed or evicted worker's job is redelivered to another worker. The default is fire-and-forget (cheaper; a mid-run crash loses the job). Set it the same way on every consume replica sharing a queue. Also reads ABT_WATCH_ACKS_LATE
--max-deliveries 5 --acks-late only: after this many redelivery attempts, dead-letter to <queue>:dlq instead of retrying forever
--reclaim-idle-seconds 300 --acks-late only: how long a worker may go silent before another worker reclaims its job. A live worker refreshes its running jobs every third of this, so a run may outlast it. Must be greater than 0; keep it above 60 seconds: more than 1.5 times the longest stall of a worker's event loop (30 seconds) plus Redis latency, and the invoke lease
--completed-ttl-seconds 600 --acks-late only: how long the duplicate-skip marker survives after an agent run finishes. Must be greater than --reclaim-idle-seconds, or the marker can expire before a redelivered duplicate checks it
--hygiene-interval 300s Seconds between queue hygiene sweeps (ghost-entry GC, idle consumer cleanup, --acks-late reclaim of orphaned jobs). The first sweep runs immediately on startup, so a replacement worker reclaims its predecessor's orphaned jobs right away
--prune-run-results/--no-prune-run-results on Master switch for target/run_results/ retention. On by default, because nothing else deletes these directories. Turn it off to keep every run's artifacts.
--keep-runs 20 Keep at least the N most recent run directories.
--keep-failed-runs 10 Always keep this many most-recent failed runs, even past --keep-runs and the age limit.
--run-results-max-age-hours 24 Also keep any run directory younger than this, even beyond --keep-runs.
--run-results-max-total-mb 512 Hard ceiling on total run_results size. Unlike the other limits, this one evicts: once survivors exceed it, the oldest are deleted even if the other limits would keep them. A run still in flight is never evicted. The default assumes run_results shares a few-GB disk with your checkout and packages.
--reclaim-repos-cache/--no-reclaim-repos-cache on Delete a finished run's repos/ git checkouts, immediately when its dispatch ends and again on each sweep. This is where nearly all reclaimed space comes from: the checkouts are large and re-clonable, while run.log and run_results.json are small evidence kept under the retention limits.
--run-results-sweep-interval 60s Seconds between retention sweeps. Separate from --hygiene-interval, so tuning queue reclaim timing leaves the disk-fill rate unchanged.
--health-port - Port for the health endpoint (K8s probes). Also the HTTP port for --serve-api, which requires it
--serve-api off Serve the agent invoke API on --health-port. Needs the serve extra. The guide shows an example
--invoke-token-env ABT_INVOKE_TOKEN Env var holding the bearer token the invoke API requires. Unset or empty refuses to start
--invoke-max-queue-lag 1000 The invoke API answers 429 while this many entries wait unread on the dispatch stream. Size it to what your workers drain in a few minutes. Also reads ABT_WATCH_INVOKE_MAX_QUEUE_LAG
--invoke-run-ttl-seconds 86400 How long a run (result included) stays pollable after it last changed state. Also reads ABT_WATCH_INVOKE_RUN_TTL_SECONDS
--invoke-max-run-seconds 3600 Wall-clock ceiling for one invoked agent run this worker executes, with or without --serve-api. A run over it is cancelled and recorded as failed. A backstop behind the agent's own run_timeout. Set it the same on every replica. Also reads ABT_WATCH_INVOKE_MAX_RUN_SECONDS
--insecure-no-invoke-auth off Serve the invoke API without a bearer token: any caller that can reach the port can run public agents. Use it only behind a strict NetworkPolicy
--worker-id <hostname>-<pid> Consumer identity for the queue. Rarely needed: the default is already unique across k8s pods, docker-compose replicas and bare processes on one host

Retention. Each target/run_results/<run_id>/ directory is pruned every --run-results-sweep-interval seconds. Each finished job's repos/ checkout is reclaimed when it ends (--reclaim-repos-cache). The limits combine as follows: --keep-runs and --keep-failed-runs set minimums, --run-results-max-age-hours keeps anything younger, and --run-results-max-total-mb deletes the oldest runs once the total is over budget, even when the other limits would keep them. The limits apply only while pruning is on. Each flag overrides the matching key of config.watch.retention in abt.yaml, which overrides the defaults above:

config:
  watch:
    retention:
      prune: true                  # --prune-run-results
      keep_runs: 20                # --keep-runs
      keep_failed_runs: 10         # --keep-failed-runs
      max_age_hours: 24            # --run-results-max-age-hours
      max_total_mb: 512            # --run-results-max-total-mb
      reclaim_repos_cache: true    # --reclaim-repos-cache
      sweep_interval_seconds: 60   # --run-results-sweep-interval

consume reads this block straight from abt.yaml at startup, without compiling, so a var() in it is not rendered.

Redelivery. A redelivered run has delivery_count of 2 or more on its [WATCH_METRIC] {"event":"dispatch_completed",...} line. A job that exhausts --max-deliveries moves to the <queue>:dlq stream. The consumer logs no line for the reclaim itself, so check delivery_count to spot one.

Embedded workers. A worker built with the SDK (abt.sdk.watch.worker(...)) keeps every run directory unless you pass run_retention=RunRetentionPolicy(...). The guide shows an example.

abt watch dlq

Inspects and replays the dead-letter stream <queue>:dlq, where a consume --acks-late worker parks a job after --max-deliveries. Needs the queue extra and a reachable queue.

Command Description
abt watch dlq list One line per entry, oldest first: DLQ entry id, target workflow, delivery count, reason and the original stream id. --limit (default 50) caps the output
abt watch dlq replay --id ID Requeue the named entries. Repeat --id for several. Exits 1 if a named entry was not replayed
abt watch dlq replay --all Requeue every entry, oldest first. --limit N caps how many

Both take --queue (also reads ABT_WATCH_QUEUE). A replayed job is published to the dispatch stream before it is deleted from the dead-letter stream, so a crash in between leaves a duplicate and never a lost job. It gets a fresh delivery count and so a full --max-deliveries budget. An invoke-API run is skipped with a reason: the worker already marked its run failed, and requeuing it would do nothing, so resubmit it to the API. Two operators replaying the same entry at once can requeue it twice.

abt watch list

Lists every trigger declared across workflows: type, workflow, config, vars: binding and enabled state. It reads only the compiled manifest, so it needs no credentials or network access. Authentication and event delivery are checked when abt watch run or abt watch produce starts.

Flag Default Description
--project-root . Project root containing workflows/ and triggers/
1 trigger(s) — what `abt watch produce` / `abt watch run` register:
support_slack  [slack] (enabled) → workflow triage_request  (triggers/support_slack.yaml)
    config: {'channel_ids': ['C0MOCK00004'], 'poll_interval_seconds': 5, 'events': ['message']}
    vars: {'channel_id': '{{ event.scope_id }}', 'thread_ts': '{{ event.thread_id }}'}

Health endpoint

--health-port starts an HTTP server. Every path answers a JSON payload. run and consume answer 200 when healthy and 503 when unhealthy. produce answers differently, as described below. This is the run payload:

{
  "healthy": true,
  "sources": 3,
  "in_flight": 1,
  "last_reconcile_ago_s": 12.3,
  "last_reconcile_ok": true,
  "consecutive_reconcile_failures": 0,
  "running": true
}

run returns 503 when:

  • Reconcile has failed --max-reconcile-failures (default 3) consecutive times. Failures below that threshold are tolerated, so one MCP hiccup or GitHub rate limit leaves the pod running.
  • The last successful compile is older than 2.5 × --reconcile-interval.
  • The runner is shutting down (running: false).

consume returns 503 when it is shutting down or has failed, and after 5 consecutive failed queue reads (retried about once a second). A success resets the count. A streak counts only while its latest failure is under a minute old, so an idle pod turns healthy again after the queue recovers.

produce. It returns 503 only when the process is stopping or its runner crashed or failed to start (last_error is set). Standby replicas and leaders otherwise answer 200. The payload has healthy, running, leader, group, holder_id and last_error. A leader adds the runner's own payload under inner: the fields shown above for run, plus the publish fields in the table below.

The run conditions above and 5 consecutive failed publishes set inner.healthy to false, and the status stays 200. A probe that must catch them reads inner.healthy. A publish streak, like a read streak, counts only while its latest failure is under a minute old, and a success resets it.

The payload shows the streaks:

Field Process Meaning
queue_consecutive_read_failures consume Failed queue reads since the last success
queue_last_successful_read_at consume Unix time of the last successful read (null if none yet)
inner.consecutive_publish_failures produce Failed publishes since the last success
inner.last_successful_publish_at produce Unix time of the last successful publish (null if none yet)

Each failed read emits [WATCH_METRIC] {"event":"queue_read_failed",...}. Each event that cannot be published emits {"event":"submit_failed",...} and an ERROR log line. A consume worker logs its retention policy at startup and reports total_bytes and budget_bytes for target/run_results/.

Agent invoke API

Experimental — endpoint shapes and response fields may still change in a minor release.

consume --serve-api replaces the plain health server with a small HTTP app on --health-port (required). The app serves /health and these endpoints. Only access: public agents are invokable. Loom's remote mode calls them.

Method & path Body Response
POST /api/agents/{name}/invoke {"input": "...", "vars": {...}, "idempotency_key": "..."} (vars and idempotency_key optional) 202 {"run_id", "status_url"}
GET /api/agents/{name}/runs/{run_id} — {"status", "output", "output_truncated", "ok", "tokens_in", "tokens_out", "error", "created_at", "updated_at", "stalled", "cancel_requested"}
POST /api/agents/{name}/runs/{run_id}/cancel — 200 {"run_id", "status"}, or 202 while a worker is still stopping the run (see Cancel responses)
GET /health (also /) — the usual health payload (liveness)
GET /ready — 200 once the worker is consuming and the project has compiled, else 503 (readiness)

How it works. HTTP runs on the worker, execution goes through the queue, and state lives in Redis. POST records a queued run and publishes it to the same stream that produce uses. Any worker, with or without --serve-api, runs it under the same concurrency cap, --acks-late and shutdown draining as other jobs, then writes the outcome to Redis. A POST through one pod and a GET through another therefore return the same result. Polling avoids proxy and load-balancer timeouts on long runs.

sequenceDiagram
    participant C as Caller
    participant A as worker pod A (HTTP)
    participant R as Redis (stream + run state)
    participant B as worker pod B (executes)
    C->>A: POST /invoke
    A->>R: create run + publish request
    A-->>C: 202 {run_id}
    B->>R: consume request, mark running
    B->>B: run the agent
    B->>R: finish (output, tokens)
    C->>A: GET /runs/{run_id} (any pod)
    A->>R: read run
    A-->>C: {status: succeeded, output}

Run fields. status is queued, running, succeeded, failed or cancelled. A cancelled run polls as ok: false with error: "cancelled". A running run with cancel_requested: true is being stopped. stalled: true means a run is running but no worker holds its lease. Treat it as lost, and retry with a new idempotency_key. output holds up to 1,000,000 characters. A longer result is cut, and output_truncated is true.

Cancel responses

Run state What happens Response
queued Recorded cancelled. When its queue entry is delivered, no worker starts it 200 {"run_id", "status": "cancelled"}
running, a worker holds it The worker is asked to stop. It notices within 20s (its lease heartbeat), cancels the run and records cancelled 202 {"run_id", "status": "running"}: poll until cancelled
running, no worker holds it (its worker died) Recorded cancelled 200
succeeded, failed, cancelled Unchanged, so repeating a cancel is safe 200 with the current status
unknown, or another agent's run — 404
  • Whichever lands first wins. A run that records its result before the worker sees the cancel stays succeeded. A run that ends within the 20-second heartbeat usually completes, so savings come from long runs.
  • Cooperative. Tokens already spent still count, and a tool call running in a thread or subprocess may finish. A cancelled run polls with tokens_in and tokens_out of 0. Spend up to the stop appears in the worker's [TOKEN_AUDIT] log lines.
  • Logs. A worker logs Invoke run <id>: cancel requested, stopping the run, then ... stopped and recorded cancelled. If a tool ignores cancellation, the heartbeats cancel again and log still running N beats after its cancel was requested. The run then holds its --max-concurrent slot until it ends or reaches --invoke-max-run-seconds. The run_lifecycle on_end handler still fires, with status failed.
  • Queued cancels. A run cancelled while queued keeps its queue entry until a worker reaches it. The worker then skips it (skipping duplicate delivery, metric invoke_skipped with reason=finished). Until then, the entry counts toward --invoke-max-queue-lag.
  • Retries. Retry a cancelled run with a new idempotency_key. The old key keeps pointing at the cancelled run.
  • Loom. The loom remote tool sends one best-effort cancel when it gives up on a run (its timeout_seconds deadline, a failed poll, or the calling run being cancelled). It reports a cancelled run as a failed call.

Error responses

Status Code or message When
400 E_PROMPT_UNRESOLVED_WORKFLOW_REF input contains {{ source(...) }} or {{ upstream(...) }}
400 E_INVOKE_VARS_UNKNOWN vars names a variable the agent's prompt body does not reference. The message lists the accepted names
400 E_INVOKE_VARS_INVALID A vars value contains {{, {%, {# or a NUL character
400 (message) Body must be a JSON object; input must be a string; vars must be an object of string values with at most 50 entries and 200,000 characters in total; idempotency_key must be a string of at most 256 characters
401 unauthorized Missing or wrong bearer token
403 E_LOOM_ACCESS_DENIED The agent must have access: public. Checked again when a worker picks up the run
404 run not found Unknown run id, or a run id that belongs to another agent
413 (message) Body over 1 MB, or input over 200,000 characters
415 (message) Content-Type must be application/json
422 E_IDEMPOTENCY_KEY_REUSED The same key with a different input or vars
429 (message), Retry-After: 30 More than --invoke-max-queue-lag entries waiting unread. Callers retry; the loom remote tool retries 429
503 (message), Retry-After: 5 Redis is unreachable, or the project is not compiled on this worker (project is not ready; retry). Callers retry, and so does the loom remote tool

Auth. Every request sends Authorization: Bearer $ABT_INVOKE_TOKEN. The worker refuses to start without the token unless you pass --insecure-no-invoke-auth. There is one shared token and no caller identity, so whoever holds it can cancel any run whose id they know. Run ids are random 128-bit values, returned only to the caller that submitted the run.

Idempotency. Re-POSTing the same idempotency_key with the same input returns the existing run_id, also while the run is still running. Keys are scoped per agent and kept for --invoke-run-ttl-seconds from the run's creation. A run is recorded before its request is queued. If the enqueue fails with 503, the record stays, and a retry with the same key queues it at once. A run that has sat queued for 15 seconds is queued again on retry too. This covers an entry lost with a worker that died before starting it, without --acks-late. Duplicate entries are harmless: a worker runs a run once.

Input. input is one agent's literal message. A {{ source(...) }} or {{ upstream(...) }} reference is rejected with E_PROMPT_UNRESOLVED_WORKFLOW_REF instead of reaching the model. Other text, including {{ var(...) }}, passes through verbatim, and a stray {{ or {% is fine. input is capped at 200,000 characters (413).

Template variables. {} behaves the same as omitting vars. A caller can set only the variables the agent's prompt body references: var('x') and var('x', default) alike. Single braces, # and % are fine in values. Subagent, context-file and frontmatter variables stay under project control. If callers need one, give the agent's body its own var(). Values are literal text. They land in the agent's system prompt, so treat what callers send as untrusted when you write the prompt. A variable name applies everywhere the project uses it. If the body's var('limit') shares its name with a frontmatter model_id or an abt.yaml config: value, the caller's value applies there too. To keep a setting under project control, give it a name that the agent's body does not use.

A run with vars compiles the agent and its subagents for that run, about 60 ms on a 79-agent project. That time counts against --invoke-max-run-seconds. Like a dispatch, the compile re-resolves remote context and skills and builds a fresh MCP registry, so a stdio MCP server starts again for each run. A source that fails to resolve degrades that run's context instead of failing the run. Keep agents exposed with vars light on those, or set the same values as project defaults and omit vars. A run without vars uses the manifest the worker compiled at startup, or the newest one after a new checkout (see New checkouts under Leases and recovery, below). The worker compiles the whole project at startup, so every variable a public agent references needs a default (vars.yaml, abt.yaml vars:, or an inline default). Without one, the worker answers 503 project is not ready for every agent.

What runs. Runs are ephemeral, with no checkpoint thread. They fire config.handlers.run_lifecycle like abt run, and they use the agent's own guardrails, including per-agent abt.yaml overrides. The worker's --target and --profiles-dir apply to invoked runs, as they do to dispatches. An agent that errors becomes a failed run, which the worker records without retrying. Re-running a failed LLM call repeats its cost and side effects.

Leases and recovery. A worker holds a 60-second lease on each run and renews it every 20 seconds. A long run keeps its lease, so no other worker starts it a second time. Its redelivery waits and is retried later. Keep --reclaim-idle-seconds above 60 seconds.

  • An entry the queue gives up on after --max-deliveries marks its run failed (the run was abandoned after repeated failed attempts to execute it), unless a worker still holds its lease.
  • A run over --invoke-max-run-seconds (default one hour) is cancelled and recorded failed (run exceeded Ns and was cancelled). Give exposed agents their own run_timeout so they end earlier and gracefully.
  • New checkouts. When --project-root is a symlink that a deploy repoints to a new checkout (the git-sync pattern), the worker recompiles on the next request. A new agent or tool is served without a restart. The recompile runs off the event loop, and other requests keep using the current manifest until it finishes. A run keeps the manifest it started on. If the new checkout fails to compile, the previous one keeps serving: GET /ready stays 200 and adds invoke_refresh_error, and the worker retries after a few seconds. Pointing the link back at the served checkout clears the error. A run with vars compiles the live checkout itself, so it follows a deploy at once, and fails with the compile error while the live checkout does not compile. invoke_revision in /ready is a short digest of the served checkout's sources. An edit made in place under an unchanged path is not detected. A run reads anything outside the manifest through the live link: tool modules it has not imported yet, files a tool opens next to its own module, skills, context and profiles.yaml. A run that is in flight during a swap can therefore see the new checkout's files, and its run_results.json and dag_summary.json may fail to write (logged as Failed to write run_results.json). The recorded result of the run is unaffected. Keep the previous checkout on disk for at least --invoke-max-run-seconds; with git-sync, set GITSYNC_STALE_WORKTREE_TIMEOUT to that or more (it defaults to 0, which deletes the previous checkout at once).
  • A worker whose project fails to compile at startup leaves invoke entries pending instead of failing them. GET /ready stays 503 until the project compiles. /health is unaffected.
  • A draining worker keeps answering polls until its in-flight runs finish, while other replicas answer in the meantime. Set --shutdown-timeout above your slowest agent, and terminationGracePeriodSeconds to at least that plus 15 seconds.
  • Stalled runs and debugging: [WATCH_METRIC] lines invoke_enqueued, invoke_started (with has_vars), invoke_completed, invoke_skipped (with reason) and invoke_finish_failed trace a run. invoke_cancel_requested and invoke_cancelled count cancels requested and runs stopped. invoke_revision_changed (with revision and previous) and invoke_revision_failed (with serving and error) mark a new checkout being served or failing to compile.

Storage and sizing. Run records live in Redis for --invoke-run-ttl-seconds. Size Redis as requests per hour × result size × TTL: 500 runs an hour with 40 KB results, held for 24 hours, use about 480 MB. Each request costs a few Redis round trips.

In an Apache Bench run against one worker pod on a developer laptop, with local Redis and I/O-bound agents, submits ran at about 1,100–2,300 per second at 200 concurrent callers. p50 stayed under 150 ms and p99 under 300 ms, with no failures, including while that pod executed runs. Separately, 300 concurrent submits across two worker pods each ran exactly once. Workers claim only as many queue entries as they have free slots. A backlog waits in the stream, bounded by --invoke-max-queue-lag, rather than in worker memory. Throughput is bounded by --max-concurrent slots times agent run time, so add worker replicas (and Redis memory for run records) for more. If your agents do heavy CPU work on the event loop, measure submit latency under your own load.

Known limits. Invoke requests share the dispatch stream, its --stream-maxlen trim and the --max-concurrent slots with triggered jobs. They have no dedicated stream. There is no per-caller identity or rate limit, only the shared token. The port serves plain HTTP, so keep it on a ClusterIP Service (with mesh mTLS if you have one) rather than a public load balancer. Bodies are capped at 1 MB, but there is no read timeout, so put slow-client protection (mesh or ingress) in front.

Rollout. Upgrade every worker first, then enable --serve-api on the pods that should serve HTTP. Workers without --serve-api still execute runs. Workers without cancel support run a cancelled job to the end. A request with vars is queued as a different kind of entry. A worker without that support logs malformed dispatch request, skipping, and with --acks-late the entry stays pending until an upgraded worker picks it up. A worker started with --serve-api and without --acks-late logs a startup warning. Run --serve-api workers with --acks-late, because otherwise a worker that dies mid-run loses the run, which stays queued or running until its record expires. For a Kubernetes manifest, see Serving the invoke API from workers. Callers point their abt_loom.yaml endpoint at the ClusterIP Service.

Progress UX under produce and consume

These mechanics apply when a slack trigger sets progress or progress_reaction. The guide lists the setup steps.

  • produce waits up to 3 seconds for Slack to confirm the indicator before it publishes the request. The wait runs in the background for each event, so bursts of messages wait in parallel. Requests still publish in arrival order. If Slack is slower, the request runs without an indicator, and produce removes the late one itself when it lands.
  • Only what produce saw succeed is cleared. A reaction that failed to add (for example, because the same emoji is already on the message) is left alone by the consumer.
  • The thread status belongs to the thread. Overlapping messages in one thread share it: each message registers on the thread, a finished run restores the status while other messages are registered, and the last message clears it. Under watch run this state lives in memory. Under produce and consume it is a Redis set per thread (abt:progress:status:<channel>:<thread>, one member per message). The set expires an hour after its last registration, so a crashed worker cannot block the clear. If Redis is unreachable when a message releases its hold, the status is cleared outright. Reactions are per message and unaffected.
  • A consume image needs the slack extra as well as queue. Without it, the run completes, the indicator stays set, and the consumer logs a warning.
  • An inline config.bot_token on the trigger needs SLACK_BOT_TOKEN on each consumer, because a consumer reads the token from its own credentials: namespace or from the environment. An env-var-only target (ABT_TARGET__<T>__CREDENTIALS__SLACK__BOT_TOKEN) works like a profiles.yaml target.
  • A worker that crashes mid-run leaves the indicator set until someone removes it by hand. With --acks-late, the redelivered run clears it. A run that fails and is redelivered clears the indicator on its first attempt, so the retry runs without one.
  • A manual abt dispatch runs with no progress UX, because it has no triggering event.

See also