mirror of
https://github.com/patriceckhart/zot.git
synced 2026-06-27 13:56:33 +02:00
applyModelSelection's cross-provider branch built a fresh agent via BuildAgentFor and assigned it to i.agent without copying anything from the old one, so the user perceived /model anthropic->openai (or vice versa) as a hard reset of the entire conversation. same-provider swaps already worked because they only mutated agent.Model in place. now the cross-provider path snapshots agent.Messages() and agent.Cost() before constructing the replacement, then SetMessages + SeedCost on the new agent so the transcript and the cumulative dollar meter both carry across. added core.Agent.SeedCost(provider.Usage) for the cost transfer. messages already round-trip cleanly because tool names are normalised to lowercase in the in-memory provider.Message representation; the oauth-only Read/Write/Edit/Bash rename happens on the wire at request build time, not in the transcript. verified end-to-end via zot rpc: turn 1 (opus): "remember teal" -> "ok" set_model: opus -> sonnet turn 2 (sonnet): "what color did i say?" -> "teal" both same-provider (opus<->sonnet) and cross-provider (anthropic<->openai) paths exercised. |
||
|---|---|---|
| .. | ||
| agent | ||
| assets | ||
| auth | ||
| core | ||
| provider | ||
| tui | ||