@ouro.bot/cli 0.1.0-alpha.1386 → 0.1.0-alpha.1388
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.1388",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The daemon sends SIGKILL to a worker that ignores SIGTERM past the stop timeout, then starts its replacement."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1387",
|
|
12
|
+
"changes": [
|
|
13
|
+
"Declared consequential MCP tools now wait for the person's approval before they run (#1694)."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1386",
|
|
6
18
|
"changes": [
|
|
@@ -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.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1388</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -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
|
-
|
|
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 =
|
|
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
|
}
|
|
@@ -120,6 +120,10 @@ function mcpToolsAsDefinitions(view) {
|
|
|
120
120
|
risk: "high",
|
|
121
121
|
reason: "MCP tools may mutate external systems",
|
|
122
122
|
},
|
|
123
|
+
// A declared consequential tool waits for the person's approval, like the harness's own consequential tools.
|
|
124
|
+
...(declared?.ax.effect === "consequential"
|
|
125
|
+
? { approvalPolicy: () => ({ kind: "required", policyId: "mcp.declared.consequential.v1", actionClass: `mcp.${entry.server}.${tool.name}`, requiresSoleCall: true }) }
|
|
126
|
+
: {}),
|
|
123
127
|
handler: async (args, ctx) => {
|
|
124
128
|
if (ctx?.agentName !== binding.agentName || ctx.agentRoot !== binding.agentRoot) {
|
|
125
129
|
(0, runtime_1.emitNervesEvent)({
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1388",
|
|
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.
|
|
9
|
+
"version": "0.1.0-alpha.1388",
|
|
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.
|
|
3
|
+
"version": "0.1.0-alpha.1388",
|
|
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": {
|