@router-for-me/pi-cliproxyapi-provider 1.4.12 → 1.4.13
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/extensions/tps.ts +7 -13
- package/package.json +1 -1
package/extensions/tps.ts
CHANGED
|
@@ -126,9 +126,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
pi.on("agent_end", (event, ctx) => {
|
|
129
|
+
if (requestStartMs === null) return;
|
|
129
130
|
// Ignore usage from subagent / non-TUI sessions.
|
|
130
131
|
if (!isPrimaryUiSession(ctx)) return;
|
|
131
|
-
if (requestStartMs === null) return;
|
|
132
132
|
|
|
133
133
|
for (const message of event.messages) {
|
|
134
134
|
if (!isAssistantMessage(message)) continue;
|
|
@@ -141,9 +141,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
pi.on("agent_settled", (_event, ctx) => {
|
|
144
|
+
if (requestStartMs === null) return;
|
|
144
145
|
// Subagents must never clear the parent elapsed status or notify TPS.
|
|
145
146
|
if (!isPrimaryUiSession(ctx)) return;
|
|
146
|
-
if (requestStartMs === null) return;
|
|
147
147
|
|
|
148
148
|
const elapsedMs = getElapsedMs();
|
|
149
149
|
const elapsedSecondsExact = elapsedMs / 1000;
|
|
@@ -164,17 +164,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
pi.on("session_shutdown", (_event, ctx) => {
|
|
167
|
-
if (statusCtx !== ctx && !isPrimaryUiSession(ctx)) return;
|
|
168
|
-
|
|
169
167
|
clearRefreshTimer();
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
pausedDurationAtStartMs = 0;
|
|
176
|
-
pauseWasEnabledAtStart = false;
|
|
177
|
-
statusCtx = null;
|
|
178
|
-
}
|
|
168
|
+
clearStatus(ctx);
|
|
169
|
+
requestStartMs = null;
|
|
170
|
+
pausedDurationAtStartMs = 0;
|
|
171
|
+
pauseWasEnabledAtStart = false;
|
|
172
|
+
statusCtx = null;
|
|
179
173
|
});
|
|
180
174
|
}
|
package/package.json
CHANGED