Add reusable agent profiles (#3208)

* Search models across all providers from the picker root

* Store agent profiles in daemon config and apply agent config in one RPC

An agent profile is a named bundle of provider, model, mode, thinking
option, feature values and notes, stored host-wide next to terminal
profiles. It carries no system prompt: AgentSessionConfig.systemPrompt is
creation-only, so a profile holding one would apply when starting an agent
and silently do nothing when applied to a running one.

Applying a profile through the four single-field RPCs can fail halfway and
leave an agent matching no profile, so agent.config.apply takes the whole
bundle. Model runs first because a thinking option only means anything
against the model that offers it.

Old daemons parse their persisted config strictly and would drop an
unknown agentProfiles key, making a save appear to succeed and vanish, so
both capabilities are advertised on server_info for the client to gate on.

list_profiles exposes the profiles to orchestrating agents, which read the
notes to pick one and copy its values into create_agent.

* Add the agent profiles settings section

Profiles live behind one module boundary so removing the feature is a
directory plus one mount, which is what favourites never was. The picker
and composer will ask for rows and an apply function rather than learning
what a profile contains.

The edit form follows the form-model pattern instead of the terminal
profile modal's per-field state, because provider selection cascades into
which models, modes, thinking levels and features exist below it.

The section is gated on server_info.features.agentProfiles: an older daemon
drops the key on write, and a save that appears to work and then vanishes
is worse than an unavailable state.

* Document agent profiles and name the four senses of profile

The glossary reserved Profile for HostProfile, terminal profiles owned the
user-facing word, and custom-providers.md used it for provider aliases.
Agent profile is now the term, with all four cross-referenced.

data-model.md never documented terminalProfiles either, so both profile
lists are backfilled together along with the whole-list patch semantics and
why absent and empty differ.

* Pin agent profiles to the model picker and delete favourites

Applying a profile writes its values into the agent controls and is then
forgotten, so rows carry no checkmark and no selected state: after applying,
nothing is selected. Chevron still means navigate deeper, so the absence of
one is what marks a row as an action.

A running agent is its provider's process and agent.config.apply carries no
provider, so the live picker only offers profiles matching the agent's
provider rather than showing rows that cannot do what they say. The draft
path has no such limit and switches provider freely.

Draft feature values go through preferences rather than the feature
callback alone, because the draft feature hook clears local values whenever
the provider changes and a provider-switching profile would lose them.

Favourites are deleted rather than migrated: they were device-local
AsyncStorage keyed by provider and model, while profiles are host-wide
daemon config. ProviderSelectionModelRow.favoriteKey stays as row identity
and moves to its real owner; renaming it is its own commit.

* Cover agent profiles and cross-provider search with E2E specs

Model rows expressed selection only as a checkmark glyph, which assistive
tech cannot see and a spec cannot assert. Rows that draw the indicator now
carry aria-selected; profile rows deliberately carry none, because a
profile is an action rather than a selection. That is what makes "nothing
is marked selected after applying a profile" a real assertion instead of a
tautology, with the materialized model one level down as the control.

The search fixture extends claude rather than mock: provider-config.ts
only allows the six shipped providers as extends targets, so a derived
provider cannot inherit the dev-only mock provider.

* State what applying a config bundle does on partial failure

applyBundle is not a transaction and the earlier commit message implied it
was. A step that rejects aborts the rest and the steps that already applied
stay applied, which a profile omitting modelId can reach: provider setters
validate against the agent's live model, so mode can land while a feature
that model does not support is rejected.

Nothing is hidden by that. Every setter emits agent state before returning,
so what applied is streamed to the client next to the rejected response.
Rolling back would re-invoke the setters that just failed, usually against
a session that is gone, and pre-flight validation would restate each
provider's model-dependent checks where they would drift from the setters
that own them.

What sending the bundle in one request removes is the multi-round-trip
failure class: interruption between hops, and interleaving with another
client. The test already pinned this behaviour; its name now says so.

* feat(agent-profiles): refine profile discovery and appearance

Make profiles discoverable from empty and provider-scoped model pickers, keep global search stable and virtualized, and move profile settings under Agents. Replace emoji identity with a shared Lucide icon and host-color picker, while requiring concrete provider selections so profiles materialize predictably.

* fix(agent-profiles): defer profile swatch styles

Resolving Unistyles proxies at module load can freeze the temporary startup color scheme before the persisted theme is restored. Keep only style-key names at module scope and resolve the selected swatch during render.
This commit is contained in:
Mohamed Boudra
2026-08-11 17:42:35 +02:00
committed by GitHub
parent 07044136c8
commit 308e9af845
72 changed files with 6348 additions and 538 deletions
+45 -3
View File
@@ -1406,14 +1406,18 @@ export const ko: TranslationResources = {
loadingSelector: "모델 선택기 불러오는 중...",
error: "오류",
defaultModel: "기본값",
favorites: "즐겨찾기",
favoriteModel: "모델 즐겨찾기",
unfavoriteModel: "모델 즐겨찾기 해제",
profiles: "프로필",
providers: "제공자",
editProfiles: "편집",
editProfilesLabel: "에이전트 프로필 편집",
createProfile: "프로필 만들기",
modelCount: "모델 {{count}}개",
modelCountPlural: "모델 {{count}}개",
retry: "다시 시도",
retrying: "다시 시도 중...",
noMatches: "검색과 일치하는 모델이 없습니다",
noMatchesForQuery: '"{{query}}"과(와) 일치하는 모델이 없습니다',
searchAllPlaceholder: "모든 모델 검색...",
searchPlaceholder: "모델 검색...",
openProviderSettings: "{{provider}} 설정 열기",
},
@@ -2202,6 +2206,44 @@ export const ko: TranslationResources = {
save: "저장",
emptyState: "아직 프로필이 없습니다. 특정 명령으로 터미널을 실행하려면 하나 추가하세요.",
},
agentProfiles: {
sectionTitle: "에이전트 프로필",
unavailable: "에이전트 프로필을 관리하려면 이 호스트에 연결하세요",
unsupported: "이 호스트에서 실행 중인 데몬은 아직 에이전트 프로필을 지원하지 않습니다",
emptyState:
"아직 프로필이 없습니다. 저장된 프로바이더와 모델로 에이전트를 시작하려면 하나 추가하세요.",
addProfileTitle: "에이전트 프로필 추가",
newProfile: "새 프로필",
editProfile: "프로필 편집",
editProfileTitle: "에이전트 프로필 편집",
nameLabel: "이름",
namePlaceholder: "UI 작업",
iconLabel: "아이콘",
noIcon: "없음",
providerLabel: "프로바이더",
providerPlaceholder: "프로바이더 선택",
noProviders: "이 호스트에서 사용 가능한 프로바이더가 없습니다",
modelLabel: "모델",
noModels: "이 프로바이더에는 선택할 수 있는 모델이 없습니다",
modeLabel: "모드",
noModes: "이 프로바이더에는 선택할 수 있는 모드가 없습니다",
thinkingLabel: "사고",
noThinkingOptions: "이 모델에는 사고 수준이 없습니다",
featuresLabel: "기능",
featureCount: "기능 {{count}}개",
featureCountOne: "기능 {{count}}개",
notesLabel: "에이전트를 위한 메모",
notesPlaceholder: "UI 작업에 사용 — 컴포넌트, 레이아웃, 디자인 토큰.",
notesHint:
"list_profiles MCP 도구가 반환합니다. 다른 에이전트에게 전달할 지침으로 작성하세요.",
save: "저장",
saving: "저장하는 중...",
remove: "제거",
removeConfirmTitle: "프로필을 제거할까요?",
removeConfirmMessage: '"{{name}}"을(를) 제거할까요?',
moveUp: "위로 이동",
moveDown: "아래로 이동",
},
daemon: {
rename: {
editLabel: "레이블 편집",