When a model fails and FallbackResolver picks a replacement, it now: 1. Fires the before_model_select hook with reason='fallback' and the failing model's ID — the learning system records the failure outcome and returns the best Bayesian-blended replacement from llm_task_outcomes 2. Falls back to the existing heuristic sort (reasoning + context window) if the hook is unavailable or returns no override Changes: - BeforeModelSelectEvent: add optional currentModelId and reason fields - FallbackResolver: accept emitBeforeModelSelect in constructor; make _findAnyAvailableFallback async; fire hook before heuristic fallback - agent-session.ts: inject lazy emitBeforeModelSelect closure into resolver - register-hooks.js: record failure outcome when reason='fallback' before returning selectLearnedModel result Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| agent-core | ||
| ai | ||
| coding-agent | ||
| daemon | ||
| google-gemini-cli-provider | ||
| native | ||
| rpc-client | ||
| tui | ||