Repository navigation
feat(cli): split --max-tokens and --budgets by meaning (F1b tokens) - #954
Conversation
--max-tokens meant two things. On answers generate and benchmark run, preflight and batch it caps the tokens retrieved per question, so it is now --retrieval-tokens. On arms, subjects, tools preference, skill novelty and skill and catalog routing it caps the output of each model call, so it is now --max-output-tokens. --budgets on skill novelty analyze, atoms and probe, and on skill shorten, becomes --token-budgets. The old spellings tombstone (print the new command, exit 2). Dest names are unchanged, so no behaviour changes. The tokens concept is registered in cli_flags with four retrieval leaves and ten output leaves; the allowlist rows for --max-tokens and --budgets are removed. The parity probe now finds an option by its dest, since the spelling differs per leaf. Part of intel#94 (F1b, tokens concept). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
OpenCodeReview: Commit 6b33b73 was not reviewed. This PR has reached its review limit (6 reviews). CI at `6b33b73`: 10 still running, 3 passing, 1 skipped
To review this commit: re-request review from exai-bot in the Reviewers list. <details><summary>Last review (a5fdb07): no findings</summary> Open threads from the bot: 0 </details> |
CLI interface change detectedThis PR changes dokimi's user-facing CLI surface (commands and/or options): ~ `dokimi answers generate` parameters changed:
- removed option `--max-tokens`
+ added option `--retrieval-tokens`
~ `dokimi arms matrix-run` parameters changed:
- removed option `--max-tokens`
+ added option `--max-output-tokens`
~ `dokimi arms run` parameters changed:
- removed option `--max-tokens`
+ added option `--max-output-tokens`
~ `dokimi benchmark batch` parameters changed:
- removed option `--max-tokens`
+ added option `--retrieval-tokens`
~ `dokimi benchmark preflight` parameters changed:
- removed option `--max-tokens`
+ added option `--retrieval-tokens`
~ `dokimi benchmark run` parameters changed:
- removed option `--max-tokens`
+ added option `--retrieval-tokens`
~ `dokimi catalog routing` parameters changed:
- removed option `--max-tokens`
+ added option `--max-output-tokens`
~ `dokimi skill novelty analyze` parameters changed:
- removed option `--budgets`
- removed option `--max-tokens`
+ added option `--max-output-tokens`
+ added option `--token-budgets`
~ `dokimi skill novelty atoms` parameters changed:
- removed option `--budgets`
- removed option `--max-tokens`
+ added option `--max-output-tokens`
+ added option `--token-budgets`
~ `dokimi skill novelty probe` parameters changed:
- removed option `--budgets`
- removed option `--max-tokens`
+ added option `--max-output-tokens`
+ added option `--token-budgets`
~ `dokimi skill routing` parameters changed:
- removed option `--max-tokens`
+ added option `--max-output-tokens`
~ `dokimi skill shorten` parameters changed:
- removed option `--budgets`
- removed option `--max-tokens`
+ added option `--max-output-tokens`
+ added option `--token-budgets`
~ `dokimi subjects run` parameters changed:
- removed option `--max-tokens`
+ added option `--max-output-tokens`
~ `dokimi tools preference` parameters changed:
- removed option `--max-tokens`
+ added option `--max-output-tokens`Updated on every push; the |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #954 +/- ##
==========================================
- Coverage 95.92% 95.91% -0.01%
==========================================
Files 450 450
Lines 59527 59531 +4
Branches 10265 10265
==========================================
+ Hits 57101 57102 +1
Misses 1507 1507
- Partials 919 922 +3
🚀 New features to boost your workflow:
|
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…below 1 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
LGTM
I checked f1a5d4d. The split is right: each leaf moves by what its code does with the value. The FLAG_MOVES lists now match, by a test, the leaves that carry each new flag (4 retrieval, 10 output, 4 budgets), and novelty routing --max-tokens becomes skill routing --max-output-tokens.
Merge: safe now: it merges cleanly into current main, 2 commits behind, and its CLI tests pass on the merge. Once it is in, #955, #957 and #958 conflict with it (cli_flags.py, cli-interface.json, cli_flags_allowlist.txt) and need a rebase.
What I ran, at f1a5d4d:
make ci-local --offline: 0 failed, 25 passed, 20 skipped (network-only jobs); the test suite: 23,756 passed, 72 skipped.- The new tests on the code before the fix commits: the metavar and the below-one tests fail. With
benchmark batchdropped fromFLAG_MOVES, the leaves test fails. - On the merge with
main:test_cli_flag_moves.py,test_cli_flags.py,test_answering_stack_parity.py,test_novelty_cli.py,test_repo_budget.py(changed onmain): 241 passed.
Checked, no issues
- Destinations: every new flag keeps
dest="max_tokens"/budgets, so the code that reads them and the stored run config do not change. - Docs, schema and changelog: the docs and the
novelty.v1.jsondescriptions name the new flags; the schema change is text only. The fragment is under Changed and says what a script must change.
Fixed in this branch, up to f1a5d4d:
--helpshowedMAX_TOKENS/BUDGETSas the metavar, the old names: 36a300f passesN/Fas in the registry on all 14 leaves.- The tombstone test covered 7 of the 18 moved pairs: 634d55b checks each move's leaves against
build_parser()and tombstones every (move, leaf) pair. answers generate --retrieval-tokenstook 0 and negative counts, unlike thebenchmarkleaves: e9a37a5 usespositive_int; the changelog says so (f1a5d4d).- The test module's docstring named only the output concept: 4ca2ffe.
Each new test fails when the code it covers is broken.
vchamarthi
left a comment
There was a problem hiding this comment.
🟡 Not approved yet · reviewed f1a5d4d
Next: @napetrov: settle 1 open question (below). 1 nit optional.
Blocking
- Open question for @napetrov:
arms run --max-t 8, a unique prefix of--max-tokens, parsed on main as--max-tokens. Decide whether unique prefixes of--max-tokensand--budgetstombstone: match them inmoved_flags_argv(dokimi/dokimi/cli_routes.py), or say in the changelog fragment that prefixes are refused.
Follow-ups, not blocking (2)
dokimi/dokimi/commands/novelty.py:668– Input--token-budgets nan(--budgets nanon main) parses to a fraction of NaN, andshortenuses it as the targetbudget * tokens_full(dokimi/novelty/shorten.py:233) (main has it too).dokimi/dokimi/commands/skill_coverage.py:41– A cut-off reply from a non-CLI provider inskill coveragegets the hintraise --max-output-tokens, whichskill coveragedoes not take (main has it too).
Verified on f1a5d4d: ✅ changed tests: 479 passed, fail on main · ✅ full suite on the head: 23781 passed ·
10 checks behind it, each with its evidence
| Area | What holds | How |
|---|---|---|
| Token move table | The four retrieval leaves, the ten output leaves and the four --token-budgets leaves take the new spellings, and tests/test_cli_flag_moves.py checks each move's leaves against the parser tree |
tests on the head |
| Old spellings | answers generate --max-tokens 8, arms run --max-tokens 8 and skill shorten --budgets 0.5 exit 2 and print the new command; on main the same argv parses |
ran it, edge input (cli) |
| Retired routing | novelty routing --max-tokens prints skill routing --max-output-tokens: tests/test_cli_flag_moves.py pins that line |
tests on the head |
| Token counts | answers generate --retrieval-tokens 0 and -5, and arms run --max-output-tokens 0, exit 2 with must be >= 1; on main the new spellings are unrecognized |
ran it, edge input (numbers) |
| Stored values | tests/test_answering_stack_parity.py, tests/test_arms_run_config_parity.py and tests/test_subjects.py pass on the head with the new spellings: the parity tests pin the values under max_tokens and budgets |
tests on the head |
| Help metavars | test_help_shows_the_registry_metavar_for_each_token_spelling passes: --help shows N and F for the token flags, not the dests |
tests on the head |
| Cli snapshot | docs/reference/cli-interface.json equals a fresh dump of the parser from scripts/cli_surface.py |
ran it, edge input (structured) |
| Moved argv values | moved_flags_argv keeps an empty, a blank and a non-ASCII value after a moved token flag |
ran it, edge input (text) |
| Cut-off hint | A cut-off reply from LLMClient with no max_tokens, system or accept raises OutputTruncated with raise --max-output-tokens |
ran it, edge input (none) |
| Move pins | Dropping catalog routing from the --max-output-tokens move list fails tests/test_cli_flag_moves.py |
broke the code, tests caught it |
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
A skill routing --max-output-tokens type of int instead of positive_int left all flag tests green; the refusal is now checked on each of the 10 output leaves. Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
|
🟢 Ready for re-review · 1 commit on Next: @vlad-perevezentsev: re-review the new head. Nothing needed from @napetrov. Changes
Threads and comments
Verified on the new head: ✅ tests of the fix: 1 passed · ✅ full suite with main merged in: 24283 passed · ✅ second reader: nothing raised What each test shows
|
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRR_kwDOVBg7g88AAAABZOla5g.b Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRR_kwDOVBg7g88AAAABZOla5g.c Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
|
|
The token-budget parser now rejects non-finite fractions before starting a run. The coverage command reports the model’s output ceiling without suggesting an unavailable option. The abbreviation policy is still awaiting an author decision. |
xaleryb
left a comment
There was a problem hiding this comment.
Approved on 6b33b73. vlad's approval stands on f1a5d4d; I re-verified every commit after it on the head merged with current main: all 14 old --max-tokens leaves and both --budgets leaves print the new command and exit 2 (also as --flag=value); --token-budgets rejects nan, inf, negatives and values above 1; --max-output-tokens and --retrieval-tokens reject 0 and negatives; destination names are unchanged; no old flag is left in docs, scripts, workflows or benchmarks; the CLI snapshot regenerated on Python 3.13 is byte-identical; full suite, ruff, mypy, bandit and the growth and comment-block gates are clean. Minor, not blocking: the abbreviations --max-tok and --budget exit 2 with a plain argparse error and no new command. CI is green.
Part of #94 (F1b, tokens concept).
Summary
--max-tokensmeant two things. It now splits by what the code caps, and--budgetsbecomes--token-budgets. Old spellings tombstone: they print the new command and exit 2. Existing destination names are preserved.--token-budgetsaccepts finite fractions from 0 through 1, and counts passed to--max-output-tokensmust be positive. Truncated replies onskill coverageandeval graphreport the output ceiling without suggesting a flag those commands cannot accept.answers generate--max-tokens--retrieval-tokensbenchmark run--max-tokens--retrieval-tokensbenchmark preflight--max-tokens--retrieval-tokensbenchmark batch--max-tokens--retrieval-tokensarms run--max-tokens--max-output-tokensarms matrix-run--max-tokens--max-output-tokenssubjects run--max-tokens--max-output-tokenstools preference--max-tokens--max-output-tokensskill novelty analyze--max-tokens--max-output-tokensskill novelty atoms--max-tokens--max-output-tokensskill novelty probe--max-tokens--max-output-tokensskill shorten--max-tokens--max-output-tokensskill routing--max-tokens--max-output-tokenscatalog routing--max-tokens--max-output-tokensskill novelty analyze,atoms,probe;skill shorten--budgets--token-budgetsCount: 4 retrieval leaves and 10 output leaves. The count in the F1b brief (six and seven) does not match the snapshot. The note in
cli_flags.pywas corrected to 4 and 10, so this PR is the source of truth.Retired
novelty routing --max-tokensprints theskill routing --max-output-tokenscommand.Evidence
Review round on
6b33b73: all 145 graph, output-ceiling and CLI flag migration tests passed.Full suite: 23776 passed, 20 skipped (
pytest -n auto). Two subprocess-timeout tests failed once under load and pass alone.make ci-local CI_LOCAL_ARGS="--offline --jobs static,typecheck": 0 failed, 16 passed, 3 skipped (network-only).tests/test_cli_flag_moves.py: tombstone cases for each old spelling, and parse-equivalence cases.docs/reference/cli-interface.jsonregenerated; the diff is limited to the 14 leaves.test_answering_stack_parity.py: the D7 probe found the option by spelling, which the rename broke. It now finds the option by dest.Merge Danger
Left out
_RETIRED_VALUE_FLAGSand_RETIRED_ROUTING_FLAGSincli_routes.pystill recognise the old spelling for the retirednovelty routing. That is intentional.budgetssettings key in fixtures and the CHANGELOG history are unchanged.🤖 Generated with Claude Code