@yu_robotics/remote-cli 1.6.117 → 1.6.121

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.
Files changed (47) hide show
  1. package/README.md +21 -9
  2. package/dist/client/MessageHandler.d.ts.map +1 -1
  3. package/dist/client/MessageHandler.js +41 -29
  4. package/dist/client/MessageHandler.js.map +1 -1
  5. package/dist/commands/start.d.ts.map +1 -1
  6. package/dist/commands/start.js +25 -11
  7. package/dist/commands/start.js.map +1 -1
  8. package/dist/delegation/BackendRegistry.d.ts.map +1 -1
  9. package/dist/delegation/BackendRegistry.js +15 -8
  10. package/dist/delegation/BackendRegistry.js.map +1 -1
  11. package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
  12. package/dist/executor/ClaudePersistentExecutor.js +18 -4
  13. package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
  14. package/dist/executor/DshExecutor.d.ts +4 -0
  15. package/dist/executor/DshExecutor.d.ts.map +1 -1
  16. package/dist/executor/DshExecutor.js +8 -0
  17. package/dist/executor/DshExecutor.js.map +1 -1
  18. package/dist/executor/claude/ClaudeStderrFilter.d.ts +11 -0
  19. package/dist/executor/claude/ClaudeStderrFilter.d.ts.map +1 -0
  20. package/dist/executor/claude/ClaudeStderrFilter.js +68 -0
  21. package/dist/executor/claude/ClaudeStderrFilter.js.map +1 -0
  22. package/dist/executor/dsh/DshAccountUsage.d.ts +12 -0
  23. package/dist/executor/dsh/DshAccountUsage.d.ts.map +1 -0
  24. package/dist/executor/dsh/DshAccountUsage.js +134 -0
  25. package/dist/executor/dsh/DshAccountUsage.js.map +1 -0
  26. package/dist/executor/dsh/DshAccountUsagePlugin.d.ts +16 -0
  27. package/dist/executor/dsh/DshAccountUsagePlugin.d.ts.map +1 -0
  28. package/dist/executor/dsh/DshAccountUsagePlugin.js +19 -0
  29. package/dist/executor/dsh/DshAccountUsagePlugin.js.map +1 -0
  30. package/dist/service/ServiceManager.d.ts.map +1 -1
  31. package/dist/service/ServiceManager.js +4 -2
  32. package/dist/service/ServiceManager.js.map +1 -1
  33. package/dist/thread/DelegationSettings.d.ts +4 -0
  34. package/dist/thread/DelegationSettings.d.ts.map +1 -0
  35. package/dist/thread/DelegationSettings.js +8 -0
  36. package/dist/thread/DelegationSettings.js.map +1 -0
  37. package/dist/thread/types.d.ts +1 -1
  38. package/dist/thread/types.d.ts.map +1 -1
  39. package/dist/utils/BackendCommand.d.ts +8 -0
  40. package/dist/utils/BackendCommand.d.ts.map +1 -0
  41. package/dist/utils/BackendCommand.js +26 -0
  42. package/dist/utils/BackendCommand.js.map +1 -0
  43. package/dist/utils/BackendEnvironment.d.ts +16 -0
  44. package/dist/utils/BackendEnvironment.d.ts.map +1 -0
  45. package/dist/utils/BackendEnvironment.js +70 -0
  46. package/dist/utils/BackendEnvironment.js.map +1 -0
  47. package/package.json +1 -1
package/README.md CHANGED
@@ -91,6 +91,8 @@ Help me fix TypeScript errors in ~/projects/my-app
91
91
 
