zot/internal
patriceckhart 5a2cfb525e fix: keep transcript and cumulative cost across cross-provider /model swap
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.
2026-04-19 12:47:12 +02:00
..
agent fix: keep transcript and cumulative cost across cross-provider /model swap 2026-04-19 12:47:12 +02:00
assets add logo to callback page 2026-04-18 10:15:53 +02:00
auth add auto compaction 2026-04-18 10:34:08 +02:00
core fix: keep transcript and cumulative cost across cross-provider /model swap 2026-04-19 12:47:12 +02:00
provider fix(anthropic): drop claude-code identity cache marker 2026-04-19 12:39:33 +02:00
tui feat: zotcore SDK + zot rpc subprocess protocol 2026-04-19 12:26:48 +02:00