mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 08:22:47 +00:00
Doctor: ignore slash sessions in transcript integrity check
Merged via deterministic merge flow.
Prepared head SHA: e5cee7a2ec
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
30fd2bbe19
commit
a690b62391
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user