switchroom 0.19.44 → 0.19.46

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.
@@ -21402,7 +21402,7 @@ function allocateAgentUid(name) {
21402
21402
  }
21403
21403
 
21404
21404
  // src/build-info.ts
21405
- var VERSION = "0.19.44";
21405
+ var VERSION = "0.19.46";
21406
21406
 
21407
21407
  // src/setup/hindsight-recall-tunables.ts
21408
21408
  var RECALL_DEADLINE_HEADROOM_SECONDS = 2;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "switchroom",
3
3
  "//version": "NOT the release version — source of truth is the git tag, resolved by scripts/build.mjs:resolveVersion() (see CLAUDE.md > Standard release process). This field is stale by design and only the Layer-4 dev/non-tag fallback for build.mjs + src/cli/resolve-version.ts; do NOT bump it expecting a release to pick it up. npm-pack tarball naming needs a real version — do that as an UNCOMMITTED pack-time bump (see release step 6), never a committed one.",
4
- "version": "0.19.44",
4
+ "version": "0.19.46",
5
5
  "description": "Run Claude Code 24/7 on your Claude Pro/Max subscription over Telegram. Open-source alternative to OpenClaw and NanoClaw — no API keys.",
6
6
  "type": "module",
7
7
  "bin": {
@@ -805,7 +805,26 @@ export SWITCHROOM_AGENT_START_CWD="{{agentDir}}"
805
805
  # already gets this via .mcp.json env, but the Claude Code process
806
806
  # doesn't inherit that — so without this export, `switchroom auth status`
807
807
  # from Bash inside the agent fails with "No switchroom.yaml found".
808
- export SWITCHROOM_CONFIG={{{switchroomConfigPathQ}}}
808
+ #
809
+ # DEFER to a pre-set value: in Docker, compose.ts already sets
810
+ # SWITCHROOM_CONFIG to the in-container mount (/state/config/
811
+ # switchroom.yaml). The value baked here is the HOST path — resolve()d on
812
+ # the machine that ran the scaffold — which does not exist inside the
813
+ # container. Unconditionally exporting it clobbered the correct compose
814
+ # value and silently killed the live model/effort resolvers below (their
815
+ # [ -f "$SWITCHROOM_CONFIG" ] guard failed and fell into the quiet
816
+ # no-config-mount branch), so `model:` edits + bare restart did nothing.
817
+ # The bake stays as the fallback for host-run (non-Docker) agents, where
818
+ # nothing else sets the var. ${VAR:-} also treats a set-but-EMPTY var as
819
+ # unset, so an empty compose env can never blank the fallback.
820
+ #
821
+ # NB the baked path is pre-single-quoted by the scaffold, so it is
822
+ # assigned BARE to a temp var first — embedding it directly inside
823
+ # "${SWITCHROOM_CONFIG:-...}" would keep the literal quote characters in
824
+ # the value.
825
+ _SR_CONFIG_BAKED={{{switchroomConfigPathQ}}}
826
+ export SWITCHROOM_CONFIG="${SWITCHROOM_CONFIG:-$_SR_CONFIG_BAKED}"
827
+ unset _SR_CONFIG_BAKED
809
828
  {{/if}}
810
829
  {{#if hindsightEnabled}}
811
830
  # Hindsight memory plugin (vendored at .claude/plugins/hindsight-memory/).
@@ -1722,9 +1741,11 @@ fi
1722
1741
  # launcher recorded on every prior boot (read BEFORE it is overwritten);
1723
1742
  # 3. the apply-time bake.
1724
1743
  # Steps 2/3 append to `.session-model-alert` so the gateway tells the
1725
- # operator once at boot. No SWITCHROOM_CONFIG mount at all means there is
1726
- # nothing to read live — the bake IS the truth there (stderr note only; an
1727
- # operator alert every boot forever would be noise with no action).
1744
+ # operator once at boot. No SWITCHROOM_CONFIG at all means there is
1745
+ # nothing to read live — the bake IS the truth there and the fallback is
1746
+ # silent. But SWITCHROOM_CONFIG set with the FILE MISSING is a
1747
+ # misconfiguration that kills live resolution outright, so that case is
1748
+ # loud (stderr + operator alert) — see the else branch below.
1728
1749
  #
1729
1750
  # The yaml file bind mount re-resolves by PATH at container start, so a
1730
1751
  # host-side atomic-rename write is always picked up by the NEXT boot — the
@@ -1785,6 +1806,23 @@ if [ -n "$SWITCHROOM_CONFIG" ] && [ -f "$SWITCHROOM_CONFIG" ] && command -v swit
1785
1806
  unset _lm_live _lm_try _lm_baked_class _lm_live_class
1786
1807
  else
1787
1808
  _EFFECTIVE_MODEL="$_BAKED_MODEL"
1809
+ # No live read possible. Distinguish the legitimately quiet case — no
1810
+ # SWITCHROOM_CONFIG at all (host-run agent scaffolded without a config
1811
+ # path; the bake IS the truth) — from a broken resolver hiding behind
1812
+ # it. SWITCHROOM_CONFIG set but pointing at a file that does not exist
1813
+ # is a misconfiguration (e.g. a host path leaking into a container env)
1814
+ # that silently disables live `model:`/`thinking_effort:` resolution:
1815
+ # exactly the defect that let the start.sh host-path clobber of the
1816
+ # compose-set env go unnoticed. That case is LOUD — stderr + a one-boot
1817
+ # operator alert. A set config whose file exists but with no
1818
+ # `switchroom` CLI on PATH is equally dead, stderr-only (nothing the
1819
+ # operator can act on from chat).
1820
+ if [ -n "$SWITCHROOM_CONFIG" ] && [ ! -f "$SWITCHROOM_CONFIG" ]; then
1821
+ echo "session-model: SWITCHROOM_CONFIG='$SWITCHROOM_CONFIG' is set but the file does not exist — live config resolution is DISABLED; using apply-time baked model '$_BAKED_MODEL'" >&2
1822
+ printf '`SWITCHROOM_CONFIG` points at `%s`, which does not exist in this environment, so live `model:`/`thinking_effort:` resolution is disabled and the agent booted on the apply-time default `%s`. Edits to switchroom.yaml will NOT take effect on a bare restart until this is fixed.\n' "$SWITCHROOM_CONFIG" "$_BAKED_MODEL" >> "{{agentDir}}/.session-model-alert" 2>/dev/null || true
1823
+ elif [ -n "$SWITCHROOM_CONFIG" ]; then
1824
+ echo "session-model: SWITCHROOM_CONFIG is set but no 'switchroom' CLI is on PATH — live config resolution is DISABLED; using apply-time baked model '$_BAKED_MODEL'" >&2
1825
+ fi
1788
1826
  fi
1789
1827
  unset _BAKED_MODEL _LKG_MODEL
1790
1828
  # Record the RESOLVED configured default (raw, unquoted) every boot, before
@@ -2078,6 +2116,12 @@ if [ -n "$SWITCHROOM_CONFIG" ] && [ -f "$SWITCHROOM_CONFIG" ] && command -v swit
2078
2116
  unset _le_live _le_try
2079
2117
  else
2080
2118
  _EFFECTIVE_EFFORT="$_BAKED_EFFORT"
2119
+ # Misconfig visibility, parity with the model sibling above — which
2120
+ # owns the operator alert for this shared root cause; a second alert
2121
+ # here would double-post for the same broken env. stderr only.
2122
+ if [ -n "$SWITCHROOM_CONFIG" ] && [ ! -f "$SWITCHROOM_CONFIG" ]; then
2123
+ echo "session-effort: SWITCHROOM_CONFIG='$SWITCHROOM_CONFIG' is set but the file does not exist — live config resolution is DISABLED; using apply-time baked thinking_effort '${_BAKED_EFFORT:-<unset>}'" >&2
2124
+ fi
2081
2125
  fi
2082
2126
  unset _BAKED_EFFORT _LKG_EFFORT
2083
2127
  # Record the LIVE-RESOLVED configured default, BEFORE the carrier below can