@yu_robotics/remote-cli 1.6.117 → 1.6.128

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 (101) hide show
  1. package/README.md +41 -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/client/WebSocketClient.d.ts +6 -0
  6. package/dist/client/WebSocketClient.d.ts.map +1 -1
  7. package/dist/client/WebSocketClient.js +4 -0
  8. package/dist/client/WebSocketClient.js.map +1 -1
  9. package/dist/commands/config.js +7 -0
  10. package/dist/commands/config.js.map +1 -1
  11. package/dist/commands/start.d.ts.map +1 -1
  12. package/dist/commands/start.js +36 -11
  13. package/dist/commands/start.js.map +1 -1
  14. package/dist/delegation/BackendRegistry.d.ts.map +1 -1
  15. package/dist/delegation/BackendRegistry.js +15 -8
  16. package/dist/delegation/BackendRegistry.js.map +1 -1
  17. package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
  18. package/dist/executor/ClaudePersistentExecutor.js +18 -4
  19. package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
  20. package/dist/executor/CodexAppServerClient.d.ts +5 -0
  21. package/dist/executor/CodexAppServerClient.d.ts.map +1 -1
  22. package/dist/executor/CodexAppServerClient.js +6 -2
  23. package/dist/executor/CodexAppServerClient.js.map +1 -1
  24. package/dist/executor/DshExecutor.d.ts +4 -0
  25. package/dist/executor/DshExecutor.d.ts.map +1 -1
  26. package/dist/executor/DshExecutor.js +8 -0
  27. package/dist/executor/DshExecutor.js.map +1 -1
  28. package/dist/executor/claude/ClaudeStderrFilter.d.ts +11 -0
  29. package/dist/executor/claude/ClaudeStderrFilter.d.ts.map +1 -0
  30. package/dist/executor/claude/ClaudeStderrFilter.js +69 -0
  31. package/dist/executor/claude/ClaudeStderrFilter.js.map +1 -0
  32. package/dist/executor/dsh/DshAccountUsage.d.ts +12 -0
  33. package/dist/executor/dsh/DshAccountUsage.d.ts.map +1 -0
  34. package/dist/executor/dsh/DshAccountUsage.js +134 -0
  35. package/dist/executor/dsh/DshAccountUsage.js.map +1 -0
  36. package/dist/executor/dsh/DshAccountUsagePlugin.d.ts +16 -0
  37. package/dist/executor/dsh/DshAccountUsagePlugin.d.ts.map +1 -0
  38. package/dist/executor/dsh/DshAccountUsagePlugin.js +19 -0
  39. package/dist/executor/dsh/DshAccountUsagePlugin.js.map +1 -0
  40. package/dist/maintenance/CodexStatusProbe.d.ts +26 -0
  41. package/dist/maintenance/CodexStatusProbe.d.ts.map +1 -0
  42. package/dist/maintenance/CodexStatusProbe.js +124 -0
  43. package/dist/maintenance/CodexStatusProbe.js.map +1 -0
  44. package/dist/maintenance/CodexWeekly.d.ts +17 -0
  45. package/dist/maintenance/CodexWeekly.d.ts.map +1 -0
  46. package/dist/maintenance/CodexWeekly.js +60 -0
  47. package/dist/maintenance/CodexWeekly.js.map +1 -0
  48. package/dist/maintenance/MaintenanceClient.d.ts +23 -0
  49. package/dist/maintenance/MaintenanceClient.d.ts.map +1 -0
  50. package/dist/maintenance/MaintenanceClient.js +69 -0
  51. package/dist/maintenance/MaintenanceClient.js.map +1 -0
  52. package/dist/maintenance/PrivateStore.d.ts +10 -0
  53. package/dist/maintenance/PrivateStore.d.ts.map +1 -0
  54. package/dist/maintenance/PrivateStore.js +54 -0
  55. package/dist/maintenance/PrivateStore.js.map +1 -0
  56. package/dist/maintenance/ReleaseNotes.d.ts +30 -0
  57. package/dist/maintenance/ReleaseNotes.d.ts.map +1 -0
  58. package/dist/maintenance/ReleaseNotes.js +139 -0
  59. package/dist/maintenance/ReleaseNotes.js.map +1 -0
  60. package/dist/maintenance/ReleaseOverview.d.ts +23 -0
  61. package/dist/maintenance/ReleaseOverview.d.ts.map +1 -0
  62. package/dist/maintenance/ReleaseOverview.js +56 -0
  63. package/dist/maintenance/ReleaseOverview.js.map +1 -0
  64. package/dist/maintenance/SubscriptionInspection.d.ts +49 -0
  65. package/dist/maintenance/SubscriptionInspection.d.ts.map +1 -0
  66. package/dist/maintenance/SubscriptionInspection.js +193 -0
  67. package/dist/maintenance/SubscriptionInspection.js.map +1 -0
  68. package/dist/maintenance/SubscriptionReminderStore.d.ts +12 -0
  69. package/dist/maintenance/SubscriptionReminderStore.d.ts.map +1 -0
  70. package/dist/maintenance/SubscriptionReminderStore.js +60 -0
  71. package/dist/maintenance/SubscriptionReminderStore.js.map +1 -0
  72. package/dist/maintenance/UpdateNotices.d.ts +21 -0
  73. package/dist/maintenance/UpdateNotices.d.ts.map +1 -0
  74. package/dist/maintenance/UpdateNotices.js +104 -0
  75. package/dist/maintenance/UpdateNotices.js.map +1 -0
  76. package/dist/maintenance/Version.d.ts +3 -0
  77. package/dist/maintenance/Version.d.ts.map +1 -0
  78. package/dist/maintenance/Version.js +42 -0
  79. package/dist/maintenance/Version.js.map +1 -0
  80. package/dist/maintenance/release-notes.json +1 -0
  81. package/dist/service/ServiceManager.d.ts.map +1 -1
  82. package/dist/service/ServiceManager.js +4 -2
  83. package/dist/service/ServiceManager.js.map +1 -1
  84. package/dist/thread/DelegationSettings.d.ts +4 -0
  85. package/dist/thread/DelegationSettings.d.ts.map +1 -0
  86. package/dist/thread/DelegationSettings.js +8 -0
  87. package/dist/thread/DelegationSettings.js.map +1 -0
  88. package/dist/thread/types.d.ts +1 -1
  89. package/dist/thread/types.d.ts.map +1 -1
  90. package/dist/types/config.d.ts +5 -0
  91. package/dist/types/config.d.ts.map +1 -1
  92. package/dist/types/config.js.map +1 -1
  93. package/dist/utils/BackendCommand.d.ts +8 -0
  94. package/dist/utils/BackendCommand.d.ts.map +1 -0
  95. package/dist/utils/BackendCommand.js +26 -0
  96. package/dist/utils/BackendCommand.js.map +1 -0
  97. package/dist/utils/BackendEnvironment.d.ts +16 -0
  98. package/dist/utils/BackendEnvironment.d.ts.map +1 -0
  99. package/dist/utils/BackendEnvironment.js +70 -0
  100. package/dist/utils/BackendEnvironment.js.map +1 -0
  101. package/package.json +2 -2
