[feature] Custom system prompts — save, switch, and manage multiple prompt templates #923

Closed
opened 2026-06-04 11:32:57 +02:00 by sleepy · 0 comments
Owner

Feature Request

Currently there is no way for users to customize the chat system prompt. The system prompt is assembled entirely in code (src/agent/system_prompt.py + src/agent/prompt_sections.py) with no user-configurable sections.

The existing preset system (src/preset_manager.py) has a system_prompt field per preset (code_analyze, brainstorm, reason, custom), but these are preset-specific overrides for specific modes — not a general way to customize the default chat behavior.

What I Want

  1. Editable system prompt — A settings field (or dedicated UI section) where I can write/edit the system prompt that gets injected into every chat session. This should support the full system prompt or a "custom instructions" appendix appended to the built-in prompt.

  2. Save multiple templates — Ability to save named system prompt templates (e.g. "concise coder", "detailed explainer", "creative writer") and switch between them. Like presets but specifically for the system prompt/instructions.

  3. Quick switch — Dropdown or keyboard shortcut to swap between saved prompts mid-conversation without losing the chat history.

Proposed Implementation

Storage

  • New data/system_prompts.json file:
{
  "active": "default",
  "prompts": {
    "default": {
      "name": "Default",
      "instructions": "",
      "mode": "append"
    },
    "concise": {
      "name": "Concise Coder",
      "instructions": "Be extremely concise. Code-first, explanation-second.",
      "mode": "append"
    },
    "full-override": {
      "name": "Full Custom",
      "instructions": "You are a...",
      "mode": "replace"
    }
  }
}
  • mode: "append" adds the instructions to the end of the built-in system prompt
  • mode: "replace" completely replaces the system prompt (advanced)

Settings UI

  • New "System Prompt" section in Settings with a textarea editor
  • Template selector dropdown
  • Save / Save As / Delete buttons

Backend

  • New setting keys: system_prompt_template (active template name), system_prompt_instructions (inline override)
  • src/agent/system_prompt.py reads the active template and appends/replaces accordingly
  • preset_manager.py custom preset could reference a saved template by name

API

  • GET /api/auth/system-prompts — list all templates
  • POST /api/auth/system-prompts — save/update a template
  • DELETE /api/auth/system-prompts/{name} — delete a template
  • PATCH /api/auth/settings with system_prompt_template: "name" — switch active template
  • Existing preset system covers mode-specific prompts but not the default chat behavior
  • Depends on #921 (settings persistence fix) for reliable saving
## Feature Request Currently there is no way for users to customize the chat system prompt. The system prompt is assembled entirely in code (`src/agent/system_prompt.py` + `src/agent/prompt_sections.py`) with no user-configurable sections. The existing preset system (`src/preset_manager.py`) has a `system_prompt` field per preset (code_analyze, brainstorm, reason, custom), but these are **preset-specific overrides** for specific modes — not a general way to customize the default chat behavior. ## What I Want 1. **Editable system prompt** — A settings field (or dedicated UI section) where I can write/edit the system prompt that gets injected into every chat session. This should support the full system prompt or a "custom instructions" appendix appended to the built-in prompt. 2. **Save multiple templates** — Ability to save named system prompt templates (e.g. "concise coder", "detailed explainer", "creative writer") and switch between them. Like presets but specifically for the system prompt/instructions. 3. **Quick switch** — Dropdown or keyboard shortcut to swap between saved prompts mid-conversation without losing the chat history. ## Proposed Implementation ### Storage - New `data/system_prompts.json` file: ```json { "active": "default", "prompts": { "default": { "name": "Default", "instructions": "", "mode": "append" }, "concise": { "name": "Concise Coder", "instructions": "Be extremely concise. Code-first, explanation-second.", "mode": "append" }, "full-override": { "name": "Full Custom", "instructions": "You are a...", "mode": "replace" } } } ``` - `mode: "append"` adds the instructions to the end of the built-in system prompt - `mode: "replace"` completely replaces the system prompt (advanced) ### Settings UI - New "System Prompt" section in Settings with a textarea editor - Template selector dropdown - Save / Save As / Delete buttons ### Backend - New setting keys: `system_prompt_template` (active template name), `system_prompt_instructions` (inline override) - `src/agent/system_prompt.py` reads the active template and appends/replaces accordingly - `preset_manager.py` custom preset could reference a saved template by name ### API - `GET /api/auth/system-prompts` — list all templates - `POST /api/auth/system-prompts` — save/update a template - `DELETE /api/auth/system-prompts/{name}` — delete a template - `PATCH /api/auth/settings` with `system_prompt_template: "name"` — switch active template ## Related - Existing preset system covers mode-specific prompts but not the default chat behavior - Depends on #921 (settings persistence fix) for reliable saving
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/odysseus#923
No description provided.