feat(auth): add sender admission overlays and /user commands - #223
Conversation
Add sender_get/sender_put and setters that write scope=sender session_service_config with only blocked and llm_enabled. Related: #216 AI-Generated: true Generated-At: 2026-09-17T21:19:23Z
Load UID overlays in AdmissionCheckStage, honor unlisted_senders, and pass through /user unblock plus /bot status for blocked senders. Related: #216 AI-Generated: true Generated-At: 2026-09-17T21:19:38Z
Write blocked and llm_enabled on Subject.im.id with session.manage. Require a sender token; do not add /black or an LLM tool. Related: #216 AI-Generated: true Generated-At: 2026-09-17T21:19:45Z
Record UID overlay semantics, /user commands, and admission.unlisted_senders on the bilingual use pages. Related: #216 AI-Generated: true Generated-At: 2026-09-17T21:19:53Z
Drop the astrbot.core import that failed the builtin-commands boundary test, print usage for omitted sender tokens, and cover sender preference helpers. Related: #216 AI-Generated: true Generated-At: 2026-09-17T22:38:02Z
Require a single sender id, reject malformed im: keys, and cover private-chat session/sender key overlap. Drop slice language from operator-facing docs and config hints. Related: #216 AI-Generated: true Generated-At: 2026-09-17T23:09:02Z
|
Review follow-up on this branch ( Issues found and fixed:
Not changed (intentional for A3 / #217): Dashboard sender picker, |
|
💡 To run commands without mentioning me, run one command with a mention first — |
Align leftover docs with UID overlays, point /user tokens at /session info, and cover llm-off admit plus minting. Related: #216 AI-Generated: true Generated-At: 2026-09-18T07:45:46Z
AI-assisted reviewReviewed against #216 / A3. No blocking runtime defects. Non-blocking gaps are fixed in BlockingNone. Sender overlays persist on Non-blocking (fixed)
Intentional leftovers (A4 / #217)Dashboard sender picker, Checks run for this follow-up: ruff on the touched Python; focused pytest (235 passed); Prettier on the touched docs/i18n; |
Summary
Persist and enforce UID sender overlays (
blocked,llm_enabled) and add/usercommands that write them. Admission now loads session plus sender overlays, drops blocked senders except recovery commands, and honorsadmission.unlisted_senders(defaultallow).Related issue
Fixes #216
Behavior
scope=sender,scope_id=Subject.im.id, keysession_service_config, and only storeblocked/llm_enabled.AdmissionCheckStageloads UMO + UID.blocked=truedrops the event in every session of this bot instance, including shared groups, except/user unblockand/bot status.admission.unlisted_sendersdefaults toallow.denyadmits only senders that already have ablockedorllm_enabledoverlay.llm_enabled=falseplus senderllm_enabled=trueadmits built-in LLM for that sender; the reverse skips LLM while commands still run. A fully blocked session is not revived by a sender VIP overlay./user block|unblock <sender_id>and/user llm on|off <sender_id>requiresession.manageand a sender token (raw platform id minted like/admin grant, or a fullim:id). Empty token prints usage and writes nothing.Non-goals
Dashboard custom-rules sender picker and OpenAPI generation (A4 / #217). Expiry,
UMO×UIDthird selector, LLM blacklist tool,/black. AbsorbingSessionStatusCheckStageinto Admission. Writing persona / KB / TTS / Provider onto sender rows. Changingprovider.managebypass, webchat skip, or notice/request skip.Implementation notes
Surgical current-path: reuse A1
compose_admission()and A2AdmissionCheckStage. Sender writes go throughsender_service_config()so extra keys are dropped.should_process_llm_requeststill composesllm_enabledonly;blockedis an Admission event drop. OpenAPI generation is not required.Four commits on
feat/sender-admission-overlays: persist setters, admission execution,/usercommands, bilingual docs.Validation
Focused pytest passed (202 tests). Ruff on changed Python, Dashboard
pnpm i18n:check, docspnpm run docs:build, Prettier on the touched docs/i18n, andmake check-mdpassed.make checkand the full blocking pytest suite were not run.Compatibility and risk
Not a breaking API change. Default
unlisted_senders=allowpreserves A2 behavior for unlisted people. Operators who setdenywithout writing sender overlays will drop those senders. Blocking a sender also blocks them in every session of this instance; recovery is/user unblockand/bot statusonly. Private-chat session keys and sender keys stay distinct.Checklist
docs/zh/anddocs/en/.docs/public/openapi.json, and tests change together when routes or schemas change.pyproject.toml,requirements.txt, anduv.locktogether.!and aBREAKING CHANGE:footer.Agent note
Goal: land A3 of #212 / #216 — persist and execute UID
blocked/llm_enabledoverlays, add/userwriters, and document instance-global sender admission. Four commits onfeat/sender-admission-overlays:feat(auth)persist,feat(auth)admission,feat(commands)/user,docs. Checks actually run are listed above; fullmake check/ blocking pytest were not. Residual risk: Dashboard sender list picker remains #217;unlisted_senders=denyhas no UI list in this slice; missing/userargs fail at command bind rather than the usage i18n path (whitespace tokens do). Tools: OpenCode. This write-up is not the required separate AI-assisted review.