Repository navigation
fix(novelty): a capped catalog routing run with failed model calls exits 1 again, not 3 - #1410
Conversation
…e cap also stops it A capped all-vs-all run whose model calls partly failed exited 3 (budget stop), so a retry-on-3 script never saw the failures. Failed calls now set exit 1; the cap message and the saved partial file are unchanged. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 7 selected item(s). CI at `0b7b313`: 1 failing, 20 passing, 4 skipped
Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1410 +/- ##
==========================================
- Coverage 96.34% 96.33% -0.01%
==========================================
Files 522 522
Lines 69949 69952 +3
Branches 12098 12099 +1
==========================================
- Hits 67390 67388 -2
- Misses 1582 1584 +2
- Partials 977 980 +3
🚀 New features to boost your workflow:
|
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟡 Changes needed · reviewed 6e24f88
To fix: the exit-code docs and the last stderr line still describe a plain budget stop on this path (line comments). Both are small.
✅ make ci-local --offline: 31,235 passed, 0 failed · ✅ a capped run with one rate-limited call: exit 1, partial file kept with "reason": "spend_cap" and n_failed: 1 · ✅ the new test fails on the base, where stop_if_partial exits 3
The exit code now follows the failed calls again, and the saved partial file does not change.
| show() | ||
| stop_partial(f"{partial['message']}. The partial result, {partial['calls_done']} of " | ||
| f"{partial['calls_planned']} model calls, is in {out}", partial["reason"]) | ||
| f"{partial['calls_planned']} model calls, is in {out}", reason or partial["reason"]) |
There was a problem hiding this comment.
docs/quickstart.md still says a capped catalog routing that keeps its partial file exits 3, with only a permanent provider error as the exception.
With this PR, a capped run with a failed model call exits 1, but the exit-code table (row 3) and the paragraph under it ("exit 3 when the budget or an unpriced call stops them ... and 1 when ... a permanent provider error stopped them") do not say so.
Suggestion: add "or a failed model call (catalog routing)" next to "a permanent provider error" in both places.
There was a problem hiding this comment.
Fixed in 6f2dd59: docs/quickstart.md row 3 and the paragraph under it now say a catalog routing run with a failed model call exits 1, next to the permanent provider error; docs/skill-novelty.md (routing cap section, all-vs-all failed calls) and the changelog fragment say the same. 0b7b313 merges current main, which rewrote row 3 for repo run and repo hits judge; the exception is kept in the merged row.
| stop_if_partial(payload, out, lambda: print_all_vs_all_summary(*summary), | ||
| "failed_calls" if failed else None) |
There was a problem hiding this comment.
When the cap stops a run that also had failed calls, the last stderr line is the cap message, which says "Raise --max-usd", but the run exits 1.
The N of M model call(s) failed message from exit_partial_all_vs_all is never printed on this path. The only hint at the cause is the WARNING line near the top of the output:
WARNING: 1 model call(s) failed (first error: rate limited); ...
spend cap reached: $1.20 of $1.00 after 2 calls ... Raise --max-usd, ... The partial result, 3 of 4 model calls, is in o.json
A user who reads the last line raises the cap, gets the same exit 1, and does not see why.
Suggestion: when failed, add the failed-call count to the stop message (for example "; 1 of 3 model call(s) failed, so this exits 1"), and assert that in the new test.
There was a problem hiding this comment.
Fixed in 6f2dd59: when calls failed, the cap message (the last stderr line) ends with ; 1 of 3 model call(s) failed, so this exits 1; with no failed call it is unchanged. The new test asserts the last line (the old check also matched the WARNING line above it), and the existing all-vs-all cap test asserts the message still ends with the file path. Dropping the addition, or always adding it, turns a test red.
…its 1 The cap message, the last stderr line, now ends with "N of M model call(s) failed, so this exits 1" when calls failed; unchanged otherwise. The exit-code docs name a failed model call (catalog routing) as exit 1. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
quickstart.md row 3 takes main's text (repo run and repo hits judge exit 3 on a budget stop) and keeps the catalog routing failed-call exception. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
napetrov
left a comment
There was a problem hiding this comment.
Change class: CONTRACT (head 0b7b313)
- Contract: candidate. defaults dokimi/dokimi/commands/novelty_routing_report.py:660
- Responsibility: none
- Dependency: none
- Review depth: check the changed surface: callers, docs, tests pin new behaviour
- Coverage gaps: none
With the same regression test, a capped routing run with a failed model call exited 3 on the merge base and exits 1 here. The final diagnostic includes the failure count, and the quickstart documents the same rule. A cap alone still exits 3. All 67 tests in the two affected test files passed locally.
Follow-up to #1374. A capped all-vs-all
catalog routingrun whose model calls partly failed now exits 1 again, as the #1374 changelog fragment and the quickstart exit-code table say ("a run with failed model calls exits 1"). Since #1374 it exited 3 (budget stop), so a script that retries on 3 never saw the failures. Before #1374 it exited 1.Repro on main 63797d1:
catalog routing <root> --queries-by-skill q.json --model m --max-usd 1, where the first model call raises and the later calls cost $0.60 each -> exit 3, while the saved partial file hasn_failed: 1andreason: spend_cap. With this change: exit 1; the cap message and the partial file are unchanged.What was run (Linux, Python 3.13, main 63797d1 plus this commit):
tests/test_novelty_partial_exit_code.py::test_an_all_vs_all_run_with_a_failed_model_call_exits_1_when_the_cap_stops_it_too: red on main (exit 3), and red under two mutants (the override innovelty_routing.pyset toNone;stop_if_partialignoring its reason). Green with the fix.test_agent_arm_dependencies, nomcpon the host; it fails on main too). ruff, mypy, bandit -ll, check_growth, check_comment_blocks, the changelog-fragment check anddocs check --strictpass.