Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
2.9 KB
Raw Blame

Agent bootstrap cluster (the paste-in desktop-agent install) (more)

Subsystem index · Previous entries.

  • src/core/transcripts/capture-spec.ts + codex-hook-lane.ts — the per-harness session-end capture seam. capture-spec.ts: the satisfies-anchored CAPTURE_SPECS record ({confine, parse, discover?}) for the STDIN-DRIVEN lanes (claude-code, codex); captureSpecFor() resolves unknown/undefined/opencode to the claude spec (golden-pinned by test/codex-hook-lane.test.ts); openclaw is deliberately NOT a member (its lane is in-process, trusted-plane — see context-engine.ts). codex-hook-lane.ts: confineCodexTranscriptPath (the same S3#8 ladder as the claude root, pinned at BOTH codexSessionsDir() AND codexArchivedSessionsDir() — codex MOVES a rollout into the flat archived_sessions store on archive, so fencing only the live store refused a still-valid path; both CODEX_HOME-resolved since the spawner IS codex; an explicitly pinned test-seam root stays single-root; ENOENT/ENOTDIR on the path is missing_path — the rung hook.ts gates its discovery fallback on — while unreadable is reserved for EACCES/IO faults, so the codex session-end heartbeat reason for a nonexistent transcript_path after a failed discovery is transcript_missing_path, not transcript_unreadable; no WSL branch v1), parseCodexHookTranscript (ParsedTranscript shape over the adapter's exported mapCodexLine; same OPT-IN collectToolCalls contract as parseTranscript, and the same capToolCallInput bound on observed args; head+tail over budget so session_meta identity survives; recognizedOnly when every non-blank line parsed and was a session header, so hook.ts ends a Codex session opened and closed with no prompt as ok/empty_session (no status alert, no corpus file) while any unknown or torn record with zero turns stays parser_drift; tool calls from the OBSERVED args keys — custom_tool_call.input fixture-verified, function_call.arguments source-verified at rust-v0.147.0; tolerant JSON-string parse; NO result join — 0.147.0 persists no success flag on *_output rows; compacted rows become boundary positions), and discoverNewestCodexRollout (bounded newest-first walk over the dated live store, then a flat pass over the archived store under the SAME 4096 dirent cap — skipped once the cap trips; id-in-filename match, and an id-matched archived hit keeps transcript_discovered (never relabelled _newest, which hook.ts reads as a guess and bars from the relay); symlink-reject — the fallback for transcript_path: null or a moved rollout, and the seam for SIGKILL'd sessions, which never fire SessionEnd). Engine-free by construction; never imports discover.ts. Pinned by test/codex-hook-lane.test.ts + test/codex-hook-lane-archived.test.ts + the runHook-driven matrix in test/memorable-relay.serial.test.ts.