Team remote job execution reads the installed workflow spend ceiling from the wrong engine_spec path.
The workflow stores the cap at:
engine_spec.capabilities.max_spend_cents
but routes/team.py::job_runner() reads:
engine_spec.max_spend_cents
Reproduction:
- Use a workflow with:
{
"engine_spec": {
"capabilities": {
"max_spend_cents": 50000
}
}
}
- Run it through the Team job path with an explicit requester max_spend_cents of 50000.
- The current lookup resolves:
engine_top_level_cap = None
engine_capabilities_cap = 50000
- The job is rejected with:
cap mismatch: job authorizes 50000c but the installed workflow's ceiling is None
Expected:
The Team job should resolve the workflow ceiling from engine_spec.capabilities.max_spend_cents. With both requester and workflow caps at 50000 cents, cap validation should pass.
Root cause:
wf_cap = (rec.get("engine_spec") or {}).get("max_spend_cents")
Suggested fix:
caps = (rec.get("engine_spec") or {}).get("capabilities") or {}
wf_cap = caps.get("max_spend_cents")
Impact:
Valid spend-capped remote Team jobs can be rejected because the installed workflow ceiling is incorrectly resolved as None.
Confirmed against Station v0.68 source/runtime behavior.