Commit Graph

1 Commits

Author SHA1 Message Date
40791bb5d9 fix(cron): inject cloud-context warning when prompt refs localhost (#378)
Some checks failed
Forge CI / smoke-and-build (pull_request) Failing after 58s
Health Monitor cron job prompts reference 'Check Ollama' and
'localhost:11434' but run on cloud models (nous/mimo-v2-pro) that
cannot reach local services. The agent wastes iterations on doomed
localhost calls.

Fix: After resolving the runtime endpoint, detect local service
references in the prompt. When the endpoint is cloud (not local),
inject a SYSTEM NOTE telling the agent it cannot reach localhost
and to report the configuration issue instead.

Changes:
- cron/scheduler.py: Add re import, _LOCAL_SERVICE_PATTERNS,
  _detect_local_service_refs(), _inject_cloud_context(). Call
  _inject_cloud_context() after resolve_turn_route() in run_job.
- tests/test_cron_cloud_context.py: 15 tests covering pattern
  detection, cloud injection, local endpoint bypass.

Closes #378
2026-04-13 21:01:33 -04:00