Skip to content
pi-c Check-in [88759093c7]
Login

Check-in [88759093c7]

Overview
Comment:Profiles, and the /auth list on the phone (#75)
Timelines: family | ancestors | descendants | both | auth-6
Files: files | file ages | folders
SHA3-256: 88759093c7e4988a7bbfb32ad60e2eb000da032f691c7707eb0c055908716a13
User & Date: dmestas on 2026-11-24 19:48:05.502
Other Links: branch diff | manifest | tags
/auth step 6 (#75): profiles, and the /auth list on the phone

Profiles

A profile is the setting profile:NAME = {"model", "key"?, "thinking"?}, kept in userdb.c (pic_profile_get, pic_profile_set, pic_profiles_each).

  • pic profiles [list] | set NAME --model M [--key L] [--thinking T] | remove NAME, each with [--json]. A name is 1-32 of a-z, 0-9, - and _, and may not be a provider's name. A key the model's provider lacks is refused.
  • --model NAME with no / uses the profile: its model, plus its key and thinking level unless --key or --thinking is given. The level is clamped to what the model takes.
  • TUI /model NAME (asks get_profiles), RPC set_model {profile}, and get_profiles in the registry.

On the phone (pic remote)

  • Answered through the registry: get_credentials, check_credentials and get_profiles. These return names, kinds, states, what is left, expiry and rules, never a key. check_credentials runs on the computer, inside pic remote's loop, for up to the 8-second check deadline.
  • set_credential is held per conversation (rmt_choice.key), as set_model is, and passed to that conversation's next run as --key. With persist: true it becomes the provider's saved key.
  • set_model {profile} sets the model, key and level together.
  • get_state gains credential (provider:label): the phone's choice, else the conversation's own.
  • Not carried (answered not_available): add_credential, command keys, removing a key, rules, expiry and unlock.
  • docs/design/remote-protocol.md: a new subsection "Keys and profiles" and two command-table rows. It is byte-identical to pic-relay's docs/remote-protocol.md (pic-relay branch auth-6).

Tests

  • authcmd.sh: profiles over the shell and RPC.
  • remote.sh: phone get_credentials, set_credential (held, and a missing label refused), get_state credential, get_profiles, set_model profile, and no key reaching the phone.

Tier: core (userdb.c, rpc.c), bundled (remote.c), root (main.c), client (tui); no new file. Clock: pi. Record: settings profile:NAME. Default: no profiles.

Context
2026-11-25
00:13
merge trunk check-in: 017edb636c user: dmestas tags: auth-6
2026-11-24
19:48
Profiles, and the /auth list on the phone (#75) check-in: 88759093c7 user: dmestas tags: auth-6
19:28
Create new branch named "auth-6" check-in: 02d9d360d7 user: dmestas tags: auth-6
Changes