@earendil-works/pi-coding-agent 0.81.0 → 0.81.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 +18 -0
- package/dist/core/agent-session.d.ts +22 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +32 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +5 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +5 -7
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +13 -4
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +21 -17
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +7 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +34 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/json.md +5 -1
- package/docs/rpc.md +33 -0
- package/docs/sdk.md +3 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -1420,7 +1420,7 @@ export class AgentSession {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
else {
|
|
1422
1422
|
// Generate compaction result
|
|
1423
|
-
const result = await compact(preparation, this.model, apiKey, headers, customInstructions, this._compactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env);
|
|
1423
|
+
const result = await compact(preparation, this.model, apiKey, headers, customInstructions, this._compactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env, this.settingsManager.getRetrySettings(), this._summarizationRetryCallbacks({ source: "compaction", reason: "manual" }));
|
|
1424
1424
|
summary = result.summary;
|
|
1425
1425
|
firstKeptEntryId = result.firstKeptEntryId;
|
|
1426
1426
|
tokensBefore = result.tokensBefore;
|
|
@@ -1659,7 +1659,7 @@ export class AgentSession {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
else {
|
|
1661
1661
|
// Generate compaction result
|
|
1662
|
-
const compactResult = await compact(preparation, this.model, apiKey, headers, undefined, this._autoCompactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env);
|
|
1662
|
+
const compactResult = await compact(preparation, this.model, apiKey, headers, undefined, this._autoCompactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env, this.settingsManager.getRetrySettings(), this._summarizationRetryCallbacks({ source: "compaction", reason }));
|
|
1663
1663
|
summary = compactResult.summary;
|
|
1664
1664
|
firstKeptEntryId = compactResult.firstKeptEntryId;
|
|
1665
1665
|
tokensBefore = compactResult.tokensBefore;
|
|
@@ -2088,6 +2088,34 @@ export class AgentSession {
|
|
|
2088
2088
|
return false;
|
|
2089
2089
|
return isRetryableAssistantError(message);
|
|
2090
2090
|
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Retry policy + callbacks shared by compaction and branch-summary summarization calls.
|
|
2093
|
+
* Uses the same `settings.retry` budget/backoff as agent-turn retries so a single transient
|
|
2094
|
+
* stream drop no longer fails the whole operation. `source` carries the context
|
|
2095
|
+
* the TUI needs to render the retry and recreate the underlying indicator.
|
|
2096
|
+
*/
|
|
2097
|
+
_summarizationRetryCallbacks(source) {
|
|
2098
|
+
return {
|
|
2099
|
+
onRetryScheduled: (attempt, maxAttempts, delayMs, errorMessage) => {
|
|
2100
|
+
this._emit({
|
|
2101
|
+
type: "summarization_retry_scheduled",
|
|
2102
|
+
attempt,
|
|
2103
|
+
maxAttempts,
|
|
2104
|
+
delayMs,
|
|
2105
|
+
errorMessage,
|
|
2106
|
+
});
|
|
2107
|
+
},
|
|
2108
|
+
onRetryAttemptStart: () => {
|
|
2109
|
+
this._emit({
|
|
2110
|
+
type: "summarization_retry_attempt_start",
|
|
2111
|
+
...source,
|
|
2112
|
+
});
|
|
2113
|
+
},
|
|
2114
|
+
onRetryFinished: () => {
|
|
2115
|
+
this._emit({ type: "summarization_retry_finished" });
|
|
2116
|
+
},
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2091
2119
|
/**
|
|
2092
2120
|
* Prepare a retryable error for continuation with exponential backoff.
|
|
2093
2121
|
* @returns true if the caller should continue the agent, false otherwise
|
|
@@ -2348,6 +2376,8 @@ export class AgentSession {
|
|
|
2348
2376
|
replaceInstructions,
|
|
2349
2377
|
reserveTokens: branchSummarySettings.reserveTokens,
|
|
2350
2378
|
streamFn: this.agent.streamFunction,
|
|
2379
|
+
retry: this.settingsManager.getRetrySettings(),
|
|
2380
|
+
callbacks: this._summarizationRetryCallbacks({ source: "branchSummary" }),
|
|
2351
2381
|
});
|
|
2352
2382
|
if (result.aborted) {
|
|
2353
2383
|
return { cancelled: true, aborted: true };
|