Harden the agentic pilot pipeline before the next paid run - #65
Merged
Merged
Conversation
The repaired flex-pilot implementation existed only in the working tree, so a
fresh clone had none of it. This lands it, and closes three ways the pipeline
could spend money and still hand back a result nobody can trust.
Failures kept no evidence. An episode recorded `error_type` and nothing else:
no message, no traceback, no failing path. The 2026-09-16 run died after 635s
of paid inference as a bare `FileNotFoundError` and cannot be diagnosed now,
because none of that was written down. `_persist_failure` now keeps the message
and traceback beside the outcome, whether or not the worker log survives.
Tau's checkpoint path was assumed, not checked. `run_domain` rebuilds save_to as
`DATA_DIR / "simulations" / f"{save_to}.json"`, so a relative stem is silently
relocated under tau's package data and the episode cannot find its own grade.
An absolute stem survives only because pathlib drops the base when the joined
part is absolute. That contract is now verified before the episode starts, so a
path mistake costs milliseconds instead of a full paid episode, and the lookup
no longer goes through `with_suffix`, which truncates any stem with a dot.
Truncated output was scored as a wrong answer. The gateway clamps the harness's
requested max_tokens down to the spec ceiling and recorded neither the clamp nor
`finish_reason`, so a reply cut off at the ceiling and a model that genuinely
answered badly produced identical evidence. Calls now carry
`requested_output_tokens`, `max_output_tokens`, `output_cap_applied`,
`finish_reason` and `output_truncated`.
The budget-curve-v1 spec still sets `max_output_tokens` to 4096, which clamps
the retail agent's 8192 request. That is a design decision for review, not a
silent default; it is now at least visible in the call log.
Offline suite: 626 passed, 3 skipped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`max_output_tokens` was 4096 while the retail harness asks for 8192, so the gateway silently halved every reply. A truncated reply grades the same as a wrong one, which meant the cap was buying a measurement error, not a saving. It is now 8192, so the control no longer binds, with a test to keep it that way. Output is reserved in full before each call under the fixed policy, so the reservation per call doubles: $0.00246 to $0.00492 standard, $0.00197 to $0.00393 flex. Against the $0.01 allowance the output side alone now reserves 49% standard and 39% flex before any input, and input reserves at the 1h cache-write multiplier of 2.0. The $0.01 cell can afford very few calls. That cell measures this harness's reservation policy at that allowance, not the model's ability, and its budget stops must be reported rather than folded into a success rate. Offline suite: 627 passed, 3 skipped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The repaired flex-pilot implementation existed only in the working tree, so a fresh clone had none of it. This lands it, and closes three ways the pipeline could spend money and still hand back a result nobody can trust.
What was broken
Failures kept no evidence. An episode recorded
error_typeand nothing else: no message, no traceback, no failing path. The 2026-09-16 run died after 635s of paid inference as a bareFileNotFoundErrorand cannot be diagnosed now, because none of that was written down._persist_failurenow keeps the message and traceback beside the outcome, whether or not the worker log survives.Tau's checkpoint path was assumed, not checked.
run_domainrebuildssave_toasDATA_DIR / "simulations" / f"{save_to}.json", so a relative stem is silently relocated under tau's package data and the episode cannot find its own grade. An absolute stem survives that join only because pathlib drops the base when the joined part is absolute. That contract is now verified before the episode starts, so a path mistake costs milliseconds instead of a full paid episode. The lookup also no longer goes throughwith_suffix, which truncates any stem containing a dot.Truncated output was scored as a wrong answer. The gateway clamps the harness's requested
max_tokensdown to the spec ceiling and recorded neither the clamp norfinish_reason, so a reply cut off at the ceiling and a model that genuinely answered badly produced identical evidence. Calls now carryrequested_output_tokens,max_output_tokens,output_cap_applied,finish_reasonandoutput_truncated.For review
budget-curve-v1.jsonstill setsmax_output_tokensto 4096, which clamps the retail agent's 8192 request. Raising it changes how many calls fit inside each agent allowance, so it is a design decision rather than something to change quietly. It is at least visible in the call log now.The tier-echo gate is unchanged and still blocks the pilot. Doubleword chat completions does not echo
service_tier, confirmed onDeepSeek-V4.1-Flashon 2026-09-17 across four calls on both tiers, soagentic_runstops at qualification as designed.Verification
Offline suite: 626 passed, 3 skipped. New tests cover the output clamp and truncation flags, the absolute-stem contract, rejection of a relative stem, and stems containing a dot.
No paid run is launched by this change.