You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(mux): orchestrate install and start with coder-utils and resolve versions through the package manager
Round 2 of review on #1095:
- resolve install_version through npm/pnpm/bun view so registry auth applies
- default log_path into the module root logs/ directory
- split run.sh into scripts/install.sh.tftpl and scripts/start.sh.tftpl run by coder-utils
- keep a pre-1.6.0 copy at /tmp/mux working for install=false and use_cached
- keep a single install layout so the installed version is read from the active one
- normalize an empty install_version to latest before resolving it
- apply before asserting on the token-bearing start script
Automatically install and run [Mux](https://github.com/coder/mux) in a Coder workspace. By default, the module auto-detects an available package manager (`npm`, `pnpm`, or `bun`) to install `mux@next` (with a fallback to downloading the npm tarball if none is found). You can also force a specific package manager via `package_manager` and point to a custom registry with `registry_url`. The install lives under `~/.coder-modules/coder/mux` so it survives workspace restarts; each start compares the installed version with `install_version` and only reinstalls when it differs or is missing. The launcher keeps watching the mux process after startup, appends signal/exit-code diagnostics to the mux log when the server is killed outside the Node runtime, and can optionally wait a few seconds, remove the stale server lock, and restart Mux after any exit until an optional restart-attempt cap is reached. Mux is a desktop application for parallel agentic development that enables developers to run multiple AI agents simultaneously across isolated workspaces.
11
+
Automatically install and run [Mux](https://github.com/coder/mux) in a Coder workspace. By default, the module auto-detects an available package manager (`npm`, `pnpm`, or `bun`) to install `mux@next` (with a fallback to downloading the npm tarball if none is found). You can also force a specific package manager via `package_manager` and point to a custom registry with `registry_url`. The install lives under `~/.coder-modules/coder/mux` so it survives workspace restarts; each start resolves `install_version` through the package manager (so private registry credentials apply) and only reinstalls when the installed version differs or is missing. Scripts and logs are orchestrated by [`coder-utils`](../coder-utils), which runs the install script before the start script and keeps both under the same module directory. The launcher keeps watching the mux process after startup, appends signal/exit-code diagnostics to the mux log when the server is killed outside the Node runtime, and can optionally wait a few seconds, remove the stale server lock, and restart Mux after any exit until an optional restart-attempt cap is reached. Mux is a desktop application for parallel agentic development that enables developers to run multiple AI agents simultaneously across isolated workspaces.
12
12
13
13
```tf
14
14
module "mux" {
@@ -156,7 +156,7 @@ module "mux" {
156
156
157
157
### Skip Install
158
158
159
-
Run without installing from the network (requires Mux to be pre-installed):
159
+
Run without installing from the network (requires Mux to be pre-installed at `install_prefix`; a copy left at the pre-1.6.0 default `/tmp/mux` is still picked up when `install_prefix` is not set):
160
160
161
161
```tf
162
162
module "mux" {
@@ -180,6 +180,8 @@ module "mux" {
180
180
- Requires a Node.js runtime; if `node` is not on the workspace `PATH`, the module bootstraps a pinned Node.js runtime into `~/.local/share/coder-mux` (override the version with the `MUX_NODE_VERSION` environment variable)
181
181
- Installs `mux@next` from the npm registry by default; set `registry_url` to use a private or mirrored registry
182
182
- Installs into `install_prefix` (default `$HOME/.coder-modules/coder/mux`), which persists across restarts; the installed version is compared with `install_version` on every start and only refetched when it differs or is missing
183
+
- Writes the Mux server log to `log_path` (default `$HOME/.coder-modules/coder/mux/logs/mux.log`); the install and start script output lands next to it in `logs/install.log` and `logs/start.log`
184
+
- Exposes a `scripts` output so other modules can serialize their own scripts behind the Mux install with `coder exp sync`
183
185
- Falls back to a direct tarball download when no package manager is found
184
186
- Appends best-effort signal and external-kill diagnostics to `log_path` if the mux process dies after startup
185
187
- Set `restart_on_kill = true` to wait `restart_delay_seconds`, remove `~/.mux/server.lock`, and restart Mux after it exits
0 commit comments