Files
coder/docs/admin/templates/startup-coordination/index.md
T
Spike Curtis 56eb57caf4 chore: enable agent socket by default (#22352)
relates to #21335

Enables the agent socket by default and updates docs to strike references to having to enable it.

The PRs in this stack change the MCP server that Tasks use to update their status to rely on the agent socket, rather than directly dialing Coderd with the agent token.

Default disable was a reasonable default when it was only used for the experimental script ordering features, but now that we want to use it for Tasks, it should be default on.
2026-03-03 21:23:59 +04:00

1.7 KiB

Workspace Startup Coordination

Note

This feature is experimental and may change without notice in future releases.

When workspaces start, scripts often need to run in a specific order. For example, an IDE or coding agent might need the repository cloned before it can start. Without explicit coordination, these scripts can race against each other, leading to startup failures and inconsistent workspace states.

Coder's workspace startup coordination feature lets you declare dependencies between startup scripts and ensure they run in the correct order. This eliminates race conditions and makes workspace startup predictable and reliable.

Why use this?

Simply placing all of your workspace initialization logic in a single script works, but leads to slow workspace startup times. Breaking this out into multiple independent coder_script resources improves startup times by allowing the scripts to run in parallel. However, this can lead to intermittent failures between dependent scripts due to timing issues. Up until now, template authors have had to rely on manual coordination methods (for example, touching a file upon completion). The goal of startup script coordination is to provide a single reliable source of truth for coordination between workspace startup scripts.

Quick Start

To start using workspace startup coordination, add calls to coder exp sync (start|complete) in your startup scripts where required:

trap 'coder exp sync complete my-script' EXIT
coder exp sync want my-script my-other-script
coder exp sync start my-script
# Existing startup logic

For more information, refer to the usage documentation, troubleshooting documentation, or view our examples.