Skip to content

Domain errors and ok:false JSON exit 0 — automation cannot detect CLI failures #992

Description

@Nih1tGupta

Area

Other

Potpie version

potpie v2.0.0b3

Install source

uv tool install potpie

System

macOS

Coding agent and model

No response

Command or workflow

Commands run:

# Capability not implemented
potpie --json cloud status
echo "exit: $?"

# Domain / pot scope failure
potpie --json graph status
echo "exit: $?"

# Graph workbench failure (ok:false in JSON)
potpie --json graph nudge --event bogus --session s1 --pot <pot-id>
echo "exit: $?"

# Shell chain (automation)
potpie --json cloud status && echo "should not print"

What happened?

The CLI printed the correct structured error output, but the process still exited with code 0 (success).

Command Output Exit code
potpie --json cloud status "code": "not_implemented" 0
potpie --json graph status "ok": false (for example, ambiguous_pot) 0
potpie --json graph nudge --event bogus ... "ok": false with error details 0
potpie --json cloud status && echo "should not print" The second command executed because the first returned success 0

So the JSON correctly indicated a failure, but $? reported success.

Parser and usage errors behaved correctly and returned a non-zero exit code. For example:

potpie pot create
# Error: Missing argument 'NAME'
echo "exit: $?"
# exit: 2

Source or build details

No response

Output or logs

No additional logs.

Metadata

Metadata

Assignees

Labels

Type

Fields

No fields configured for Bug.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions