@aiaiai-pt/martha-cli 0.66.0 → 0.66.1
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.md +6 -0
- package/dist/index.js +19 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@aiaiai-pt/martha-cli`. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). This project adheres to semver — `0.x` releases may include breaking changes between minor versions.
|
|
4
4
|
|
|
5
|
+
## [0.66.1] — 2026-11-01
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `martha runner` and `martha chat --local-exec` no longer run a host command when its gate cannot be claimed. A claim that fails with a network error or 5xx is retried twice, then the gate is skipped. Previously any non-409 failure fell through to execution, and the server, which enforces the claim, rejected the result, so the command ran with nowhere to report. This is what happened for runs Temporal no longer had (#1859).
|
|
10
|
+
|
|
5
11
|
## [0.66.0] — 2026-11-01
|
|
6
12
|
|
|
7
13
|
### Added
|
package/dist/index.js
CHANGED
|
@@ -11244,7 +11244,7 @@ init_config();
|
|
|
11244
11244
|
init_errors();
|
|
11245
11245
|
|
|
11246
11246
|
// src/version.ts
|
|
11247
|
-
var CLI_VERSION = "0.66.
|
|
11247
|
+
var CLI_VERSION = "0.66.1";
|
|
11248
11248
|
|
|
11249
11249
|
// src/commands/sessions.ts
|
|
11250
11250
|
function relativeTime(iso) {
|
|
@@ -13546,6 +13546,7 @@ async function resolveLocalAgent(sessionId, toolCallId, req, state) {
|
|
|
13546
13546
|
log_path: result.log_path
|
|
13547
13547
|
};
|
|
13548
13548
|
}
|
|
13549
|
+
var CLAIM_RETRY = { delaysMs: [1000, 3000] };
|
|
13549
13550
|
async function claimGate(sessionId, toolCallId, state, transport) {
|
|
13550
13551
|
if (state.claimed.has(toolCallId))
|
|
13551
13552
|
return true;
|
|
@@ -13553,19 +13554,25 @@ async function claimGate(sessionId, toolCallId, state, transport) {
|
|
|
13553
13554
|
const secretHash = createHash2("sha256").update(secret).digest("hex");
|
|
13554
13555
|
state.secrets.set(toolCallId, secret);
|
|
13555
13556
|
await state.journal.recordSecret(sessionId, toolCallId, secret);
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13557
|
+
for (let attempt = 0;; attempt++) {
|
|
13558
|
+
try {
|
|
13559
|
+
await transport.claim(toolCallId, secretHash);
|
|
13560
|
+
state.claimed.add(toolCallId);
|
|
13561
|
+
return true;
|
|
13562
|
+
} catch (e) {
|
|
13563
|
+
if (e instanceof MarthaAPIError && e.status === 409) {
|
|
13564
|
+
process.stderr.write(source_default.yellow(`[local-exec] gate ${toolCallId} is not pending (already resolved or timed out) — skipping execution
|
|
13563
13565
|
`));
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13566
|
+
return false;
|
|
13567
|
+
}
|
|
13568
|
+
const final = e instanceof MarthaAPIError && e.status >= 400 && e.status < 500;
|
|
13569
|
+
if (final || attempt >= CLAIM_RETRY.delaysMs.length) {
|
|
13570
|
+
process.stderr.write(source_default.yellow(`[local-exec] failed to claim gate for ${toolCallId}: ${String(e)} — skipping execution
|
|
13567
13571
|
`));
|
|
13568
|
-
|
|
13572
|
+
return false;
|
|
13573
|
+
}
|
|
13574
|
+
await new Promise((r) => setTimeout(r, CLAIM_RETRY.delaysMs[attempt]));
|
|
13575
|
+
}
|
|
13569
13576
|
}
|
|
13570
13577
|
}
|
|
13571
13578
|
async function postToolResult(toolCallId, result, label, transport, execSecret) {
|