gsd-pi 2.34.0-dev.6769913 → 2.34.0-dev.7d38042
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/package.json +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts +0 -14
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +27 -24
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +0 -1
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +22 -11
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +27 -30
- package/packages/pi-agent-core/src/agent.ts +23 -12
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +0 -4
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +5 -15
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +5 -17
|
@@ -246,12 +246,6 @@ export class AgentSession {
|
|
|
246
246
|
private _retryPromise: Promise<void> | undefined = undefined;
|
|
247
247
|
private _retryResolve: (() => void) | undefined = undefined;
|
|
248
248
|
|
|
249
|
-
// Cumulative session stats — survives compaction (#1423)
|
|
250
|
-
private _cumulativeCost = 0;
|
|
251
|
-
private _cumulativeInputTokens = 0;
|
|
252
|
-
private _cumulativeOutputTokens = 0;
|
|
253
|
-
private _cumulativeToolCalls = 0;
|
|
254
|
-
|
|
255
249
|
// Bash execution state
|
|
256
250
|
private _bashAbortController: AbortController | undefined = undefined;
|
|
257
251
|
private _pendingBashMessages: BashExecutionMessage[] = [];
|
|
@@ -444,13 +438,7 @@ export class AgentSession {
|
|
|
444
438
|
if (event.message.role === "assistant") {
|
|
445
439
|
this._lastAssistantMessage = event.message;
|
|
446
440
|
|
|
447
|
-
// Accumulate session stats that survive compaction (#1423)
|
|
448
441
|
const assistantMsg = event.message as AssistantMessage;
|
|
449
|
-
this._cumulativeCost += assistantMsg.usage?.cost?.total ?? 0;
|
|
450
|
-
this._cumulativeInputTokens += assistantMsg.usage?.input ?? 0;
|
|
451
|
-
this._cumulativeOutputTokens += assistantMsg.usage?.output ?? 0;
|
|
452
|
-
this._cumulativeToolCalls += assistantMsg.content.filter((c) => c.type === "toolCall").length;
|
|
453
|
-
|
|
454
442
|
if (assistantMsg.stopReason !== "error") {
|
|
455
443
|
this._overflowRecoveryAttempted = false;
|
|
456
444
|
}
|
|
@@ -3242,17 +3230,17 @@ export class AgentSession {
|
|
|
3242
3230
|
sessionId: this.sessionId,
|
|
3243
3231
|
userMessages,
|
|
3244
3232
|
assistantMessages,
|
|
3245
|
-
toolCalls
|
|
3233
|
+
toolCalls,
|
|
3246
3234
|
toolResults,
|
|
3247
3235
|
totalMessages: state.messages.length,
|
|
3248
3236
|
tokens: {
|
|
3249
|
-
input:
|
|
3250
|
-
output:
|
|
3237
|
+
input: totalInput,
|
|
3238
|
+
output: totalOutput,
|
|
3251
3239
|
cacheRead: totalCacheRead,
|
|
3252
3240
|
cacheWrite: totalCacheWrite,
|
|
3253
|
-
total:
|
|
3241
|
+
total: totalInput + totalOutput + totalCacheRead + totalCacheWrite,
|
|
3254
3242
|
},
|
|
3255
|
-
cost:
|
|
3243
|
+
cost: totalCost,
|
|
3256
3244
|
};
|
|
3257
3245
|
}
|
|
3258
3246
|
|