@nathapp/nax-agent 0.91.2 → 0.91.4
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 +8 -0
- package/dist/native/session/turn-loop.js +16 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to `@nathapp/nax-agent` are recorded here. The format follow
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/). While the version is `0.x`, a minor
|
|
5
5
|
release may change the public API.
|
|
6
6
|
|
|
7
|
+
## [0.91.4] - 2026-10-23
|
|
8
|
+
|
|
9
|
+
- No changes in this package. Released in lockstep with the other nax packages.
|
|
10
|
+
|
|
11
|
+
## [0.91.3] - 2026-10-22
|
|
12
|
+
|
|
13
|
+
- No changes in this package. Released in lockstep with the other nax packages.
|
|
14
|
+
|
|
7
15
|
## [0.91.2] - 2026-10-22
|
|
8
16
|
|
|
9
17
|
- No changes in this package. Released in lockstep with the other nax packages.
|
|
@@ -49,6 +49,12 @@ function beforeTurnSeed(patch, prompt) {
|
|
|
49
49
|
getSafeLogger()?.warn("native-loop-events", "before_turn seed patch rejected: seed must be a non-empty user-role array", { seedLength: patch.length });
|
|
50
50
|
return [{ role: "user", content: prompt }];
|
|
51
51
|
}
|
|
52
|
+
/** Keep billed spend on the original error for both loop and persistence failures. */
|
|
53
|
+
function recordFailureSpend(err, usage) {
|
|
54
|
+
if (typeof err === "object" && err !== null) {
|
|
55
|
+
recordNativeTurnFailureUsage(err, { tokenUsage: usage.tokens(), costUsd: usage.costUsd() });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
52
58
|
export async function runNativeTurn(handle, prompt, opts, deps) {
|
|
53
59
|
const transcript = sessionTranscriptFor(deps.sessionState, handle.id);
|
|
54
60
|
if (transcript === undefined) {
|
|
@@ -228,12 +234,7 @@ export async function runNativeTurn(handle, prompt, opts, deps) {
|
|
|
228
234
|
});
|
|
229
235
|
// nax#1840: attach what was already spent, keyed on the error's own
|
|
230
236
|
// identity so the error itself is rethrown byte-for-byte unmodified.
|
|
231
|
-
|
|
232
|
-
recordNativeTurnFailureUsage(err, {
|
|
233
|
-
tokenUsage: usage.tokens(),
|
|
234
|
-
costUsd: usage.costUsd(),
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
+
recordFailureSpend(err, usage);
|
|
237
238
|
throw err;
|
|
238
239
|
}
|
|
239
240
|
logTurnTailWarnings({
|
|
@@ -248,7 +249,15 @@ export async function runNativeTurn(handle, prompt, opts, deps) {
|
|
|
248
249
|
// Persisted before returning, and a write failure fails the turn: continuing
|
|
249
250
|
// on a history that could not be stored is the silent degradation #1794
|
|
250
251
|
// removed from the pipeline (ADR-028 s4).
|
|
251
|
-
|
|
252
|
+
try {
|
|
253
|
+
await store.save(handle.id, transcriptDocFor(state.messages, transcriptIdentity));
|
|
254
|
+
}
|
|
255
|
+
catch (err) {
|
|
256
|
+
// Persistence can fail after the model finished: keep its billed spend on
|
|
257
|
+
// the original error, just as the loop's failure path does above.
|
|
258
|
+
recordFailureSpend(err, usage);
|
|
259
|
+
throw err;
|
|
260
|
+
}
|
|
252
261
|
return buildTurnResult({
|
|
253
262
|
output: state.output,
|
|
254
263
|
usage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nax-agent",
|
|
3
|
-
"version": "0.91.
|
|
3
|
+
"version": "0.91.4",
|
|
4
4
|
"description": "nax's native coding agent: session contract, native loop, tools, permissions, sandbox, command-safety.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "William Khoo",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@anthropic-ai/sandbox-runtime": "0.0.77",
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
50
|
-
"@nathapp/nax-ai": "0.91.
|
|
50
|
+
"@nathapp/nax-ai": "0.91.4",
|
|
51
51
|
"zod": "^4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|