diff --git a/.agents/skills/agent-transcript/SKILL.md b/.agents/skills/agent-transcript/SKILL.md index 845ff3958197..97ce47dafec2 100644 --- a/.agents/skills/agent-transcript/SKILL.md +++ b/.agents/skills/agent-transcript/SKILL.md @@ -37,7 +37,7 @@ Find a likely local session: --since-days 14 ``` -`find` scans the newest 400 matching local JSONL logs by default. Use `--max-files N` for a wider local search. +`find` scans the newest 400 matching local JSONL logs by default across Codex, Claude, Pi, and OpenClaw agent sessions. Use `--max-files N` for a wider local search. Render a PR/issue body section: diff --git a/.agents/skills/agent-transcript/scripts/agent-transcript b/.agents/skills/agent-transcript/scripts/agent-transcript index ef806832abda..9ae470ee02bf 100755 --- a/.agents/skills/agent-transcript/scripts/agent-transcript +++ b/.agents/skills/agent-transcript/scripts/agent-transcript @@ -51,11 +51,26 @@ function homePath(...parts) { return path.join(os.homedir(), ...parts); } +function openClawSessionRoots() { + const stateDir = process.env.OPENCLAW_STATE_DIR || homePath(".openclaw"); + const agentsDir = path.join(stateDir, "agents"); + if (!fs.existsSync(agentsDir)) return []; + try { + return fs + .readdirSync(agentsDir, { withFileTypes: true }) + .filter((entry) => entry.isDirectory()) + .map((entry) => path.join(agentsDir, entry.name, "sessions")); + } catch { + return []; + } +} + function defaultRoots() { return [ homePath(".codex", "sessions"), homePath(".claude", "projects"), homePath(".pi", "agent", "sessions"), + ...openClawSessionRoots(), ]; } @@ -110,6 +125,12 @@ function detectAgent(file, rows) { if (file.includes(`${path.sep}.codex${path.sep}`)) return "codex"; if (file.includes(`${path.sep}.claude${path.sep}`)) return "claude"; if (file.includes(`${path.sep}.pi${path.sep}`)) return "pi"; + if ( + file.includes(`${path.sep}.openclaw${path.sep}`) || + (file.includes(`${path.sep}agents${path.sep}`) && file.includes(`${path.sep}sessions${path.sep}`)) + ) { + return "openclaw"; + } if (rows.some((row) => row?.type === "session_meta" || row?.type === "response_item")) return "codex"; if (rows.some((row) => row?.sessionId && row?.userType)) return "claude"; return "agent";