Bug
When the gateway pre-pass routes a message to run_python, the deterministic gate in backend/gateway/policy.py forces a spurious clarifying question on the code slot.
Chain of events:
code is schema-required for run_python (backend/tools/definitions.py, "required": ["code"]), so _base_criticality classifies it as high criticality.
("run_python", "code") is absent from the INFERABLE set in backend/gateway/policy.py.
- The gateway prompt (
backend/prompts/gateway.py) tells the classifier to tag a slot assumed when it is guessing — which is always true for code, because users never supply Python source themselves; the model authors it.
slot_gates() therefore fires (assumed + high criticality + not inferable), and gate() returns needs_plan, asking the user to clarify "code" — a slot they cannot meaningfully answer.
An honestly grounded plan routing to run_python can effectively never reach ready.
Fix
Add ("run_python", "code") to INFERABLE in backend/gateway/policy.py, mirroring the existing generate_chart entries whose rationale applies exactly (e.g. ("generate_chart", "data") # comes from an upstream tool, not the user): the model authors the code itself; the user never supplies it. With that entry, an assumed code slot no longer gates and a run_python plan yields ready.
Includes a unit test in backend/tests/test_gateway.py covering the run_python/code path through gate().
Bug
When the gateway pre-pass routes a message to
run_python, the deterministic gate inbackend/gateway/policy.pyforces a spurious clarifying question on thecodeslot.Chain of events:
codeis schema-required forrun_python(backend/tools/definitions.py,"required": ["code"]), so_base_criticalityclassifies it as high criticality.("run_python", "code")is absent from theINFERABLEset inbackend/gateway/policy.py.backend/prompts/gateway.py) tells the classifier to tag a slotassumedwhen it is guessing — which is always true forcode, because users never supply Python source themselves; the model authors it.slot_gates()therefore fires (assumed+ high criticality + not inferable), andgate()returnsneeds_plan, asking the user to clarify "code" — a slot they cannot meaningfully answer.An honestly grounded plan routing to
run_pythoncan effectively never reachready.Fix
Add
("run_python", "code")toINFERABLEinbackend/gateway/policy.py, mirroring the existinggenerate_chartentries whose rationale applies exactly (e.g.("generate_chart", "data") # comes from an upstream tool, not the user): the model authors the code itself; the user never supplies it. With that entry, an assumedcodeslot no longer gates and a run_python plan yieldsready.Includes a unit test in
backend/tests/test_gateway.pycovering the run_python/code path throughgate().