feat(spa): skills mode UX — mode toggle, skills picker, request wiring (skills-mode PR-3)#476
Merged
Merged
Conversation
…g (skills-mode PR-3) The user-facing half of skills mode (docs/specs/skills-mode.md), on top of the #474 backend: - New SkillService (mirrors ToolService): loads GET /skills/, per-skill optimistic toggles persisted via PUT /skills/preferences. - New ChatModeService: admin policy from GET /system/chat-settings (compiled-in default on failure), effective mode precedence = policy lock > local selection > user preferred mode > admin default. Toggling persists preferredAgentMode (user settings) and the session's agentType so a conversation reopens in the mode it was using. - Model-settings panel: Skills/Tools segmented control (hidden when the admin disallows toggling), Skills toggle section (visual twin of the Tools section, with empty state) in skills mode, Tools section in tools mode. - Chat request: sends agent_type each turn; skills mode sends enabled_skills and enabled_tools=[] (capabilities come from skills); assistant turns are excluded and keep pre-skills-mode behavior. - Session page hydrates the stored mode from session preferences, mirroring the lastModel pattern. - Backend (additive): SessionPreferences.agent_type (validated to skill|chat, merge-safe in the metadata PUT) and user settings preferredAgentMode. Frontend: 1215 tests green (ng test) + production build clean. Backend: full suite green (two pre-existing PBT tests flaked under load in an unrelated area — session-manager truncation — and pass clean in isolation and on file re-run). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…persist Toggling skills/tools mode persists preferredAgentMode via PUT /users/me/settings, which fails loud (503, #161 behavior) when user-settings storage isn't configured. The toggle already applied in-memory, so the background persist now opts out of the global error toast via the existing SUPPRESS_ERROR_TOAST context token; explicit settings-page saves stay loud. Failure still logs to console. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR-3 of skills mode (spec; follows #473 + #474). The user-facing half: a Skills/Tools mode toggle in the settings slide-over, a per-skill picker, and chat-request wiring against the PR-2 backend.
Changes
Frontend
SkillService(mirrorsToolService): loadsGET /skills/, optimistic per-skill toggles persisted viaPUT /skills/preferenceswith revert-on-error.ChatModeService: loads the admin policy fromGET /system/chat-settings(compiled-in defaults on failure). Effective mode precedence: policy lock > local selection > user preferred mode > admin default. Toggling persistspreferredAgentMode(user settings) and the active session'sagentType.agent_type; skills mode sendsenabled_skills+enabled_tools: [](capabilities come exclusively from enabled skills' bound tools). Assistant turns are excluded and keep their exact pre-skills-mode payload.preferences.agentType), mirroring thelastModelpattern; sessions without a stored mode inherit the current selection so a home-page choice survives into the first message.Backend (additive)
SessionPreferences.agent_type(validatedskill|chat, merge-safe in the metadata PUT — added to both create/merge branches).preferredAgentModeon user settings (model + repository read whitelist).Testing
ng test): 19 new tests (SkillService load/toggle/revert, ChatModeService precedence/lock/persistence/hydration/fallback, chat-request payload matrix incl. tools mode + assistant exclusion). Full suite 1215 green; production build clean.Manual test script (alpha)
agent_type: "skill",enabled_skillswithout the disabled skill,enabled_tools: [].agent_type: "chat", your tool selection, and noenabled_skills.PUT /admin/settings/chatwith{"defaultMode": "skill", "allowModeToggle": false}→ after a reload the segmented control is gone, only Skills shows; a hand-craftedagent_type: "chat"request is overridden server-side (verify via the turn running through the SkillAgent).agent_type.🤖 Generated with Claude Code