docs: document Claude Code dispatch_deadline for Agent Relay (#31834)
Agent Relay v0.15.0 replaced the fixed 300-second Claude Code spawn budget with a per-pool `dispatch_deadline` ([agent-relay#147](https://github.com/coder/agent-relay/pull/147)). - `claude-code.md`: rewrite **Build budget** (default `5m`, `10s` to `15m`, whole seconds, can't be turned off, sent to Anthropic as the hint TTL, needs v0.15.0) and add the field to both pool examples. - `configuration.md`: add `dispatch_deadline` to the Claude Code pool fields. - `troubleshooting.md`, `monitoring/siem.md`: drop the fixed 300-second wording. Verification notes: - Checked against `internal/services/serviceclaudecoderunners` (`parseDispatchDeadline`, `poller.go` constants) at v0.15.0 (`9b96578`). - The old text said Agent Relay returns a missed-budget session as **retryable**. In v0.15.0, Claude requests use `TerminalOnDeadline` ([agent-relay#138](https://github.com/coder/agent-relay/pull/138)), so a failure at or after the deadline is nacked non-retryable. The page now says Agent Relay "reports the failure" and doesn't claim either way. Stack 1/5. Review and merge in order: - #31834 - #31835 - #31836 - #31837 - #31838 Refs DOCS-1171 > Generated by Coder Agents. --------- Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com> Co-authored-by: Nick Vigilante <nick.vigilante@coder.com>
This commit is contained in:
1 parent
d3de82ff4a
commit
f457b344cc
4 files changed
+28
-12
No files matched your search
@@ -162,6 +162,9 @@ pools:
|
||||
# Optional: release a session after this long without a user message.
|
||||
# Default 1h; 0 never releases.
|
||||
# idle_release_timeout: 1h
|
||||
# Optional: how long the build can take from work order issue.
|
||||
# Default 5m, between 10s and 15m.
|
||||
# dispatch_deadline: 5m
|
||||
|
||||
secretEnv:
|
||||
- name: CLAUDE_ENVIRONMENT_SECRET
|
||||
@@ -188,6 +191,9 @@ claudeCodeRunnerPools:
|
||||
# Optional: release a session after this long without a user message.
|
||||
# Default 1h; 0 never releases.
|
||||
# idle_release_timeout: 1h
|
||||
# Optional: how long the build can take from work order issue.
|
||||
# Default 5m, between 10s and 15m.
|
||||
# dispatch_deadline: 5m
|
||||
```
|
||||
|
||||
Pass `CLAUDE_ENVIRONMENT_SECRET` to the container alongside `CODER_AGENT_RELAY_CODERD_SESSION_TOKEN`, as shown in [Install with Docker](./setup.md#docker).
|
||||
@@ -203,10 +209,17 @@ When the pool is configured, return to [Install Agent Relay](./setup.md#step-5-i
|
||||
|
||||
## Build budget
|
||||
|
||||
Agent Relay gives each Claude Code workspace a fixed 300-second spawn budget.
|
||||
The budget starts when Anthropic issues the session's work order, so time in Anthropic's queue and time waiting for a provisioner both count.
|
||||
When a build misses the budget, Agent Relay returns the session to Anthropic as retryable and deletes the workspace.
|
||||
The budget isn't configurable.
|
||||
Each pool's `dispatch_deadline` sets the spawn budget: how long a Claude Code workspace build can take.
|
||||
|
||||
- The default is `5m`, the minimum is `10s`, and the maximum is `15m`.
|
||||
The value must be whole seconds.
|
||||
- You can't turn off the budget, because Anthropic requires one.
|
||||
- Agent Relay sends the budget to Anthropic on every poll.
|
||||
If no runner starts within the budget, Anthropic offers the session again.
|
||||
- The budget starts when Anthropic issues the session's work order, so time in Anthropic's queue and time waiting for a provisioner both count.
|
||||
- When a build misses the budget, Agent Relay reports the failure to Anthropic, cancels the build if it's still running, and deletes the workspace.
|
||||
|
||||
For templates where the image pull and build regularly take longer than 5 minutes, raise `dispatch_deadline`.
|
||||
|
||||
To fit inside the budget:
|
||||
|
||||
@@ -226,7 +239,7 @@ For example, a template that builds in 60 seconds needs about 12 provisione
|
||||
|
||||
> [!WARNING]
|
||||
> Provisioner shortages feed themselves.
|
||||
> A build that misses the budget is returned to Anthropic and its workspace is deleted, and Anthropic then sends the session again.
|
||||
> A build that misses the budget fails, Agent Relay deletes its workspace, and Anthropic sends the session again.
|
||||
> Each late build adds a delete and a rebuild to the same provisioners.
|
||||
|
||||
## Network requirements
|
||||
|
||||
@@ -131,9 +131,10 @@ Use `secret_env` to keep the secret out of configuration files and Helm values.
|
||||
|
||||
### Claude Code pool fields
|
||||
|
||||
| Field | Required | Description |
|
||||
|---------------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `claude_tag_channel_user` | No | The Coder user who owns workspaces for Claude Tag channel sessions. Set `me` for the Agent Relay service account, or the UUID of a user in the pool's organization. When it's unset, Agent Relay rejects channel sessions. Refer to [Configure Slack for Agent Relay](./slack.md). |
|
||||
| Field | Required | Description |
|
||||
|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `claude_tag_channel_user` | No | The Coder user who owns workspaces for Claude Tag channel sessions. Set `me` for the Agent Relay service account, or the UUID of a user in the pool's organization. When it's unset, Agent Relay rejects channel sessions. Refer to [Configure Slack for Agent Relay](./slack.md). |
|
||||
| `dispatch_deadline` | No | The spawn budget, from when Anthropic issues the work order to a successful build, as a duration in whole seconds such as `5m`. Defaults to `5m`, with a minimum of `10s` and a maximum of `15m`. You can't turn it off. Agent Relay also sends it to Anthropic as the time to wait for a runner. Refer to [Build budget](./claude-code.md#build-budget). |
|
||||
|
||||
### Cursor pool fields
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ Some conditions, such as a stranded Cursor claim, appear only in logs.
|
||||
| Rate threshold | `nacked spawn hint` | Claude Code | `pool`, `retryable` | Sessions handed back to Anthropic. `retryable: false` ends the session and needs an administrator. |
|
||||
| Rate threshold | `failed the claim upstream, the user sees the message` | Cursor | `pool`, `retryable`, `stage` | Users saw a failure. `retryable: false` needs an administrator. `retryable: true` usually means a transient or capacity problem. |
|
||||
| Rate threshold | `workspace build failed, reporting retryable and deleting` | Both | `job_error` | A template or infrastructure failure, such as exhausted quota. Agent Relay deletes the workspace right away, so `job_error` might be the only record of why. |
|
||||
| Rate threshold | `workspace build passed the session deadline, reporting retryable and deleting` | Both | `pool` | Builds take longer than the 300-second Claude Code budget or the Cursor pool's `dispatch_deadline`. |
|
||||
| Rate threshold | `workspace build passed the session deadline, reporting retryable and deleting` | Both | `pool` | Builds take longer than the pool's `dispatch_deadline`. |
|
||||
| Rate threshold | `session did not finish cleanly, reporting and deleting` (`reaper`) | Both | `reason` | Runners that exited non-zero, couldn't start, stopped unexpectedly, or never started. |
|
||||
| Ticket | `session owner is unresolvable, nacking non-retryable` | Claude Code | `org_service_name` | A Claude user has no active Coder account in the pool's organization, or a Claude Tag channel session arrived without `claude_tag_channel_user`. |
|
||||
| Ticket | `request owner cannot be served, refusing the request` | Cursor | `reason` | A Cursor request has no email, no matching Coder account in the organization, or a suspended or dormant account. |
|
||||
|
||||
@@ -36,7 +36,9 @@ Also check the pool configuration:
|
||||
- An unset `secret_env` variable, or a reserved `template_parameters` name.
|
||||
- An `idle_release_timeout` without a unit.
|
||||
Claude Code values must be whole minutes, and Cursor values must be whole seconds.
|
||||
- Cursor only: more than four pools on one API key, two pools on one key with the same `cursor_pool_name`, or a `dispatch_deadline` longer than `15m`.
|
||||
- A `dispatch_deadline` longer than `15m`.
|
||||
Claude Code values must also be whole seconds and at least `10s`.
|
||||
- Cursor only: more than four pools on one API key, or two pools on one key with the same `cursor_pool_name`.
|
||||
|
||||
### One pool is degraded and the others are fine
|
||||
|
||||
@@ -63,8 +65,8 @@ The workspace's build log in Coder has the full output.
|
||||
|
||||
### Builds time out
|
||||
|
||||
- Claude Code: the build plus provisioner queue time exceeded the fixed 300-second budget.
|
||||
Speed up the template or add provisioners.
|
||||
- Claude Code: the build time plus queue time exceeded the pool's `dispatch_deadline`, `5m` by default.
|
||||
Speed up the template, raise the deadline up to `15m`, or add provisioners.
|
||||
- Cursor: the build exceeded `dispatch_deadline` or waited for a provisioner.
|
||||
Speed up the template, raise the deadline up to `15m`, use prebuilds, or add provisioners.
|
||||
|
||||
|
||||
Reference in new issue
Block a user