Compare commits
2 Commits
main
...
fix/sessio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2065e8d96 | ||
|
|
78d9f5baff |
@ -19,6 +19,7 @@ Docs: https://docs.clawd.bot
|
||||
- CLI: suppress diagnostic session/run noise during auth probes.
|
||||
- Linux: include env-configured user bin roots in systemd PATH and align PATH audits. (#1512) Thanks @robbyczgw-cla.
|
||||
- TUI: render Gateway slash-command replies as system output (for example, `/context`).
|
||||
- TUI/Gateway: reset session token counters on `/new` and refresh the footer immediately. (#1542) Thanks @robbyczgw-cla.
|
||||
- Media: preserve PNG alpha when possible; fall back to JPEG when still over size cap. (#1491) Thanks @robbyczgw-cla.
|
||||
- Agents: treat plugin-only tool allowlists as opt-ins; keep core tools enabled. (#1467)
|
||||
- Exec approvals: persist allowlist entry ids to keep macOS allowlist rows stable. (#1521) Thanks @ngutman.
|
||||
|
||||
@ -251,6 +251,10 @@ export const sessionsHandlers: GatewayRequestHandlers = {
|
||||
lastChannel: entry?.lastChannel,
|
||||
lastTo: entry?.lastTo,
|
||||
skillsSnapshot: entry?.skillsSnapshot,
|
||||
// Reset token counts to 0 on session reset (#1523)
|
||||
inputTokens: 0,
|
||||
outputTokens: 0,
|
||||
totalTokens: 0,
|
||||
};
|
||||
store[primaryKey] = nextEntry;
|
||||
return nextEntry;
|
||||
|
||||
@ -345,11 +345,19 @@ describe("gateway server sessions", () => {
|
||||
const reset = await rpcReq<{
|
||||
ok: true;
|
||||
key: string;
|
||||
entry: { sessionId: string };
|
||||
entry: {
|
||||
sessionId: string;
|
||||
inputTokens?: number;
|
||||
outputTokens?: number;
|
||||
totalTokens?: number;
|
||||
};
|
||||
}>(ws, "sessions.reset", { key: "agent:main:main" });
|
||||
expect(reset.ok).toBe(true);
|
||||
expect(reset.payload?.key).toBe("agent:main:main");
|
||||
expect(reset.payload?.entry.sessionId).not.toBe("sess-main");
|
||||
expect(reset.payload?.entry.inputTokens).toBe(0);
|
||||
expect(reset.payload?.entry.outputTokens).toBe(0);
|
||||
expect(reset.payload?.entry.totalTokens).toBe(0);
|
||||
|
||||
const badThinking = await rpcReq(ws, "sessions.patch", {
|
||||
key: "agent:main:main",
|
||||
|
||||
@ -409,8 +409,15 @@ export function createCommandHandlers(context: CommandHandlerContext) {
|
||||
case "reset":
|
||||
try {
|
||||
await client.resetSession(state.currentSessionKey);
|
||||
// Clear token counts after reset to avoid stale display while refreshing. (#1523)
|
||||
state.sessionInfo.inputTokens = 0;
|
||||
state.sessionInfo.outputTokens = 0;
|
||||
state.sessionInfo.totalTokens = 0;
|
||||
tui.requestRender();
|
||||
|
||||
chatLog.addSystem(`session ${state.currentSessionKey} reset`);
|
||||
await loadHistory();
|
||||
await refreshSessionInfo();
|
||||
} catch (err) {
|
||||
chatLog.addSystem(`reset failed: ${String(err)}`);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user