Repository navigation
feat(cli): --json on five more paid leaves; tools preference names its next step (#94) #1668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
napetrov
wants to merge
1
commit into
intel:main
Choose a base branch
from
napetrov:feat/cli-json-paid-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+827
−65
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
dokimi/changelog.d/20261205_120000_napetrov_cli-json-paid-2.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <!-- | ||
| Copyright (C) 2026 Intel Corporation | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| ### Added | ||
|
|
||
| - **`--json` on five more paid leaves: `skill novelty analyze`, `catalog routing`, `skill sensitivity`, | ||
| `eval questions analyze` and `eval questions review`.** Each prints one `cli_output.v1` document: the | ||
| estimate under `--dry-run` (the two `eval questions` leaves also refuse under `--max-usd` before the first | ||
| call: `budget_stopped`, exit 3), the saved result on | ||
| success, and, after a stop, the result it kept (`budget_stopped` at exit 3, `partial` at exit 1). Where a | ||
| run keeps no result (`eval questions analyze` writes its report only at the end, so a cap reached mid-run | ||
| leaves none) the stop is a `failed` document that carries the cost. An input error names the leaf's | ||
| `--help` as its `next` step. The other leaves keep their human output. Part of #94. | ||
|
|
||
| ### Fixed | ||
|
|
||
| - **`tools preference`: a refused `--out` or `--items-out` path after the model calls exits 2 with its | ||
| `next` step.** The document had an empty `next`; it now names the leaf's `--help`. |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix before merge (blocking): An exit 2 from a
--jsonleaf with no document of its own gets no help step if the condition atcli.py:456is negated, and the tests still pass.Suggestion: Add a test that makes a
--jsonleaf raiseSystemExit(2)and asserts thatnextholds the--helpstep.I tested this patch: it fixes the problem, and the tests still pass.
Patch
Details
If a
--jsonleaf exits 2 through a plainSystemExit(2),_document_on_exitatcli.py:456is what should give its document the--helpstep. If I negate that condition, the step goes missing, exit 5 gets one, and the tests still pass. The help-step tests I read take theInputErrorroute, not this one. I'd expect one test that makes a--jsonleaf raiseSystemExit(2)and asserts thatnextholds the--helpstep.