@melaya/runner 1.1.4 → 1.1.6

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.
@@ -948,6 +948,17 @@ export async function startBrowserBridge(opts) {
948
948
  stopWatchLease(sessionId);
949
949
  return;
950
950
  }
951
+ // Idempotent: the trusted UI re-affirms the watch on a heartbeat (every few
952
+ // seconds) and on every reconnect, so browser:watch active=true arrives
953
+ // repeatedly for the SAME session. Restarting the producer each time churned
954
+ // the capture loop and spammed the log. If a producer is already running for
955
+ // this session, just refresh the delivery params and keep the existing loop.
956
+ const existingLease = watchLeases.get(sessionId);
957
+ if (existingLease && existingLease.active) {
958
+ existingLease.framePostUrl = framePostUrl;
959
+ existingLease.runAuthHeader = runAuthHeader;
960
+ return;
961
+ }
951
962
  // Find which runId corresponds to this sessionId.
952
963
  // Priority order:
953
964
  // 1. Interactive session: sessionId is both the key in interactiveSessions
@@ -1257,8 +1257,13 @@ export async function connect(opts) {
1257
1257
  // env; it arrives per-turn on the turn frame and is purged at turn end.
1258
1258
  // This is part of the config hash so the host reboots if capability
1259
1259
  // presence changes (a runner that gains/loses browser control restarts
1260
- // the host automatically via config-drift detection above).
1261
- MEL_ASSISTANT_BROWSER_CAPABLE: "1",
1260
+ // the host automatically via config-drift detection above). MUST follow
1261
+ // payload.browserCapable, not a hardcoded "1": the host's _config_hash
1262
+ // appends "browser" only when this is set, and the server's hash does the
1263
+ // same only when cfg.browserCapable is true. Hardcoding "1" made the host
1264
+ // always hash "browser" while a non-browser server hash omitted it, which
1265
+ // pinned every turn to a permanent runner_host_config_stale.
1266
+ MEL_ASSISTANT_BROWSER_CAPABLE: payload.browserCapable ? "1" : "",
1262
1267
  // Connector tool sets the user enabled for this chat (comma-joined service
1263
1268
  // ids). The host seeds a lazy toolkit from these so ANY connector's tools
1264
1269
  // are reachable without exploding context.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melaya/runner",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Run Melaya AI pipelines locally with your own LM Studio or Ollama models",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,