You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apr code: record the prompt bytes sent and consumed, and exit ≠ 0 when consumed < sent (L22 slice 1) #5190
Refs #4600. This is the first slice of L22, for apr code only. run, chat and serve come in a later slice. The SHACL shape and the 200 KB cell in the #3715 suite come in another.
Defect.apr code does not record how much of its prompt reached the model. #4601 (#4599) refuses an over-budget prompt instead of dropping it. Still, a result can say Pass while nothing proves the whole prompt was consumed.
Done when:
Measure. The agent turn measures the current prompt as it appears in the request handed to the driver:
input_bytes_sent: the prompt's bytes.
input_bytes_consumed: the bytes of that prompt present in the request.
prompt_sha256: the hash of the consumed bytes.
prompt_tokens: the count from the same counter that sizes the window.
Fail loudly. When consumed < sent, the turn ends with an input_not_consumed error. apr code exits ≠ 0, and the JSON result reports "kind": "input_not_consumed".
Record. The four fields go into the -p --output-format json result document and into the session trace's session_end record.
Prove. A falsifier plants a one-byte drop between the loop and the driver and must turn red. A prompt at the window limit must stay green with sent == consumed.
Status: a fix is committed locally (3f4ab48d7b, off main 8c12fca) and waits for a PR slot.
Each agent turn measures its prompt on the request exactly as handed to the driver: input_bytes_sent, input_bytes_consumed, prompt_sha256, prompt_tokens.
consumed < sent ends the turn with input_not_consumed before the driver is called (exit != 0; JSON "kind": "input_not_consumed").
The four fields are in the -p --output-format json document and in the trace's session_end record.
FALSIFY-5190-001 (planted one-byte drop) is red; -002 (same prompt, unplanted) is green; -003 (largest prompt the window admits) is green with sent == consumed, and one byte more is context_overflow.
Measured: clippy -D warnings clean; 935/936 agent:: tests pass, including all 9 new ones. The single failure, test_find_apr_binary, needs an apr on PATH and is unrelated to this diff.
Limits: the measurement is at the request boundary, not inside a backend, and the error path still writes no session trace.
P0 to P1 (2026-10-14 P0 triage): P0 now means it blocks the next release or carries the operator's own words on it; this issue does neither, so it stays on the 0.71.0 milestone at P1.
Folded into #5335 as a checklist row (TRIAGE-100, 2026-10-14): the open-ticket cap is 100, so this ticket is now tracked on that master and closed as not planned. Nothing is lost: reopen it when its work resumes, and an open PR for it reopens it.
Activity
noahgift commentedon Oct 12, 2026
Status: a fix is committed locally (3f4ab48d7b, off main 8c12fca) and waits for a PR slot.
input_bytes_sent,input_bytes_consumed,prompt_sha256,prompt_tokens.input_not_consumedbefore the driver is called (exit != 0; JSON"kind": "input_not_consumed").-p --output-format jsondocument and in the trace'ssession_endrecord.context_overflow.-D warningsclean; 935/936agent::tests pass, including all 9 new ones. The single failure,test_find_apr_binary, needs anapron PATH and is unrelated to this diff.Limits: the measurement is at the request boundary, not inside a backend, and the error path still writes no session trace.
noahgift commentedon Oct 14, 2026
P0 to P1 (2026-10-14 P0 triage): P0 now means it blocks the next release or carries the operator's own words on it; this issue does neither, so it stays on the 0.71.0 milestone at P1.
noahgift commentedon Oct 14, 2026
Folded into #5335 as a checklist row (TRIAGE-100, 2026-10-14): the open-ticket cap is 100, so this ticket is now tracked on that master and closed as not planned. Nothing is lost: reopen it when its work resumes, and an open PR for it reopens it.
Agent: aprender-clerk