mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(app): keep hidden timelines dormant
This commit is contained in:
@@ -908,7 +908,7 @@ function ChatAgentContent({
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!isConnected || !hasSession) {
|
||||
if (!isPaneFocused || !isConnected || !hasSession) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
@@ -969,6 +969,7 @@ function ChatAgentContent({
|
||||
ensureAgentIsInitialized,
|
||||
hasSession,
|
||||
isConnected,
|
||||
isPaneFocused,
|
||||
missingAgentState.kind,
|
||||
serverId,
|
||||
]);
|
||||
|
||||
@@ -183,4 +183,32 @@ describe("agent directory reconciliation", () => {
|
||||
usage: { inputTokens: 20, outputTokens: 8 },
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves usage when a stale buffered upsert omits it", () => {
|
||||
const result = reconcileAgentDirectory({
|
||||
previous: new Map(),
|
||||
snapshot: [
|
||||
{
|
||||
...entry("agent", "idle"),
|
||||
agent: {
|
||||
...snapshot("agent", "idle"),
|
||||
updatedAt: "2026-07-12T12:00:00.000Z",
|
||||
lastUsage: { inputTokens: 10, outputTokens: 5 },
|
||||
},
|
||||
},
|
||||
],
|
||||
deltas: [
|
||||
{
|
||||
kind: "upsert",
|
||||
agent: {
|
||||
...snapshot("agent", "running"),
|
||||
updatedAt: "2026-07-12T11:00:00.000Z",
|
||||
},
|
||||
project: entry("agent", "idle").project,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(result.entries[0]?.agent.lastUsage).toEqual({ inputTokens: 10, outputTokens: 5 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,6 +15,7 @@ export function acceptAgentDirectoryUpdate<T extends AgentUpdateValue>(
|
||||
incoming: T,
|
||||
): T {
|
||||
if (!current || timestamp(incoming.updatedAt) >= timestamp(current.updatedAt)) return incoming;
|
||||
if (incoming.lastUsage === undefined) return current;
|
||||
if (equal(incoming.lastUsage, current.lastUsage)) return current;
|
||||
return { ...current, lastUsage: incoming.lastUsage };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user