@weave-os/router 0.2.33 → 0.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/desktop-shim.js CHANGED
@@ -17,6 +17,9 @@ const tls = require("node:tls");
17
17
 
18
18
  const INTERCEPT_HOST = "api.anthropic.com";
19
19
  const ROUTER_KEY_HEADER = "x-weave-router-key";
20
+ // Desktop's model picker can't list Weave Auto, so Desktop's picks are routed
21
+ // instead of honoring the CLI's passthrough header from ~/.claude/settings.json.
22
+ const MODEL_PASSTHROUGH_HEADER = "x-weave-model-passthrough";
20
23
  // Claude Code's user agent names its entrypoint: "claude-desktop" for the Code
21
24
  // tab, "local-agent" for Cowork.
22
25
  const DESKTOP_USER_AGENT = /[(,]\s*(claude-desktop|local-agent)(?![\w-])/;
@@ -105,6 +108,7 @@ function forward(cfg, req, res) {
105
108
  for (const [name, value] of Object.entries(req.headers)) {
106
109
  if (!HOP_BY_HOP.has(name) && name !== ROUTER_KEY_HEADER) headers[name] = value;
107
110
  }
111
+ if (toRouter) delete headers[MODEL_PASSTHROUGH_HEADER];
108
112
  headers.host = target.host;
109
113
  if (toRouter && cfg.routerKey) headers[ROUTER_KEY_HEADER] = cfg.routerKey;
110
114
 
package/install.sh CHANGED
@@ -6471,10 +6471,17 @@ start_desktop_shim_service() {
6471
6471
  </plist>
6472
6472
  PLIST
6473
6473
  launchctl bootout "gui/$uid/$desktop_shim_launchd_label" >/dev/null 2>&1 || true
6474
- if ! launchctl bootstrap "gui/$uid" "$plist"; then
6475
- err "launchctl could not start the Claude Desktop proxy from $plist."
6476
- exit 1
6477
- fi
6474
+ # bootout returns before the old agent has exited, and bootstrapping the
6475
+ # same label meanwhile fails (error 5), so a reinstall retries for a bit.
6476
+ local attempt=1
6477
+ until launchctl bootstrap "gui/$uid" "$plist" 2>/dev/null; do
6478
+ if [ "$attempt" -ge 5 ]; then
6479
+ err "launchctl could not start the Claude Desktop proxy from $plist."
6480
+ exit 1
6481
+ fi
6482
+ attempt=$((attempt + 1))
6483
+ sleep 1
6484
+ done
6478
6485
  ok "Claude Desktop proxy runs at login (launchd $desktop_shim_launchd_label)"
6479
6486
  ;;
6480
6487
  Linux)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weave-os/router",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "One-command installer that points Claude Code, Codex, opencode, or pi at the Weave Router. For pi it also ships the routing extension, loaded via pi.extensions.",
5
5
  "bin": {
6
6
  "weave-router": "bin.js",