chat: remember last model

This commit is contained in:
2026-02-14 22:06:30 -08:00
parent a76b4ba232
commit fb306e154a
8 changed files with 173 additions and 9 deletions

View File

@@ -111,6 +111,7 @@ Behavior notes:
- If `chatId` is present, server validates chat existence.
- For `chatId` calls, server stores only *new* non-assistant messages from provided history to avoid duplicates.
- Server persists final assistant output and call metadata (`LlmCall`) in DB.
- Server updates chat-level model metadata on each call: `lastUsedProvider`/`lastUsedModel`; first successful/failed call also initializes `initiatedProvider`/`initiatedModel` if unset.
## Searches
@@ -151,7 +152,16 @@ Search run notes:
`ChatSummary`
```json
{ "id": "...", "title": null, "createdAt": "...", "updatedAt": "..." }
{
"id": "...",
"title": null,
"createdAt": "...",
"updatedAt": "...",
"initiatedProvider": "openai|anthropic|xai|null",
"initiatedModel": "string|null",
"lastUsedProvider": "openai|anthropic|xai|null",
"lastUsedModel": "string|null"
}
```
`Message`
@@ -172,6 +182,10 @@ Search run notes:
"title": null,
"createdAt": "...",
"updatedAt": "...",
"initiatedProvider": "openai|anthropic|xai|null",
"initiatedModel": "string|null",
"lastUsedProvider": "openai|anthropic|xai|null",
"lastUsedModel": "string|null",
"messages": [Message]
}
```