Skip to content

Gate personas to agents whose CLI honors a replaced system prompt#542

Merged
Mng-dev-ai merged 1 commit into
mainfrom
fix/personas-supported-agents-gating
Apr 20, 2026
Merged

Gate personas to agents whose CLI honors a replaced system prompt#542
Mng-dev-ai merged 1 commit into
mainfrom
fix/personas-supported-agents-gating

Conversation

@Mng-dev-ai
Copy link
Copy Markdown
Owner

Summary

  • Cursor, Copilot, and OpenCode CLIs silently ignore the system prompt passed over ACP, so selecting a persona had no effect on those agents.
  • Added PERSONAS_SUPPORTED_AGENTS = {claude, codex} on both backend and frontend. Claude replaces the system prompt via ACP _meta.systemPrompt; Codex uses model_instructions_file (landed in Use model_instructions_file for Codex persona mode #541).
  • Backend: build_system_prompt_for_chat now takes agent_kind and skips the persona when the agent isn't supported; callers in chat.py and streaming/runtime.py derive it from MODELS[model_id].agent_kind.
  • Frontend: PersonaSelector is hidden in the input bar for unsupported agents, and the Personas settings tab description notes the limitation.
  • OpenCode technically supports prompt replacement via a custom-agent markdown file + --agent flag, but that's a separate integration — hidden here along with cursor/copilot.

Test plan

  • Select a Claude model, pick a persona, send a message — persona applies as before.
  • Select a Codex model, pick a persona, send a message — persona applies via model_instructions_file.
  • Switch to a Cursor / Copilot / OpenCode model — persona selector disappears from the input bar.
  • Open Settings → Personas — description mentions Claude/Codex only.
  • Queue a message on a Claude chat, then switch the queued chat's agent to Cursor — backend drops the persona when the queue item is drained.

Cursor, Copilot, and OpenCode silently ignore the system prompt we pass
over ACP, so personas had no effect there. Restrict persona application
to Claude and Codex in the backend and hide the selector in the UI;
note the limitation in the Personas settings description.
@Mng-dev-ai Mng-dev-ai merged commit 217b358 into main Apr 20, 2026
3 checks passed
pull Bot pushed a commit to woakes070048/claudex that referenced this pull request May 9, 2026
Fill in the harness content layer that PR 1 routed to. Each artifact
doc captures the rules an agent must know before writing that artifact
type; each domain map gives entry points, vocabulary, gotchas, and
verified prior-art PRs.

Backend artifacts (docs/artifacts/backend/):
- models.md      — SQLAlchemy 2.x async, Mapped[], custom column types,
                   Alembic workflow, anti-patterns
- endpoints.md   — FastAPI route handlers, deps.py wiring, domain
                   exceptions, auth dependencies, SSE/WS conventions
- services.md    — class-based service shape, BaseDbService, exception
                   discipline, integration boundaries
- tests.md       — endpoint-tests-only, conftest fixtures, fake providers,
                   stub-vs-real boundaries
- integrations.md — Docker, GitHub, ACP, SMTP, Redis ownership matrix

Frontend artifacts (docs/artifacts/frontend/):
- components.md     — React 19 patterns, primitives, contexts/providers,
                      hooks discipline, anti-patterns
- state.md          — Zustand vs context vs useState decision tree
- data-fetching.md  — TanStack Query setup, query-key factory, prefix
                      keys for cwd-scoped invalidation, mutation patterns
- styling.md        — Tailwind tokens, monochrome palette, primitives,
                      typography/icon/animation rules

Domain maps (docs/domains/):
- chat.md       — entities, message state machine, queue/send-now,
                  cross-domain edges; PRs Mng-dev-ai#592, Mng-dev-ai#593, Mng-dev-ai#594, Mng-dev-ai#560, Mng-dev-ai#419, Mng-dev-ai#251, Mng-dev-ai#454
- sandbox.md    — Docker vs Host providers, lifecycle; PRs Mng-dev-ai#590, Mng-dev-ai#588,
                  Mng-dev-ai#531, Mng-dev-ai#505, Mng-dev-ai#551, Mng-dev-ai#594
- providers.md  — ACP adapter registry, per-agent quirks, persona
                  gating; PRs Mng-dev-ai#591, Mng-dev-ai#589, Mng-dev-ai#528, Mng-dev-ai#499, Mng-dev-ai#542, Mng-dev-ai#538, Mng-dev-ai#541, Mng-dev-ai#465, Mng-dev-ai#537
- streaming.md  — StreamEnvelope, seq-based reconnection, snapshot vs
                  control events; PRs Mng-dev-ai#370, #173, #190, Mng-dev-ai#382, Mng-dev-ai#432, Mng-dev-ai#346, Mng-dev-ai#214, Mng-dev-ai#524, Mng-dev-ai#471, #192
- auth.md       — fastapi-users, refresh tokens, encrypted-at-rest,
                  WS auth handshake; PRs Mng-dev-ai#586, Mng-dev-ai#587, Mng-dev-ai#589, Mng-dev-ai#449, Mng-dev-ai#550, Mng-dev-ai#469
- git.md        — GitService surface, worktrees, ChatCheckpoint;
                  PRs Mng-dev-ai#592, Mng-dev-ai#594, Mng-dev-ai#593, Mng-dev-ai#596, Mng-dev-ai#527, Mng-dev-ai#398, Mng-dev-ai#402
- workspace.md  — workspaces, skills, personas, slash commands;
                  PRs Mng-dev-ai#598, Mng-dev-ai#597, Mng-dev-ai#596, Mng-dev-ai#506, Mng-dev-ai#510, Mng-dev-ai#537, Mng-dev-ai#542, Mng-dev-ai#561, Mng-dev-ai#414, Mng-dev-ai#464, Mng-dev-ai#476, Mng-dev-ai#563

Each prior-art PR was verified via gh pr view (state=MERGED, files
within the cited domain) before citation.

Cleanup:
- AGENTS.md: removed PR-1's "Doc status" footer; routing tables now
  point at real files. The github.md route was rolled into git.md and
  workspace.md (no separate domain map needed at current surface area).
- docs/legacy.md deleted — content now lives in the per-artifact docs
  it sourced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant