From a690b62391cb6c3f5d4b507b828aa97bb96c3171 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Thu, 26 Feb 2026 04:35:08 -0500 Subject: [PATCH] Doctor: ignore slash sessions in transcript integrity check Merged via deterministic merge flow. Prepared head SHA: e5cee7a2eca80e9a61021b323190786ef6a016bd Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> --- CHANGELOG.md | 1 + src/commands/doctor-state-integrity.test.ts | 24 +++++++++++++++++++++ src/commands/doctor-state-integrity.ts | 15 +++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd03a4b1..0a28452ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- Doctor/State integrity: ignore metadata-only slash routing sessions when checking recent missing transcripts so `openclaw doctor` no longer reports false-positive transcript-missing warnings for `*:slash:*` keys. (#27375) thanks @gumadeiras. - Channels/Multi-account config: when adding a non-default channel account to a single-account top-level channel setup, move existing account-scoped top-level single-account values into `channels..accounts.default` before writing the new account so the original account keeps working without duplicated account values at channel root; `openclaw doctor --fix` now repairs previously mixed channel account shapes the same way. (#27334) thanks @gumadeiras. - Telegram/Inline buttons: allow callback-query button handling in groups (including `/models` follow-up buttons) when group policy authorizes the sender, by removing the redundant callback allowlist gate that blocked open-policy groups. (#27343) Thanks @GodsBoy. - Daemon/macOS launchd: forward proxy env vars into supervised service environments, keep LaunchAgent `KeepAlive=true` semantics, and harden restart sequencing to `print -> bootout -> wait old pid exit -> bootstrap -> kickstart`. (#27276) thanks @frankekn. diff --git a/src/commands/doctor-state-integrity.test.ts b/src/commands/doctor-state-integrity.test.ts index ba889d28b..a9d28e397 100644 --- a/src/commands/doctor-state-integrity.test.ts +++ b/src/commands/doctor-state-integrity.test.ts @@ -171,4 +171,28 @@ describe("doctor state integrity oauth dir checks", () => { expect(text).not.toContain("--active"); expect(text).not.toContain(" ls "); }); + + it("ignores slash-routing sessions for recent missing transcript warnings", async () => { + const cfg: OpenClawConfig = {}; + setupSessionState(cfg, process.env, process.env.HOME ?? ""); + const storePath = resolveStorePath(cfg.session?.store, { agentId: "main" }); + fs.writeFileSync( + storePath, + JSON.stringify( + { + "agent:main:telegram:slash:6790081233": { + sessionId: "missing-slash-transcript", + updatedAt: Date.now(), + }, + }, + null, + 2, + ), + ); + + await noteStateIntegrity(cfg, { confirmSkipInNonInteractive: vi.fn(async () => false) }); + + const text = stateIntegrityText(); + expect(text).not.toContain("recent sessions are missing transcripts"); + }); }); diff --git a/src/commands/doctor-state-integrity.ts b/src/commands/doctor-state-integrity.ts index 2e31da8e7..7b056a27b 100644 --- a/src/commands/doctor-state-integrity.ts +++ b/src/commands/doctor-state-integrity.ts @@ -16,6 +16,7 @@ import { resolveStorePath, } from "../config/sessions.js"; import { resolveRequiredHomeDir } from "../infra/home-dir.js"; +import { parseAgentSessionKey } from "../sessions/session-key-utils.js"; import { note } from "../terminal/note.js"; import { shortenHomePath } from "../utils.js"; @@ -165,6 +166,15 @@ function hasPairingPolicy(value: unknown): boolean { return false; } +function isSlashRoutingSessionKey(sessionKey: string): boolean { + const raw = sessionKey.trim().toLowerCase(); + if (!raw) { + return false; + } + const scoped = parseAgentSessionKey(raw)?.rest ?? raw; + return /^[^:]+:slash:[^:]+(?:$|:)/.test(scoped); +} + function shouldRequireOAuthDir(cfg: OpenClawConfig, env: NodeJS.ProcessEnv): boolean { if (env.OPENCLAW_OAUTH_DIR?.trim()) { return true; @@ -413,7 +423,8 @@ export async function noteStateIntegrity( return bUpdated - aUpdated; }) .slice(0, 5); - const missing = recent.filter(([, entry]) => { + const recentTranscriptCandidates = recent.filter(([key]) => !isSlashRoutingSessionKey(key)); + const missing = recentTranscriptCandidates.filter(([, entry]) => { const sessionId = entry.sessionId; if (!sessionId) { return false; @@ -424,7 +435,7 @@ export async function noteStateIntegrity( if (missing.length > 0) { warnings.push( [ - `- ${missing.length}/${recent.length} recent sessions are missing transcripts.`, + `- ${missing.length}/${recentTranscriptCandidates.length} recent sessions are missing transcripts.`, ` Verify sessions in store: ${formatCliCommand(`openclaw sessions --store "${absoluteStorePath}"`)}`, ` Preview cleanup impact: ${formatCliCommand(`openclaw sessions cleanup --store "${absoluteStorePath}" --dry-run`)}`, ].join("\n"),