feat(ai-chat): agent roles — parallel impl (agent 180 / model B) #22
Closed
Ghost
wants to merge 4 commits from
feat/ai-agent-roles-agent180 into develop
pull from: feat/ai-agent-roles-agent180
merge into: vvzvlad:develop
vvzvlad:main
vvzvlad:test/244-part-b
vvzvlad:fix/255-ws-redis-adapter-leak
vvzvlad:feat/251-intentional-clear
vvzvlad:fix/252-e2e-open-handles
vvzvlad:feat/184-autonomous-agent-runs
vvzvlad:feat/221-image-captions
vvzvlad:feat/git-sync
vvzvlad:refactor/193-tool-spec-registry
vvzvlad:fix/244-dataloss-bugs
vvzvlad:fix/embeddings-reindex-progress
vvzvlad:develop
vvzvlad:feature/offline-sync
vvzvlad:feat/229-catalog-yaml
vvzvlad:feat/243-blob-sandbox
vvzvlad:feat/228-inline-footnotes
vvzvlad:fix/qa-ui-bugs-216-218
vvzvlad:feature/agent-roles-catalog
vvzvlad:fix/share-alias-rename
vvzvlad:fix/ai-chat-empty-render
vvzvlad:feat/191-chat-doc-binding
vvzvlad:feat/201-temporary-notes
vvzvlad:feat/198-interrupt-agent
vvzvlad:feat/ai-chat-full-history
vvzvlad:feat/199-ai-generate-title
vvzvlad:feat/205-share-aliases
vvzvlad:batch/issues-189-187-170
vvzvlad:feat/170-mcp-test-button
vvzvlad:feat/189-context-badge
vvzvlad:feat/198-interrupt-agent-send-now
vvzvlad:fix/issues-190-159
vvzvlad:fix/ai-chat-new-chat-during-stream
vvzvlad:fix/ai-chat-stream-perf
vvzvlad:batch/issues-2026-06-25
vvzvlad:feat/ai-chat-persistent-history
vvzvlad:fix/ai-chat-copy-chat-wysiwyg
vvzvlad:fix/ai-stream-reset-resilience
vvzvlad:fix/ai-stream-undici-timeout
vvzvlad:fix/footnote-review-1227-followup
vvzvlad:fix/ai-chat-token-counter-realtime
vvzvlad:docs/manual-qa-test-plan
No Reviewers
Labels
Clear labels
bug
documentation
duplicate
enhancement
epic
feature
good first issue
help wanted
idea
invalid
needs-human
question
refactor
review/approved
review/changes-requested
review/needs
security
status/blocked
status/done
status/in-progress
status/ready
test
wontfix
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Large multi-phase effort spanning many changes
New functionality request
Good for newcomers
Extra attention is needed
Idea / proposal for discussion
This doesn't seem right
эскалация: нужно решение человека
Further information is requested
Code cleanup / refactoring
в последнем ревью нет открытых blocking-находок
последнее ревью оставило открытые blocking-находки
head не ревьюился (head != reviewed_head)
Security / hardening issue
ждёт зависимость blocked_by
закрыто и проверено
в активной работе (мягкая заявка)
специфицировано, не заблокировано, ждёт исполнителя
Test coverage / test infrastructure
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vvzvlad/gitmost#22
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "feat/ai-agent-roles-agent180"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context — model-comparison pair
This is the second of two parallel implementations of the same backlog feature (ai-agent-roles), produced by a different model for side-by-side comparison. The other implementation is PR #11 (
feat/ai-agent-roles, agent 227). Both branch from common ancestorc8af6376; they share no commits.Key differences vs PR #11 (agent 227):
ai.service.ts/ai-settings.service.ts(PR #11 uses a dedicatedrole-model-config.ts).create/update/idfiles (PR #11 uses one combined dto).features/workspace/(PR #11 underfeatures/ai-chat/).What
Workspace-admin presets that customize the AI agent's system-prompt persona and optionally the model, attached to a chat at creation. A role changes ONLY instructions + optional model; the toolset stays full, so the CASL security boundary is unchanged.
Backend
20260620T150000-ai-agent-roles:ai_agent_rolestable +ai_chats.role_id(ON DELETE SET NULL)./workspace/ai-agent-roles. LIST (picker view) open to all workspace members; create/update/delete admin-only. Picker view omitsinstructions/modelConfigso they never leak to non-admins.buildSystemPrompt: optionalroleInstructionsREPLACES the admin persona (priority: role > admin > default). Non-removableSAFETY_FRAMEWORKalways appended.AiChatService.stream: persistsroleIdon the first turn; later turns read it from the chat row, never the request body. Instructions stay applied even if the role is later disabled or soft-deleted.AiService.getChatModel(workspaceId, override?): same-driver overrides reuse the workspace key; cross-driver (openai/gemini) loads alternate creds and throws a clean 503 if missing; cross-driver ollama rejected with a clear message. Controller resolves the role model BEFOREres.hijack().Client
Verification
tsc --noEmitserver + client clean;pnpm --filter client test58/58; server tests unchanged vs baseline (6 pre-existing DI failures in unrelated modules).Known follow-ups
Pull request closed