### Epic: Event Coverage & Error Handling **Card:** t_8fc3132c ### Contains - US-2: Tool Call Visibility - US-3: Error Handling in JSON Mode - US-5: REPL Guard ### Technical Notes - Tool progress events (tool_call + tool_result) visible in JSON output - Error codes: NO_INPUT, API_ERROR, TOOL_ERROR, REPL_INCOMPATIBLE - REPL guard: --json + no message + tty = error + exit 1 - All errors include ISO timestamps, exit code non-zero ### Files Changed - cortex/cli/__init__.py - cortex/agent.py ### Definition of Done - [ ] tool_call event emitted with tool name + parsed args - [ ] tool_result event emitted with result + truncated flag - [ ] turn field correlates tool_call with tool_result - [ ] All errors emit structured JSON events - [ ] REPL guard produces REPL_INCOMPATIBLE error + exits non-zero - [ ] All error events include ISO timestamp - [ ] Existing tests pass unchanged
Epic: Event Coverage & Error Handling
Card: t_8fc3132c
Contains
Technical Notes
Files Changed
Definition of Done