92
92
  Manual starts automatically install updates when tasks and queues are idle, without exiting the running client. Updates take effect on the next start. Use `remote-cli service install` for automatic startup and supervised restarts after updates. If the Router rejects the running protocol, restart the manual client after installation to reconnect. See [Automatic Client Startup](../../README.md#automatic-client-startup) for update behavior and recovery.
93
93
 
94
+ From CLI 1.6.119, Linux and macOS startup append deterministic backend installation directories to the inherited `PATH`, preserving existing executable and Node precedence. Valid old systemd units and LaunchAgents need only a restarted upgraded client, not reinstallation; broken Node or CLI startup paths still require repair. Later installs into covered directories are visible to a fresh `/backend`, with up to 30 seconds of delegation discovery caching. Custom locations use `executor.<backend>.command`, preferably an absolute real executable; ZCode preserves native unset/empty-command discovery. No shell profiles, runtime-version scans, or new version-manager shim directories are used. See [Backend Executable Discovery](../../README.md#backend-executable-discovery).
95
+
94
96
  ## Commands
95
97
 
96
98
  | Command | Description |
@@ -139,23 +141,33 @@ Linux users upgrading from version 1.6.23 or earlier should run `remote-cli serv
139
141
 
140
142
  ### Threads & Machines
141
143
 
142
- Use `/delegation on` in an existing thread to let its selected backend assign
143
- bounded tasks to other installed, authenticated backends. Claude Code, Codex,
144
- Pi, AGY, OpenCode, Kimi Code, and ZCode can coordinate or work. From CLI 1.6.95,
144
+ From CLI 1.6.121, new and existing threads without a saved preference enable
145
+ delegation by default. Their selected backend can assign bounded tasks to other
146
+ installed, authenticated backends. Claude Code, Codex, Pi, AGY, OpenCode, Kimi
147
+ Code, ZCode, and DSH can coordinate or work. From CLI 1.6.95,
145
148
  same-backend delegation is rejected before launching a worker; discovery marks
146
149
  the current backend unavailable as a worker. Use the current backend directly
147
150
  or its native subagents, if supported. Workers return results to the original conversation and use
148
151
  its working directory; they do not create extra thread buttons. `/delegation`
149
- shows discovery and restrictions; `/delegation off` disables the feature. The
150
- setting is off by default and persists per thread. Start with one trial thread;
151
- never-enabled threads skip managed tools, prompt changes, and delegation
152
- configuration. Turning it off cleans only backends used for delegation, including
153
- when resumed after a CLI restart or a backend switch, while preserving their
154
- conversations.
152
+ shows discovery and restrictions; `/delegation off` explicitly disables the
153
+ feature and `/delegation on` enables it again. Saved opt-outs remain off across
154
+ upgrades, context resets, backend switches, and CLI restarts. No historical
155
+ thread migration or conversation reset is required. Default-on makes tools
156
+ available without automatically starting workers. Explicitly disabled threads
157
+ skip managed tools, prompt changes, and delegation admission checks. Turning it
158
+ off cleans only backends used for delegation, including when resumed after a
159
+ CLI restart or backend switch, while preserving conversations. An implicit
160
+ default alone does not reconfigure unused native sessions during opt-out.
161
+ Upgrade and restart the local CLI to obtain the new default; existing Routers
162
+ remain compatible, and older CLIs retain their own default.
155
163
 
156
164
  `/status` shows `Delegation: on/off (current thread)` for the thread receiving
157
165
  the command. Reading this setting does not initialize delegation or start workers.
158
166
 
167
+ From CLI 1.6.118, `/status` shows DSH's official recharge and bonus wallet balances when available. Native official-account sign-in is required; API-key-only or custom-provider setup does not supply these wallets. Amounts retain their native decimal precision and currency; balances are not token usage or plan quota. The query does not create or change an ACP conversation. Its owned process uses the same log-upload and telemetry suppression as the DSH executor, is stopped after the query, and omits the balance section on failure or timeout. No other backend or Router protocol changes are required.
168
+
169
+ From CLI 1.6.120, Claude SDK `[claude-code:unrecognized_model]` records with a valid `{model, query_source: "sdk"}` payload are omitted from Feishu streaming/results and Claude slash-command error details. Model names are not hard-coded. Other diagnostics, malformed or unexpected records, actual errors, exit status, and assistant reply text are retained. The persistent Claude process's raw stderr remains in local CLI logs; this presentation filter does not disable Claude Code telemetry or change the configured model, other backends, or the Router protocol.
170
+
159
171
  CLI 1.6.94 and newer show each finished worker as a result block in the existing
160
172
  reply card, with a colored status label, backend name, short task description,
161
173
  and elapsed time. Failed, timed-out, cancelled, and interrupted tasks include a
@@ -1 +1 @@
1
- {"version":3,"file":"MessageHandler.d.ts","sourceRoot":"","sources":["../../src/client/MessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAgK,MAAM,UAAU,CAAC;AACzM,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAyGxD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,WAAW,CAAS;IAC5B,OA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AO,CAAC,iBAAiB;IAkCzB;;OAEG;YACW,mBAAmB;IA0GjC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;;OAGG;YACW,oBAAoB;IA6MlC;;OAEG;YACW,qBAAqB;IAiBnC;;OAEG;IACH,OAAO,CAAC,UAAU;IAuBlB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAG7C;YAEW,eAAe;IAgC7B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;;;;;;;;;;;OAaG;YACW,mBAAmB;IAgEjC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IA0E/B;;OAEG;YACW,cAAc;YAuPd,sBAAsB;IAoBpC,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,sBAAsB;IAuB9B,iFAAiF;IACjF,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,sBAAsB;IAsB9B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,YAAY;IA8CpB,OAAO,CAAC,YAAY;YAUN,cAAc;YAuBd,oBAAoB;IAkHlC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B"}
@@ -9,6 +9,7 @@ const DeviceIdentity_1 = require("../files/DeviceIdentity");
9
9
  const crypto_1 = require("crypto");
10
10
  const DocumentExtractor_1 = require("../files/DocumentExtractor");
11
11
  const path_1 = __importDefault(require("path"));
12
+ const DelegationSettings_1 = require("../thread/DelegationSettings");
12
13
  const hooks_1 = require("../hooks");
13
14
  const FileReadDetector_1 = require("../utils/FileReadDetector");
14
15
  const LocalImageDetector_1 = require("../utils/LocalImageDetector");
@@ -26,6 +27,8 @@ const DelegationManager_1 = require("../delegation/DelegationManager");
26
27
  const DelegationBridge_1 = require("../delegation/DelegationBridge");
27
28
  const contract_1 = require("../delegation/contract");
28
29
  const DelegationStatusFormatter_1 = require("../delegation/DelegationStatusFormatter");
30
+ const BackendCommand_1 = require("../utils/BackendCommand");
31
+ const ClaudeStderrFilter_1 = require("../executor/claude/ClaudeStderrFilter");
29
32
  const EFFORT_BACKENDS = new Set(['codex', 'agy', 'opencode', 'kimi', 'zcode', 'pi', 'dsh']);
30
33
  const NATIVE_MODEL_LIST_BACKENDS = new Set(['codex', 'opencode', 'kimi', 'zcode', 'pi', 'dsh']);
31
34
  const SLASH_SESSION_BACKENDS = new Set(['opencode', 'kimi', 'zcode', 'pi']);
@@ -477,7 +480,7 @@ class MessageHandler {
477
480
  const activeOperation = this.activeThreadOperations.get(threadId);
478
481
  let aborted = false;
479
482
  const operation = (async () => {
480
- if (this.threadManager.getThread(threadId)?.delegation)
483
+ if ((0, DelegationSettings_1.isDelegationEnabled)(this.threadManager.getThread(threadId)))
481
484
  await this.delegation.cancelThread(threadId);
482
485
  aborted = await executor.abort();
483
486
  if (activeOperation)
@@ -605,7 +608,8 @@ class MessageHandler {
605
608
  if (action === 'off') {
606
609
  const thread = this.threadManager.getThread(threadId);
607
610
  const backend = this.threadPool.getBackendKey(threadId);
608
- if (thread.delegationBackends?.includes(backend) || (thread.delegation && !thread.delegationBackends)) {
611
+ // An implicit default does not imply that native tools were ever registered.
612
+ if (thread.delegationBackends?.includes(backend) || (thread.delegation === true && !thread.delegationBackends)) {
609
613
  await executor.configureDelegation?.(undefined);
610
614
  // Preserve cleanup ownership across process recreation and backend switches.
611
615
  if (!thread.delegationBackends)
@@ -622,7 +626,7 @@ class MessageHandler {
622
626
  this.sendResponse(messageId, threadId, {
623
627
  success: true,
624
628
  output: (0, DelegationStatusFormatter_1.formatDelegationStatus)({
625
- enabled: Boolean(this.threadManager.getThread(threadId)?.delegation),
629
+ enabled: (0, DelegationSettings_1.isDelegationEnabled)(this.threadManager.getThread(threadId)),
626
630
  coordinatorBackend,
627
631
  coordinatorSupported: Boolean(executor.configureDelegation),
628
632
  backends,
@@ -632,7 +636,7 @@ class MessageHandler {
632
636
  }
633
637
  if (trimmed.startsWith('/')) {
634
638
  const thread = this.threadManager.getThread(threadId);
635
- if (!thread?.delegation && thread?.delegationBackends?.includes(this.threadPool.getBackendKey(threadId))) {
639
+ if (!(0, DelegationSettings_1.isDelegationEnabled)(thread) && thread?.delegationBackends?.includes(this.threadPool.getBackendKey(threadId))) {
636
640
  // Native slash commands can resume a session before the next ordinary turn.
637
641
  await executor.configureDelegation?.(undefined);
638
642
  }
@@ -681,7 +685,7 @@ class MessageHandler {
681
685
  output: `📊 Status:
682
686
  - Thread: ${thread?.name ?? threadId}
683
687
  - Backend: ${backend}
684
- - Delegation: ${thread?.delegation ? 'on' : 'off'} (current thread)
688
+ - Delegation: ${(0, DelegationSettings_1.isDelegationEnabled)(thread) ? 'on' : 'off'} (current thread)
685
689
  - Model: ${model ?? 'backend default'}
686
690
  - Reasoning effort: ${effort}
687
691
  - Working Directory: ${cwd}
@@ -1230,7 +1234,7 @@ You can also use natural language commands to control Claude Code CLI.`,
1230
1234
  }
1231
1235
  }
1232
1236
  else {
1233
- const bin = key === 'agy' ? (executorConfig.agy?.command ?? 'agy') : 'claude';
1237
+ const bin = (0, BackendCommand_1.getBackendCommand)(key === 'agy' ? 'agy' : 'claude', executorConfig);
1234
1238
  const args = key === 'agy' ? ['models'] : ['/model', '--print'];
1235
1239
  const listing = await this.runListingCommand(bin, args);
1236
1240
  if (listing) {
@@ -1719,17 +1723,19 @@ You can also use natural language commands to control Claude Code CLI.`,
1719
1723
  return;
1720
1724
  }
1721
1725
  const executorConfig = this.config.get('executor') ?? { type: 'auto' };
1722
- const agyCommand = executorConfig.agy?.command ?? 'agy';
1723
- return this.spawnPassthroughCommand(messageId, threadId, agyCommand, ['-p', command], executor, 'AGY CLI');
1726
+ const agyCommand = (0, BackendCommand_1.getBackendCommand)('agy', executorConfig);
1727
+ return this.spawnPassthroughCommand(messageId, threadId, agyCommand, ['-p', command], executor, 'agy');
1724
1728
  }