package/README.md CHANGED
@@ -18,6 +18,26 @@ Remote control Claude Code, AGY CLI, Codex CLI, OpenCode CLI, Kimi Code CLI, ZCo
18
18
 
19
19
  Router 1.6.117 and newer explicitly label standalone background-task notifications **Background task**. The status, originating thread name (or thread ID when no name is provided), and abbreviated task ID remain visible, while **View details** is collapsed by default and contains the rich Markdown result and optional output path. Failed tasks also show a short, literal failure summary outside the panel. This changes only the Router presentation: the CLI protocol, foreground replies, delegated-worker cards, and reply-to-thread routing remain unchanged.
20
20
 
21
+ ## Maintenance Notices
22
+
23
+ From CLI and Router 1.6.127, upgrade notices use concise Chinese summaries from `RELEASE_NOTES_ZH.md`, with one short title and one to three user-visible changes per release. `CHANGELOG.md` remains the English technical record. The CLI build requires matching current-version entries in both documents and bundles both, without online translation or model calls. New Routers show summaries directly and collapse technical details. Earlier maintenance-capable Routers show the summary in their existing collapsed panels; new Routers keep older CLI notes collapsed when no technical-details field is present. Cumulative ranges, silent first adoption, delivery acknowledgements, and protocol version 1 are unchanged.
24
+
25
+ From CLI and Router 1.6.128, upgrade cards group changes by stable feature tags across each device's full pending version range, not just the current detail page. Exact duplicate items are removed within a feature; distinct changes remain available in paged version records. Feature tags are stripped from display Markdown and never shown to users. The overview is bounded to 6 KiB, six features, and 12 items, with explicit omission counts; every original summary and technical record remains in collapsed version details. Older metadata or insufficient overview space falls back to the existing per-version display. The optional overview preserves protocol version 1 and old-peer behavior, without model calls or changes to first adoption, notification progress, or acknowledgements.
26
+
27
+ From CLI and Router 1.6.123, the first feature-enabled start records a silent version baseline, without sending historical changelogs. Later successful newer starts deliver cumulative bundled release notes, including skipped/offline upgrades, in standalone cards with collapsed Markdown and View more. Downgrades keep the notification baseline; old Routers leave notices pending without changing normal messaging.
28
+
29
+ Startup and hourly Codex-only status inspection runs independently of user threads and other backends. It uses native file-backed ChatGPT tokens ephemerally, never refreshes/writes credentials, and never creates a thread or sends a prompt. Keyring-only or expired login and unavailable APIs are not treated as zero usage. Reminders require two zero-usage samples 58-62 minutes apart, each with approximately seven days remaining, and a reset deadline that advances with elapsed time (two-minute tolerances). This is a notification heuristic, not a confirmed provider activation or reset policy. Account observations remain in memory; acknowledged delivery suppression is persisted as described below. Reminders carry a backend identifier for backend-specific copy; Codex explains possible reset-countdown drift and tells the user to send a normal task to start the next usage window, without verification steps. Cards show 100% weekly availability at the qualifying checks, not a live balance or a guarantee about when a usage window starts. New reminder cards have no buttons; legacy Dismiss callbacks never send requests. No Send Hi button or automatic activation is offered.
30
+
31
+ From Router 1.6.125, quota reminder cards use the title **🎯 Codex Reset** and summary **Weekly quota reset: 100%**, without the sampling-disclaimer footer. From Router 1.6.126, new quota cards have no buttons; validated legacy Dismiss callbacks remain passive. Normal-task guidance and inspection criteria are unchanged.
32
+
33
+ From CLI 1.6.126, acknowledged quota-reminder suppression survives upgrades and restarts in a private local ledger under `~/.remote-cli/subscription-reminders/`, scoped to the Router and device. It stores only hashed account/bucket fingerprints, not tokens, raw account identifiers, credential metadata, reset timestamps, or quota observations. Credential refreshes do not clear suppression; only a valid non-candidate observation rearms that account. Missing/failed probes retain suppression. Sampling baselines remain in memory. Accepted acknowledgement writes finish before graceful shutdown; corrupt, unsafe, or unavailable storage pauses quota inspection and reminder delivery without erasing the ledger or affecting normal messaging.
34
+
35
+ Deduplication is not exactly once: a crash between card delivery and local acknowledgement persistence can still produce a duplicate. Earlier clients retain process-only suppression, and their delivery history cannot be recovered on first adoption of the ledger; one additional qualifying reminder is possible. The Router presentation change alone does not give an older CLI restart-safe suppression.
36
+
37
+ Token handoff uses an experimental, unstable app-server login API that OpenAI may change or remove. Unsupported versions make inspection unavailable without affecting messaging or falling back to a model request. Reverify this API when updating the supported Codex version.
38
+
39
+ Both features default to enabled. Set `maintenance.updateNotice` or `maintenance.subscriptionInspection` to `false` using `remote-cli config set` and restart to opt out. See [Maintenance Notices](../../README.md#maintenance-notices) for delivery, privacy, retention, and compatibility limits.
40
+
21
41
  ## Prerequisites
22
42
 
23
43
  - **Node.js** >= 18.0.0
@@ -91,6 +111,8 @@ Help me fix TypeScript errors in ~/projects/my-app
91
111
 
92
112
  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
113
 
114
+ 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).
115
+
94
116
  ## Commands
