




















@@ -0,0 +1,60 @@
1+#!/usr/bin/env node
2+/**
3+ * Live repro for implicit session_status + runSessionKey (#82669 / PR #82696).
4+ * Run: pnpm exec tsx scripts/repro/session-status-run-session-key-live-proof.mjs
5+ */
6+import fs from "node:fs";
7+import os from "node:os";
8+import path from "node:path";
9+import { createSessionStatusTool } from "../../src/agents/tools/session-status-tool.ts";
10+11+const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-session-status-proof-"));
12+const storePath = path.join(tmpRoot, "sessions.json");
13+const store = {
14+"agent:main:telegram:default:direct:1234": {
15+sessionId: "s-tg-direct",
16+updatedAt: 5,
17+status: "done",
18+thinkingLevel: "off",
19+},
20+"agent:main:main": {
21+sessionId: "s-main",
22+updatedAt: 10,
23+status: "running",
24+thinkingLevel: "high",
25+},
26+};
27+fs.writeFileSync(storePath, `${JSON.stringify(store, null, 2)}\n`);
28+29+const config = {
30+session: { mainKey: "main", scope: "per-sender", store: storePath },
31+agents: {
32+defaults: {
33+model: { primary: "openai/gpt-5.4" },
34+models: {},
35+},
36+},
37+tools: {
38+agentToAgent: { enabled: false },
39+},
40+};
41+42+const tool = createSessionStatusTool({
43+agentSessionKey: "agent:main:telegram:default:direct:1234",
44+runSessionKey: "agent:main:main",
45+ config,
46+});
47+48+const result = await tool.execute("live-proof-implicit-run-session", {});
49+const text = typeof result === "string" ? result : JSON.stringify(result);
50+const thinkingMatch = text.match(/think(?:ing)?[:\s]+(\w+)/i);
51+52+console.log(
53+"implicit session_status resolved thinkingLevel from store =",
54+store["agent:main:main"].thinkingLevel,
55+);
56+console.log("status text mentions thinking:", thinkingMatch?.[1] ?? "(see full status below)");
57+console.log("--- status excerpt ---");
58+console.log(text.split("\n").slice(0, 12).join("\n"));
59+60+fs.rmSync(tmpRoot, { recursive: true, force: true });
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。