1725
- return this.spawnPassthroughCommand(messageId, threadId, 'claude', [command, '--print'], executor, 'Claude CLI', { CLAUDECODE: '' });
1729
+ const executorConfig = this.config.get('executor') ?? { type: 'auto' };
1730
+ return this.spawnPassthroughCommand(messageId, threadId, (0, BackendCommand_1.getBackendCommand)('claude', executorConfig), [command, '--print'], executor, 'claude', { CLAUDECODE: '' });
1726
1731
  }
1727
1732
  /**
1728
1733
  * Spawn a one-shot CLI process for a passthrough slash command and relay
1729
1734
  * its output back to the user.
1730
1735
  */
1731
- spawnPassthroughCommand(messageId, threadId, bin, args, executor, label, extraEnv = {}) {
1736
+ spawnPassthroughCommand(messageId, threadId, bin, args, executor, backend, extraEnv = {}) {
1732
1737
  return new Promise((resolve) => {
1738
+ const label = backend === 'agy' ? 'AGY CLI' : 'Claude CLI';
1733
1739
  const chunks = [];
1734
1740
  const errorChunks = [];
1735
1741
  // spawn() reports a missing cwd as an ENOENT naming this binary, so check
@@ -1768,7 +1774,8 @@ You can also use natural language commands to control Claude Code CLI.`,
1768
1774
  });
1769
1775
  }
1770
1776
  else {
1771
- const errorOutput = errorChunks.join('') || chunks.join('');
1777
+ const stderr = errorChunks.join('');
1778
+ const errorOutput = (backend === 'claude' ? (0, ClaudeStderrFilter_1.filterClaudeStderr)(stderr) : stderr) || chunks.join('');
1772
1779
  this.sendResponse(messageId, threadId, {
1773
1780
  success: false,
1774
1781
  error: errorOutput.trim() || `Command failed with exit code ${code}`,
@@ -1830,7 +1837,7 @@ You can also use natural language commands to control Claude Code CLI.`,
1830
1837
  }
1831
1838
  const openId = this.getMessageOpenId(messageId);
1832
1839
  const thread = this.threadManager.getThread(threadId);
1833
- if (thread?.delegation && executor.configureDelegation) {
1840
+ if (thread && (0, DelegationSettings_1.isDelegationEnabled)(thread) && executor.configureDelegation) {
1834
1841
  if (this.delegation.blocksWorkspace(executor.getCurrentWorkingDirectory(), threadId)) {
1835
1842
  throw new Error('A delegated worker holds this workspace. Wait for it to finish; if worker cleanup failed, stop the worker and restart the CLI.');
1836
1843
  }
@@ -2332,29 +2339,34 @@ You can also use natural language commands to control Claude Code CLI.`,
2332
2339
  // ── Backend switching ─────────────────────────────────────────────────────
2333
2340
  checkCommand(cmd, args) {
2334
2341
  return new Promise((resolve) => {
2335
- (0, child_process_1.execFile)(cmd, args, { timeout: 5000 }, (err) => resolve(!err));
2342
+ try {
2343
+ (0, child_process_1.execFile)(cmd, args, { timeout: 5000 }, (err) => resolve({ installed: !err, ...(err ? { reason: (0, BackendCommand_1.backendProbeFailure)(err) } : {}) }));
2344
+ }
2345
+ catch (error) {
2346
+ resolve({ installed: false, reason: (0, BackendCommand_1.backendProbeFailure)(error) });
2347
+ }
2336
2348
  });
2337
2349
  }
2338
2350
  async detectBackends() {
2339
2351
  const executorConfig = this.config.get('executor') ?? { type: 'auto' };
2340
2352
  const [claudeInstalled, codexInstalled, openCodeInstalled, kimiInstalled, piInstalled, agyInstalled, dshInstalled] = await Promise.all([
2341
- this.checkCommand('claude', ['--version']),
2342
- this.checkCommand('codex', ['--version']),
2343
- this.checkCommand('opencode', ['--version']),
2344
- this.checkCommand('kimi', ['--version']),
2345
- this.checkCommand(executorConfig.pi?.command ?? 'pi', ['--version']),
2346
- this.checkCommand('agy', ['--version']),
2347
- this.checkCommand(executorConfig.dsh?.command ?? 'dsh', ['--version']),
2353
+ this.checkCommand((0, BackendCommand_1.getBackendCommand)('claude', executorConfig), ['--version']),
2354
+ this.checkCommand((0, BackendCommand_1.getBackendCommand)('codex', executorConfig), ['--version']),
2355
+ this.checkCommand((0, BackendCommand_1.getBackendCommand)('opencode', executorConfig), ['--version']),
2356
+ this.checkCommand((0, BackendCommand_1.getBackendCommand)('kimi', executorConfig), ['--version']),
2357
+ this.checkCommand((0, BackendCommand_1.getBackendCommand)('pi', executorConfig), ['--version']),
2358
+ this.checkCommand((0, BackendCommand_1.getBackendCommand)('agy', executorConfig), ['--version']),
2359
+ this.checkCommand((0, BackendCommand_1.getBackendCommand)('dsh', executorConfig), ['--version']),
2348
2360
  ]);
2349
2361
  return [
2350
- { id: 'auto', label: 'Claude Code', installed: claudeInstalled },
2351
- { id: 'codex', label: 'Codex CLI (OpenAI)', installed: codexInstalled },
2352
- { id: 'opencode', label: 'OpenCode CLI', installed: openCodeInstalled },
2353
- { id: 'kimi', label: 'Kimi Code CLI', installed: kimiInstalled },
2354
- { id: 'zcode', label: 'ZCode', installed: (0, ZCodeCommand_1.isZCodeAvailable)(executorConfig.zcode?.command) },
2355
- { id: 'pi', label: 'Pi', installed: piInstalled },
2356
- { id: 'agy', label: 'AGY CLI (Antigravity)', installed: agyInstalled },
2357
- { id: 'dsh', label: 'DeepSeek Harness (DSH)', installed: dshInstalled },
2362
+ { id: 'auto', label: 'Claude Code', ...claudeInstalled },
2363
+ { id: 'codex', label: 'Codex CLI (OpenAI)', ...codexInstalled },
2364
+ { id: 'opencode', label: 'OpenCode CLI', ...openCodeInstalled },
2365
+ { id: 'kimi', label: 'Kimi Code CLI', ...kimiInstalled },
2366
+ { id: 'zcode', label: 'ZCode', installed: (0, ZCodeCommand_1.isZCodeAvailable)((0, BackendCommand_1.getBackendCommand)('zcode', executorConfig)) },
2367
+ { id: 'pi', label: 'Pi', ...piInstalled },
2368
+ { id: 'agy', label: 'AGY CLI (Antigravity)', ...agyInstalled },
2369
+ { id: 'dsh', label: 'DeepSeek Harness (DSH)', ...dshInstalled },
2358
2370
  ];
2359
2371
  }
2360
2372
  async handleBackendCommand(messageId, threadId, trimmed) {
@@ -2369,7 +2381,7 @@ You can also use natural language commands to control Claude Code CLI.`,
2369
2381
  if (installed.length === 0) {
2370
2382
  this.sendResponse(messageId, threadId, {
2371
2383
  success: false,
2372
- error: 'No supported AI backends found.\n\nMake sure Claude Code is installed: npm install -g @anthropic-ai/claude-code',
2384
+ error: `No supported AI backends passed their executable checks.\n\n${backends.map(b => `${b.label}: ${b.reason ?? 'Executable could not be located.'}`).join('\n')}\n\nCheck executor.<backend>.command; an absolute executable path is recommended.`,
2373
2385
  });
2374
2386
  return;
2375
2387
  }