Skip to content

Epic: Event Coverage & Error Handling #4

Description

@thm-design

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicEpic — group of related user storiesjson-flagCortex --json flag feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions