Commit Graph
1 Commits
Author SHA1 Message Date
Andrew Park 33143a5824 fix: skillorch router uses cell-configured cloud model + calibrated priors
Bug A: DEFAULT_AGENT_COMPETENCE / cost / router prompt hardcoded
`cloud-opus-4-7` with Opus's $0.30/task, so every non-Opus cell
(haiku45, gpt-5, gemini-*) routed under Opus's price + capability — the
cheaper cloud's lower cost was invisible to the router.

Bug B: priors had no overlap (cloud floor 0.70 > local ceiling 0.65) and
lambda_cost=0.5 with $0.30 per-task cost gave a 0.15 penalty that was
swamped by the competence gap. Net effect: 95-98% of tasks routed to
cloud across all n=100 cells.

This patch:
- Plumbs self._cloud_model into the agent key: cloud-<configured-model>.
  chosen_agent trace field reflects the real cloud (preserves the schema
  field name; only the *value* changes).
- Adds MODEL_COST_USD_PER_TASK calibrated against cloud-only-*-gaia-n100
  empirical per-task costs (opus47 $0.014, haiku45 $0.002, gpt-5 $0.025,
  gpt-5-mini $0.003, gemini-2.5-pro $0.002, gemini-2.5-flash $0.0006).
- Adds per-cloud competence priors so the router sees haiku/flash with
  realistically lower competence (floors ~0.50-0.55) than Opus/Pro
  (~0.70+). Local ceiling raised to 0.75 (format_compliance) so local
  can win pure-arithmetic / format-heavy mixes.
- Exposes lambda_cost in method_cfg (default 2.0, up from 0.5).
- Allows method_cfg.agent_competence / agent_cost_usd partial overrides
  so future cells can plug in calibrated priors without code changes.

Test updated: _ROUTER_JSON emits the new cell-specific key, and a new
test_skillorchestra_chosen_agent_uses_cloud_model_name asserts the
contract end-to-end for a haiku45 cell.
2026-05-17 17:36:35 -07:00