2b66da71c5
Phase 4 (final) of the native-harness working-memory sprint. OllamaProvider .complete_with_tools now returns (text, calls, usage), surfacing the response's real prompt_eval_count/eval_count (free — already in the payload). The native loop EMA-smooths real/estimate into self._tok_ratio (clamped [0.5,3.0]) and prunes against native_token_budget / ratio, so context budgeting tracks the TRUE window instead of the systematic bias of the len//4 char estimate. Providers that omit counts leave the ratio at 1.0, so behaviour is unchanged where unavailable — a free correctness win, no regression. RAM-only, no disk, no new network frames. Scope note: touches only cmd_chat/agent/ + providers — disjoint from the parallel feat(operator) work on this branch, so it merges/reverts independently by path. Sprint: native-harness-working-memory (Phase 4/4) — see also46e5620,dc6317fCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>