Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 935ff33

Browse files
committed
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
1 parent c2a495e commit 935ff33

6 files changed

Lines changed: 594 additions & 434 deletions

File tree

registry/coder/modules/mux/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: [ai, agents, development, multiplexer]
88

99
# Mux
1010

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 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.
1212

1313
```tf
1414
module "mux" {
@@ -156,7 +156,7 @@ module "mux" {
156156

157157
### Skip Install
158158

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):
160160

161161
```tf
162162
module "mux" {
@@ -180,6 +180,8 @@ module "mux" {
180180
- 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)
181181
- Installs `mux@next` from the npm registry by default; set `registry_url` to use a private or mirrored registry
182182
- 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`
183185
- Falls back to a direct tarball download when no package manager is found
184186
- Appends best-effort signal and external-kill diagnostics to `log_path` if the mux process dies after startup
185187
- Set `restart_on_kill = true` to wait `restart_delay_seconds`, remove `~/.mux/server.lock`, and restart Mux after it exits

0 commit comments

Comments
 (0)