| Artifact ID: | 94a2c183bf1c74ff38b2f77794eecbddbfbb49f12b979bd2a0ba8823ef05a417 |
|---|---|
| Page Name: | checkin/534501d23ad1c5329fe7d4aaf6fc96b3307bf243d2f36e8ca2e4d1411e50de99 |
| Date: | 2026-11-24 12:43:00 |
| Original User: | dmestas |
| Mimetype: | text/x-markdown |
/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.modelandthinkingof the latest request along the conversation (and the ones it was forked from), andpic_generation.credentialof 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_choiceapplies it for-pandask;--keywithout--modelnow waits for the conversation's model before it is checked. - rpc.c
adopt_choiceon--sessionandswitch_session, unless--modelwas given (pic_rpc_host.model_named). - TUI
tui_resume_choiceinresume(), from newpic sessions --jsonfieldsmodel,credential(provider:label) andthinking. - 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.