Skip to content

US-5: REPL Guard #9

Description

@thm-design

US-5: REPL Guard

Parent Epic: #4 (Event Coverage & Error Handling)

As a user,
I want to get a clear error if I try to combine --json with REPL mode,
so that I dont get a broken hybrid output.

Acceptance Criteria

  • Running cortex --json without a message (entering REPL mode) produces error event with code "REPL_INCOMPATIBLE"
  • Error message: "--json is not compatible with interactive REPL mode. Provide a message argument or pipe input."
  • Exit code is non-zero
  • No interactive session starts

Technical Notes

  • Check after args.parse_args(): if args.json is set AND no message AND stdin is a tty → emit error event + sys.exit(1)
  • Does NOT enter agent.repl() — exits before agent is instantiated
  • Error event is the only output (no session_start)

Metadata

Metadata

Assignees

No one assigned

    Labels

    json-flagCortex --json flag featurestoryUser story with acceptance criteria

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions