openclaw/CONTINUITY.md
Grace (Clawdbot) e239ff27f6 feat(exec-events): add top-level runId to payload
- Added runId?: string to ExecEventBase type in exec-events.ts
- Added runId to all three emitExecEvent calls (exec.started, exec.output, exec.completed)
- Fixes Crabwalk mismatch where it expects exec.runId but Gateway sent context.runId
- runId is sourced from session.execEvents.context?.runId for backward compatibility

Resolves: Crabwalk exec nodes not displaying due to schema mismatch
2026-01-28 12:07:24 +01:00

50 lines
2.0 KiB
Markdown

# CONTINUITY.md — Exec Events E2E Fix
## Goal
Make exec events (Codex, Claude, etc.) visible in Crabwalk UI as distinct "EXEC" nodes — not "agent" or "chat".
### Success Criteria
1. When Codex runs, Crabwalk shows an "EXEC" labeled node (not "AGENT")
2. Exec events flow: Gateway emits → WebSocket broadcasts → Crabwalk receives → UI renders
3. All changes have test coverage
4. Clean git history with meaningful commits
## Constraints/Assumptions
- Gateway code: `/home/clawdbot/dev/clawdbot-exec-events/`
- Crabwalk code: `/home/clawdbot/apps/crabwalk/`
- Config already has `hooks.exec.emitEvents: true` and whitelist
- Must use test-driven approach
## Key Decisions
1. Rolled back cowboy changes (2026-01-27)
2. Starting fresh with proper beads model
## State
### Done
- [x] Rolled back uncommitted changes
- [x] Created CONTINUITY.md
- [x] **Bead 1: Audit** — Full E2E flow audit complete (see AUDIT_REPORT.md)
### Now
- [ ] Bead 2: Write failing test for top-level runId in exec events
### 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
## Open Questions (RESOLVED)
- ✅ CONFIRMED: Exec events ARE being emitted (Line 406-408, server.impl.ts)
- ✅ CONFIRMED: Crabwalk HAS distinct ExecNode.tsx component (not reusing AgentNode)
- ✅ CONFIRMED: runId IS required for session linking but optional in Gateway
- ✅ ROOT CAUSE: Gateway sends `context.runId` (nested, optional), Crabwalk expects `exec.runId` (top-level, required)
## Working Set
- Gateway exec emission: `src/agents/bash-tools.exec.ts`
- Gateway broadcast: `src/gateway/server.impl.ts`
- Exec event types: `src/infra/exec-events.ts`
- Crabwalk parser: `/home/clawdbot/apps/crabwalk/src/integrations/clawdbot/parser.ts`
- Crabwalk UI: `/home/clawdbot/apps/crabwalk/src/components/monitor/ExecNode.tsx`
- Crabwalk graph: `/home/clawdbot/apps/crabwalk/src/components/monitor/ActionGraph.tsx`