Repository navigation
fix: return non-zero exit for missing --template-info templates - #143
Merged
Merged
Conversation
typer.Exit() defaults to 0, so scripts and agent preflight could not tell a missing template from a successful lookup.
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
pt-snap query --template-info <missing>exit 1 instead of 0, while keepingError: Template '...' not found._error()so it matches other CLI failures (typer.Exit()defaults to 0).🔗 Related Issue
Fixes #112
🧪 Testing
Commands:
Results: focused tests passed; CLI + contract suites 96 passed; full suite 860 passed, 1 xfailed; ruff and black clean.
✅ Checklist
Snapshot Runtime Provenance
Snapshot provenance decision: no-update
Snapshot provenance no-update reason: This PR only changes CLI error handling and tests for
--template-info; no file under src/pt_snap_cli/snapshot/ is created, modified, or deleted.📸 Screenshots (if applicable)
Not applicable.
📋 Additional Notes
MCP
get_template_infostill returns{"error": "Template '...' not found"}. The CLI/MCP contract continues to compare that payload; only the CLI process exit code changes.The
pt-snap-memory-peak-breakdownskill still documents the old exit-0 preflight workaround. Output-record checks remain valid; the exit-code note is now stale and can be updated separately.