openclaw/src/auto-reply
Glucksberg 93b450349f
fix: clear stale token metrics on /new and /reset (#8929)
When starting a new session via /new or /reset, the token usage fields
(totalTokens, inputTokens, outputTokens, contextTokens) survived from the
previous session via the spread pattern in session init. This caused /status
to display misleading context usage from the old session.

Clear all four token metrics explicitly in the isNewSession block, alongside
the existing compactionCount reset. Also add diagnostic logging for session
forking via ParentSessionKey to help trace context inheritance.
2026-02-05 13:42:59 -08:00
..
reply fix: clear stale token metrics on /new and /reset (#8929) 2026-02-05 13:42:59 -08:00
chunk.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
chunk.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
command-auth.ts fix: restore discord owner hint from allowlists 2026-02-04 23:34:22 -08:00
command-control.test.ts test: register discord plugin in allowlist test 2026-02-05 00:38:50 -08:00
command-detection.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
commands-args.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
commands-registry.data.ts Revert "iOS: wire node services and tests" 2026-02-02 17:36:49 +00:00
commands-registry.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
commands-registry.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
commands-registry.types.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
dispatch.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
envelope.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
envelope.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
group-activation.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
heartbeat.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
heartbeat.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
inbound-debounce.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
inbound.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
media-note.test.ts refactor: tighten media diagnostics 2026-01-17 07:27:38 +00:00
media-note.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
model.test.ts Fix models command (#1753) 2026-01-25 10:02:12 +00:00
model.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
reply.block-streaming.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.directive.directive-behavior.accepts-thinking-xhigh-codex-models.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.applies-inline-reasoning-mixed-messages-acks-immediately.e2e.test.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
reply.directive.directive-behavior.defaults-think-low-reasoning-capable-models-no.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.ignores-inline-model-uses-default-model.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.lists-allowlisted-models-model-list.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.prefers-alias-matches-fuzzy-selection-is-ambiguous.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.requires-per-agent-allowlist-addition-global.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.returns-status-alongside-directive-only-acks.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.shows-current-elevated-level-as-off-after.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.shows-current-verbose-level-verbose-has-no.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.supports-fuzzy-model-matches-model-directive.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.directive-behavior.updates-tool-verbose-during-flight-run-toggle.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.directive.parse.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.heartbeat-typing.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.media-note.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.queue.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.raw-body.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.group-intro-prompts.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.allows-activation-from-allowfrom-groups.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.allows-approved-sender-toggle-elevated-mode.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.allows-elevated-off-groups-without-mention.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.filters-usage-summary-current-model-provider.e2e.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.triggers.trigger-handling.handles-inline-commands-strips-it-before-agent.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.ignores-inline-elevated-directive-unapproved-sender.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.includes-error-cause-embedded-agent-throws.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.keeps-inline-status-unauthorized-senders.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.reports-active-auth-profile-key-snippet-status.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.runs-compact-as-gated-command.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.shows-endpoint-default-model-status-not-configured.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.shows-quick-model-picker-grouped-by-model.e2e.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.security.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.triggers.trigger-handling.targets-active-session-native-stop.e2e.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
reply.ts feat: add /exec session overrides 2026-01-18 06:12:54 +00:00
send-policy.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
skill-commands.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
skill-commands.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
status.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
status.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
templating.ts fix: restore discord owner hint from allowlists 2026-02-04 23:34:22 -08:00
thinking.test.ts fix: align ZAI thinking toggles 2026-01-16 22:26:43 +00:00
thinking.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
tokens.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
tool-meta.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
tool-meta.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
types.ts feat: Add Line plugin (#1630) 2026-01-25 12:22:36 +00:00