Overview
| Comment: | Rules give a model family its own key; picker key column (#73) |
|---|---|
| Timelines: | family | ancestors | descendants | both | auth-4 |
| Files: | files | file ages | folders |
| SHA3-256: |
6b85612d46257df0bc0a4d97d6c3dd36 |
| User & Date: | dmestas on 2026-11-24 18:06:19.983 |
| Other Links: | branch diff | manifest | tags |
/auth step 4 (#73): rules give a model family its own key
A rule is the setting keyFor:PATTERN, whose value is a key label. PATTERN is a model id
(provider/id) with * for any part. The models it matches use that key of their own provider.
The rest of the provider keeps its key. A rule never sends a model to another provider.
Which key a request uses, in order:
- the per-process label:
--key, the conversation's own key (step 1), or RPCset_credential - the rule for the request's model: an exact pattern first, then the longest pattern that matches
activeKey:PROVIDER, and the rest of the existing lookup order
Where
- cred.c (core):
pic_cred_model(model)tells cred which model the next requests are for.pic_cred_rules,pic_cred_rule_forandpic_cred_rule_setread, match and save rules;cred_rule_ofis one new step incred_choose.pic_cred_usedgainsrule. A rule as long as an existing one that could match the same models is refused, naming the existing one. - provider_http.c sets the model just before a request fetches its key, and main.c
model_providersets it too. - Shell:
pic auth use P L --for PATTERN [--json]andpic auth use P --for PATTERN --clear.pic auth statuslists the rules. - JSON:
bindingsinget_credentialsandpic auth status --json. Eachpic models --jsonrow gainscredential,bound_byandrule. - RPC:
set_model_credential {pattern, label|null}, saved. - TUI: the model picker's key column (tui_mrow.key) reads "second" or "work by rule". In /auth,
bon a key takes a pattern, and Enter saves it, or removes it when the key already has that rule. Each row says which families its rules give it.
For the MCP work: cred.c gained new functions and one branch in cred_choose; no existing
function changed shape.
Not here
The proposal's scope session for set_model_credential (a rule for one process) is not
implemented: rules are always saved.
Tests
- test/pic/authcmd.sh: a rules section covering the shell, RPC, which key is actually sent, that
--keystill wins, the conflict refusal, and thepic models --jsonfields. - test/tui/auth.sh:
band the picker's key column.
Tier: core (cred.c, provider_http.c), root (main.c), client (tui); no new file. Clock: pi. Record:
settings keyFor:PATTERN. Default: no rules.
Context
|
2026-11-24
| ||
| 18:14 | Catalog test takes the models rows' key fields check-in: 72e1d37d92 user: dmestas tags: auth-4 | |
| 18:06 | Rules give a model family its own key; picker key column (#73) check-in: 6b85612d46 user: dmestas tags: auth-4 | |
| 17:44 | Create new branch named "auth-4" check-in: 173ad922e2 user: dmestas tags: auth-4 | |
Changes
Modified CHANGELOG.md
from [490a7a8005]
to [a8c73ef644].
[diff]
Modified docs/manual/auth.md
from [cc4ef094e2]
to [2f984e363b].
[diff]
Modified docs/manual/named-keys.md
from [01262ecd88]
to [da731b7dce].
[diff]
Modified docs/reference/cli.md
from [ef3ebe1fe2]
to [9ffa0610d6].
[diff]
Modified docs/reference/rpc-commands.md
from [d6c68011a4]
to [f04734f356].
[diff]
Modified docs/reference/settings.md
from [0807313edf]
to [8f9d3f20e5].
[diff]
Modified src/cred.c
from [51f63c5bbf]
to [e595dfbe0e].
[diff]
Modified src/cred.h
from [8cf8339f92]
to [de993f2d39].
[diff]
Modified src/main.c
from [0cbb353f82]
to [0e05966000].
[diff]
Modified src/provider_http.c
from [7e2056ee88]
to [c87228b6f3].
[diff]
Modified src/tui/app.c
from [dc7eb7c5ab]
to [27330de84c].
[diff]
Modified test/pic/authcmd.sh
from [4be2632926]
to [610cea0cfd].
[diff]
Modified test/pic/docs.sh
from [054c16adf2]
to [085055521e].
[diff]
Modified test/tui/auth.sh
from [e58dba7b6e]
to [46eb7cc934].
[diff]