mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-08 06:54:24 +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
@@ -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.<channel>.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.
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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