feat(exec-events): add top-level sessionKey to payload

This commit is contained in:
Grace (Clawdbot) 2026-01-28 02:04:28 +01:00
parent e239ff27f6
commit 23fcdefea6
3 changed files with 11 additions and 4 deletions

View File

@ -25,14 +25,17 @@ Make exec events (Codex, Claude, etc.) visible in Crabwalk UI as distinct "EXEC"
- [x] Rolled back uncommitted changes
- [x] Created CONTINUITY.md
- [x] **Bead 1: Audit** — Full E2E flow audit complete (see AUDIT_REPORT.md)
- [x] **Bead 2: Add top-level runId** — Commit `e49b41503` (2026-01-27)
- Added `runId?: string` to ExecEventBase type
- Updated all 3 emitExecEvent calls to include `runId: execEventsState.context?.runId`
- Build passes
### Now
- [ ] Bead 2: Write failing test for top-level runId in exec events
- [ ] E2E validation with Crabwalk
### Next
- [ ] Bead 3: Update Gateway exec-events.ts types (add top-level runId)
- [ ] Bead 4: Update bash-tools.exec.ts emission call sites
- [ ] Bead 5: E2E validation with Crabwalk
- [ ] Push to GitHub (failed earlier due to token permissions)
- [ ] Add test coverage for top-level runId
## Open Questions (RESOLVED)
- ✅ CONFIRMED: Exec events ARE being emitted (Line 406-408, server.impl.ts)

View File

@ -577,6 +577,7 @@ async function runExecProcess(opts: {
emitExecEvent("exec.output", {
sessionId,
runId: execEventsState.context?.runId,
sessionKey: execEventsState.context?.sessionKey,
pid: session.pid,
command: session.command,
commandName: execEventsState.commandName,
@ -596,6 +597,7 @@ async function runExecProcess(opts: {
emitExecEvent("exec.started", {
sessionId,
runId: execEventsState.context?.runId,
sessionKey: execEventsState.context?.sessionKey,
pid: session.pid,
command: session.command,
commandName: execEventsState.commandName,
@ -620,6 +622,7 @@ async function runExecProcess(opts: {
emitExecEvent("exec.completed", {
sessionId,
runId: execEventsState.context?.runId,
sessionKey: execEventsState.context?.sessionKey,
pid: session.pid,
command: session.command,
commandName: execEventsState.commandName,

View File

@ -15,6 +15,7 @@ type ExecEventBase = {
seq: number;
sessionId: string;
runId?: string;
sessionKey?: string;
pid?: number;
command: string;
commandName?: string;