Every ticket as the root of its provenance graph — goal, patch, approval, runs and (as the ticket-class build lands) mandate, manifestations, guarantees, journey, artifacts and children. Rendered through the <<<TicketGraphList>>> tag.
--num-ctx is a DEAD PARAMETER: thread it through run_agent -> constrained -> num_ctx_for(override=)
goal
DEAD PARAMETER: --num-ctx is parsed, documented, passed down -- and never used.
run_agent() (tools/ollama_agent.py:1470) accepts a `num_ctx` argument; the CLI parses
--num-ctx (line ~2839) and main() passes it down as `num_ctx=a.num_ctx` (line ~1675).
run_agent NEVER USES IT. constrained() (line 1419) computes its own
nctx = num_ctx_for(model, chars + 2000) # line 1436
with no override argument, so the caller's value is dropped on the floor. Setting
--num-ctx has no effect whatsoever in agent mode. num_ctx_for() (line 460) already
supports an `override` keyword and always has: the FUNCTION is correct, and the WIRE
between the flag and the function was never connected.
WHY THE 180-CHECK SELFTEST DID NOT CATCH IT. The suite tests the function, not the wire:
ck("--num-ctx overrides the sizing", num_ctx_for("fake:test", 100, override=16384) == 16384)
That check is green and always was. Nothing tests that the FLAG reaches num_ctx_for.
The check's NAME makes a claim about the flag while its BODY verifies a claim about the
function -- a check with no teeth at the integration seam. Do not "fix" that line.
REQUIRED BEHAVIOR -- thread num_ctx through run_agent -> constrained -> num_ctx_for(override=):
1. Add `num_ctx=None` to constrained()'s signature (lines 1419-1421).
2. Line 1436 becomes:
nctx = num_ctx_for(model, chars + 2000, override=num_ctx)
3. Pass `num_ctx=num_ctx` from BOTH constrained() calls inside run_agent:
- the step-loop call at line 1557
- the envelope call at line 1598
Missing either one leaves the flag half-dead, which is harder to spot than fully dead.
Change NOTHING else. In particular do NOT add a `temperature` parameter to constrained():
that is a different tree's change and is out of scope for this ticket.
VERIFY BEFORE REPORTING DONE -- two things, both required:
(a) `python3 tools/ollama_agent.py --selftest` still passes 180/180.
(b) Prove the flag now reaches the WIRE, with a NEGATIVE CONTROL, by monkeypatching the
transport and reading the actual request body:
import sys, time; sys.path.insert(0, "tools")
import ollama_agent as OA
seen = []
OA._ollama = lambda path, body, timeout=600: (
seen.append(body) or {"message": {"content": '{"tool":"finish","args":{}}'}})
OA.constrained("gemma-coder", [{"role": "user", "content": "x"}],
{"type": "object"}, 0, time.time() + 60, num_ctx=32768)
# POS: seen[-1]["options"]["num_ctx"] must == 32768
seen.clear()
OA.constrained("gemma-coder", [{"role": "user", "content": "x"}],
{"type": "object"}, 0, time.time() + 60)
# NEG: seen[-1]["options"]["num_ctx"] must be SIZED to the payload (8192), NOT 32768
The negative control is the point: it proves the positive check would go RED if the
threading were removed -- exactly what the original unit test could not do. Report the
observed value from BOTH runs in your note, as numbers, not as "passed".
SCOPE. The harness commits tools/ollama_agent.py and nothing else. A dedicated test file
for this lands in a FOLLOW-UP ticket -- do not create one here: anything you write outside
tools/ollama_agent.py is a stray, is NOT committed, and does not survive the reap.
patch
none
approval
unapproved
runs
no runs recorded
mandate (clauses)
not yet recorded — lands with the ticket-class build
manifestations
not yet recorded — lands with the ticket-class build
guarantees
not yet recorded — lands with the ticket-class build
journey (blunders & successes)
not yet recorded — lands with the ticket-class build