@ouro.bot/cli 0.1.0-alpha.1387 → 0.1.0-alpha.1389

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/changelog.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1389",
6
+ "changes": [
7
+ "An approval-gated tool, including a bundle's declared consequential MCP tool, no longer runs on a voice call or through ouro mcp call, where no one can be asked: it answers that it needs approval and nothing runs."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1388",
12
+ "changes": [
13
+ "The daemon sends SIGKILL to a worker that ignores SIGTERM past the stop timeout, then starts its replacement."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1387",
6
18
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1387",
2
+ "runtimeVersion": "0.1.0-alpha.1389",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1387</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1389</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -2477,7 +2477,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2477
2477
  if (protectedCall && protectedCall.policy.kind === "required") {
2478
2478
  if (!options?.approvalCoordinator) {
2479
2479
  streamCallbackBuffer?.discard();
2480
- const rejection = "rejected: this protected tool requires approval, but the approval coordinator is unavailable; the handler was not invoked.";
2480
+ const rejection = tools_1.APPROVAL_UNAVAILABLE_REJECTION;
2481
2481
  rejectToolBatch(msg, [rejection]);
2482
2482
  (0, runtime_1.emitNervesEvent)({
2483
2483
  level: "warn",
@@ -2538,6 +2538,10 @@ class OuroDaemon {
2538
2538
  const binding = matches.length === 1 ? matches[0].mcpBinding : undefined;
2539
2539
  if (!binding)
2540
2540
  return { ok: false, error: "MCP tool is unavailable or ambiguous" };
2541
+ // A tool that asks the person first can't run from here: nothing on this path can ask them (ourostack/ouroboros#1694).
2542
+ if (matches[0].approvalPolicy?.(parsedArgs).kind === "required") {
2543
+ return { ok: false, error: `${binding.server}/${binding.rawName} is declared consequential, so it runs only once the person approves it in a conversation; ouro mcp call can't ask them, so nothing ran.` };
2544
+ }
2541
2545
  const result = await mcpCallManager.manager.callTool(binding, parsedArgs, owner);
2542
2546
  return { ok: true, data: result };
2543
2547
  }
@@ -73,6 +73,7 @@ class DaemonProcessManager {
73
73
  maxCooldownRetries;
74
74
  startupStaleAfterMs;
75
75
  stopTimeoutMs;
76
+ killTimeoutMs;
76
77
  existsSyncFn;
77
78
  configCheckFn;
78
79
  statusWriterFn;
@@ -150,6 +151,7 @@ class DaemonProcessManager {
150
151
  this.maxCooldownRetries = options.maxCooldownRetries ?? 3;
151
152
  this.startupStaleAfterMs = options.startupStaleAfterMs ?? 45_000;
152
153
  this.stopTimeoutMs = options.stopTimeoutMs ?? 4_000;
154
+ this.killTimeoutMs = options.killTimeoutMs ?? 2_000;
153
155
  this.spawnFn = options.spawn ?? ((command, args, spawnOptions) => (0, child_process_1.spawn)(command, args, spawnOptions));
154
156
  this.now = options.now ?? (() => Date.now());
155
157
  this.setTimeoutFn = options.setTimeoutFn ?? ((cb, delay) => setTimeout(cb, delay));
@@ -537,22 +539,56 @@ class DaemonProcessManager {
537
539
  }
538
540
  if (settled)
539
541
  return;
540
- timeout = this.setTimeoutFn(() => {
541
- if (settled)
542
- return;
543
- const errorReason = `managed agent did not exit within ${this.stopTimeoutMs}ms; replacement was not started`;
542
+ const reportStopFailure = (errorReason, fixHint, killed) => {
544
543
  state.stopFailureActive = true;
545
544
  state.snapshot.errorReason = errorReason;
546
- state.snapshot.fixHint = `Inspect managed worker PID ${childPidLabel}; retry only after that worker has exited.`;
545
+ state.snapshot.fixHint = fixHint;
547
546
  (0, runtime_1.emitNervesEvent)({
548
547
  level: "error",
549
548
  component: "daemon",
550
549
  event: "daemon.agent_stop_timeout",
551
550
  message: errorReason,
552
- meta: { agent, pid: childPid, timeoutMs: this.stopTimeoutMs },
551
+ meta: { agent, pid: childPid, timeoutMs: this.stopTimeoutMs, killed, ...(killed ? { killTimeoutMs: this.killTimeoutMs } : {}) },
553
552
  });
554
553
  this.notifySnapshotChange(state.snapshot);
555
554
  finish(new Error(errorReason));
555
+ };
556
+ timeout = this.setTimeoutFn(() => {
557
+ if (settled)
558
+ return;
559
+ // A worker stuck past its own shutdown grace (a turn that never ends, a blocked event loop) would otherwise
560
+ // stay alive with no replacement. SIGKILL ends it; the replacement replays whatever it left pending.
561
+ let killAccepted = false;
562
+ try {
563
+ killAccepted = child.kill("SIGKILL");
564
+ }
565
+ catch {
566
+ killAccepted = false;
567
+ }
568
+ (0, runtime_1.emitNervesEvent)({
569
+ level: "warn",
570
+ component: "daemon",
571
+ event: "daemon.agent_stop_escalated",
572
+ message: killAccepted
573
+ ? "managed agent ignored SIGTERM past the stop timeout; sent SIGKILL"
574
+ : "managed agent ignored SIGTERM past the stop timeout; SIGKILL could not be sent",
575
+ meta: { agent, pid: childPid, timeoutMs: this.stopTimeoutMs, killAccepted },
576
+ });
577
+ if (settled)
578
+ return;
579
+ if (!killAccepted) {
580
+ reportStopFailure(`managed agent did not exit within ${this.stopTimeoutMs}ms and SIGKILL could not be sent; replacement was not started`, `Inspect managed worker PID ${childPidLabel}; retry only after that worker has exited.`, false);
581
+ return;
582
+ }
583
+ timeout = this.setTimeoutFn(() => {
584
+ // A busy daemon runs due timers before it reads child exits, so an exit may already be waiting. Look once
585
+ // more after that I/O has been read, so a worker that did die is not reported as stuck.
586
+ setImmediate(() => {
587
+ if (settled)
588
+ return;
589
+ reportStopFailure(`managed agent did not exit within ${this.stopTimeoutMs}ms, nor ${this.killTimeoutMs}ms after SIGKILL; replacement was not started`, `Inspect managed worker PID ${childPidLabel}; retry only after that worker has exited.`, true);
590
+ });
591
+ }, this.killTimeoutMs);
556
592
  }, this.stopTimeoutMs);
557
593
  });
558
594
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToolSelectionError = exports.surfaceToolDef = exports.speakTool = exports.restTool = exports.ponderTool = exports.observeTool = exports.settleTool = exports.tools = exports.SANCTUARY_OWNER_ADDITIONS = exports.SANCTUARY_MCP_PROVIDED_TOOLS = void 0;
3
+ exports.APPROVAL_UNAVAILABLE_REJECTION = exports.ToolSelectionError = exports.surfaceToolDef = exports.speakTool = exports.restTool = exports.ponderTool = exports.observeTool = exports.settleTool = exports.tools = exports.SANCTUARY_OWNER_ADDITIONS = exports.SANCTUARY_MCP_PROVIDED_TOOLS = void 0;
4
4
  exports.toolSelectionSchemas = toolSelectionSchemas;
5
5
  exports.selectToolsForChannel = selectToolsForChannel;
6
6
  exports.getToolsForChannel = getToolsForChannel;
@@ -10,6 +10,7 @@ exports.registeredToolDefinitions = registeredToolDefinitions;
10
10
  exports.approvalPolicyForToolName = approvalPolicyForToolName;
11
11
  exports.classifyApprovalForInvocation = classifyApprovalForInvocation;
12
12
  exports.approvalPolicyForInvocation = approvalPolicyForInvocation;
13
+ exports.rejectionWithoutApprover = rejectionWithoutApprover;
13
14
  exports.readOnlyOuroShellCommands = readOnlyOuroShellCommands;
14
15
  exports.shellRiskProfile = shellRiskProfile;
15
16
  exports.riskProfileForTool = riskProfileForTool;
@@ -308,6 +309,16 @@ async function approvalPolicyForInvocation(name, args, ctx) {
308
309
  // An approval requirement is not execution authority; dispatch needs the full classification.
309
310
  return (await classifyApprovalForInvocation(name, args, ctx)).policy;
310
311
  }
312
+ /** What an approval-gated call answers where nothing can ask the person, as in a turn with no approval coordinator: the handler never ran. */
313
+ exports.APPROVAL_UNAVAILABLE_REJECTION = "rejected: this protected tool requires approval, but the approval coordinator is unavailable; the handler was not invoked.";
314
+ /**
315
+ * For a dispatch path that can't ask the person, such as a voice call: the rejection when this call needs their approval,
316
+ * else null. Every approval-gated tool, the harness's own and a bundle's declared consequential ones, fails closed there
317
+ * (ourostack/ouroboros#1694).
318
+ */
319
+ async function rejectionWithoutApprover(name, args, ctx) {
320
+ return (await approvalPolicyForInvocation(name, args, ctx)).kind === "required" ? exports.APPROVAL_UNAVAILABLE_REJECTION : null;
321
+ }
311
322
  const findDefinition = resolveToolDefinition;
312
323
  /** The flags that print ouro's help or version, which run nothing. */
313
324
  const OURO_INFO_FLAGS = ["-h", "--help", "-v", "--version"];
@@ -2473,7 +2473,8 @@ class TwilioOpenAIRealtimeMediaStreamSession {
2473
2473
  message: "OpenAI Realtime voice tool call started",
2474
2474
  meta: { agentName: this.options.agentName, callSid: safeSegment(this.callSid), tool: name },
2475
2475
  });
2476
- output = await (0, tools_1.execTool)(name, args, this.toolContext);
2476
+ // A call has no one to approve a protected tool, so it never runs here.
2477
+ output = await (0, tools_1.rejectionWithoutApprover)(name, args, this.toolContext) ?? await (0, tools_1.execTool)(name, args, this.toolContext);
2477
2478
  (0, runtime_1.emitNervesEvent)({
2478
2479
  component: "senses",
2479
2480
  event: "senses.voice_twilio_realtime_tool_end",
@@ -3579,7 +3580,8 @@ class OpenAISipPhoneSession {
3579
3580
  message: "OpenAI SIP voice tool call started",
3580
3581
  meta: { agentName: this.options.agentName, callId: safeSegment(this.metadata.callId), tool: name },
3581
3582
  });
3582
- output = await (0, tools_1.execTool)(name, args, this.toolContext);
3583
+ // A call has no one to approve a protected tool, so it never runs here.
3584
+ output = await (0, tools_1.rejectionWithoutApprover)(name, args, this.toolContext) ?? await (0, tools_1.execTool)(name, args, this.toolContext);
3583
3585
  (0, runtime_1.emitNervesEvent)({
3584
3586
  component: "senses",
3585
3587
  event: "senses.voice_openai_sip_tool_end",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1387",
3
+ "version": "0.1.0-alpha.1389",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1387",
9
+ "version": "0.1.0-alpha.1389",
10
10
  "bundleDependencies": [
11
11
  "@ouro.bot/friends"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1387",
3
+ "version": "0.1.0-alpha.1389",
4
4
  "description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
5
5
  "homepage": "https://ouroboros.bot/",
6
6
  "engines": {