Skip to content
pi-c Check-in [534501d23a]
Login

Check-in [534501d23a]

Overview
Comment:Each conversation keeps its own model and key (#70)
Timelines: family | ancestors | descendants | both | auth-1
Files: files | file ages | folders
SHA3-256: 534501d23ad1c5329fe7d4aaf6fc96b3307bf243d2f36e8ca2e4d1411e50de99
User & Date: dmestas on 2026-11-24 12:42:37.302
Other Links: branch diff | manifest | tags
/auth step 1 (#70): each conversation keeps its own model and key

Going on with a conversation uses the model, key and thinking level its last request ran with, instead of the saved default. Covers pic -p -c, --session, --session-id, pic ask --session, pic tui -c, /resume, and RPC --session and switch_session. A fork goes on with its parent's. --model and --key still win for one run, and that run becomes the conversation's own.

When the remembered model or key cannot be had (no key for the provider, the named key removed, the model unknown), -p and ask stop with one line that names it and the way on, and send nothing. The TUI says it in one line with the model the next message goes to; RPC says it on stderr.

How

  • No schema change. The choice is read from what the journal already keeps: pic_submission.model and thinking of the latest request along the conversation (and the ones it was forked from), and pic_generation.credential of the last reply to that model's provider, turned back into a label (default, a stored label, env, file).
  • pic_session_choice (loop.c) answers it; pic_model_usable (model.c, core) says whether it can be had now, using only core calls, so the TUI can ask it too.
  • main.c resume_choice applies it for -p and ask; --key without --model now waits for the conversation's model before it is checked.
  • rpc.c adopt_choice on --session and switch_session, unless --model was given (pic_rpc_host.model_named).
  • TUI tui_resume_choice in resume(), from new pic sessions --json fields model, credential (provider:label) and thinking.
  • keyhealth.c untouched.

Tests

New test/pic/sessionmodel.sh (dev and release; the named-key half dev only), and a TUI case at the end of test/tui/lastmodel.sh.

Tier: root and core (no new file). Clock: durability. Record: the journal's existing request and reply rows. Default: on.

Context
2026-11-24
13:03
Move pic_model_usable to loop.c so unit tests link check-in: 63946f002e user: dmestas tags: auth-1
12:42
Each conversation keeps its own model and key (#70) check-in: 534501d23a user: dmestas tags: auth-1
12:19
Create new branch named "auth-1" check-in: bd606d9d4e user: dmestas tags: auth-1
Changes