95
117
 
96
118
  | Command | Description |
@@ -139,23 +161,33 @@ Linux users upgrading from version 1.6.23 or earlier should run `remote-cli serv
139
161
 
140
162
  ### Threads & Machines
141
163
 
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,
164
+ From CLI 1.6.121, new and existing threads without a saved preference enable
165
+ delegation by default. Their selected backend can assign bounded tasks to other
166
+ installed, authenticated backends. Claude Code, Codex, Pi, AGY, OpenCode, Kimi
167
+ Code, ZCode, and DSH can coordinate or work. From CLI 1.6.95,
145
168
  same-backend delegation is rejected before launching a worker; discovery marks
146
169
  the current backend unavailable as a worker. Use the current backend directly
147
170
  or its native subagents, if supported. Workers return results to the original conversation and use
148
171
  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.
172
+ shows discovery and restrictions; `/delegation off` explicitly disables the
173
+ feature and `/delegation on` enables it again. Saved opt-outs remain off across
174
+ upgrades, context resets, backend switches, and CLI restarts. No historical
175
+ thread migration or conversation reset is required. Default-on makes tools
176
+ available without automatically starting workers. Explicitly disabled threads
177
+ skip managed tools, prompt changes, and delegation admission checks. Turning it
178
+ off cleans only backends used for delegation, including when resumed after a
179
+ CLI restart or backend switch, while preserving conversations. An implicit
180
+ default alone does not reconfigure unused native sessions during opt-out.
181
+ Upgrade and restart the local CLI to obtain the new default; existing Routers
182
+ remain compatible, and older CLIs retain their own default.
155
183
 
156
184
  `/status` shows `Delegation: on/off (current thread)` for the thread receiving
157
185
  the command. Reading this setting does not initialize delegation or start workers.
158
186
 
187
+ 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.
188
+
189
+ From CLI 1.6.120, Claude SDK `[claude-code:unrecognized_model]` diagnostics are omitted from Feishu streaming/results and Claude slash-command error details. CLI 1.6.124 also filters the `generate_session_title` source, including delegated Claude workers. Matching requires a bounded, standalone valid JSON record containing only a nonempty `model` string and a recognized `query_source` (`sdk` or `generate_session_title`); model names are not hard-coded. Unknown sources, additional payload fields, malformed records, actual API/authentication 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.
190
+
159
191
  CLI 1.6.94 and newer show each finished worker as a result block in the existing
160
192
  reply card, with a colored status label, backend name, short task description,
161
193
  and elapsed time. Failed, timed-out, cancelled, and interrupted tasks include a
@@ -1 +1 @@
1
- {"version":3,"file":"M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EG;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
  }