[GH-ISSUE #300] [Bug]: Custom system prompts saved via Prompts section are not applied to sessions #96

Closed
opened 2026-06-06 22:09:06 -04:00 by yindo · 0 comments
Owner

Originally created by @jakgeg009 on GitHub (May 6, 2026).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/300

Originally assigned to: @asdek on GitHub.

Affected Component

Core Services (Frontend UI/Backend API)

Describe the bug

Custom system prompts edited and saved through the UI under Prompts in Settings are stored to the database and show a "Custom" badge once edited, but they are never actually used. New assistant and flow sessions continue to use the default system prompts, as verified through the Langfuse traces. Custom prompts saved through the UI should be loaded from the database and used when rendering system prompts for new sessions.

Looking at the source code, all four session creation paths in the controller always use the default prompter:
NewAssistantWorker in backend/pkg/controller/assistant.go
LoadAssistantWorker in backend/pkg/controller/assistant.go
NewFlowWorker in backend/pkg/controller/flow.go
LoadFlowWorker in backend/pkg/controller/flow.go

Each one has:
prompter := templates.NewDefaultPrompter() // TODO: change to flow prompter by userID from DB

NewDefaultPrompter() reads from the templates compiled into the binary, so the default system prompts are always used regardless of any UI customization. The UI correctly saves custom prompts to the database, but the controller never reads them back. I understand the TODO comment acknowledges this is incomplete, but the UI presents prompt customization as a fully functional feature. Prompts can be edited, validated, and saved with a "Custom" badge, with no indication that the changes won't take effect. It's only after investigating via Langfuse traces and looking at the source code that you realize the custom prompts are never applied.

Expected Behavior:
When a user customizes a system prompt through the Prompts UI, new assistant and flow sessions should use the custom prompt instead of the default one. The controller should query the database for user-customized prompts when creating new sessions, falling back to the defaults only when no customizations are found.

Thank you for looking into this. Apologies if I'm missing a configuration step or misunderstanding how custom prompts are intended to work.

Steps to Reproduce

  1. In the UI, edit one of the system prompts in the Prompts section under Settings (e.g., the Assistant agent's system prompt)
  2. Validate and Save Change. Validation passes, and "Custom" badge appears
  3. Create a new flow or assistant session and send a message
  4. Check the Langfuse trace for the session: Input --> messages --> where role is "system", the content field shows the default system prompt, not the custom version, and clearly the assistant doesn't follow the custom instructions.

System Configuration

  • PentAGI v2.0.0 (commit 2ec8ef3)
  • Provider: Anthropic (Claude)

Logs and Artifacts

No response

Screenshots or Recordings

No response

Verification

  • I have checked that this issue hasn't been already reported
  • I have provided all relevant configuration files (with sensitive data removed)
  • I have included relevant logs and error messages
  • I am running the latest version of PentAGI
Originally created by @jakgeg009 on GitHub (May 6, 2026). Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/300 Originally assigned to: @asdek on GitHub. ### Affected Component Core Services (Frontend UI/Backend API) ### Describe the bug Custom system prompts edited and saved through the UI under Prompts in Settings are stored to the database and show a "Custom" badge once edited, but they are never actually used. New assistant and flow sessions continue to use the default system prompts, as verified through the Langfuse traces. Custom prompts saved through the UI should be loaded from the database and used when rendering system prompts for new sessions. Looking at the source code, all four session creation paths in the controller always use the default prompter: NewAssistantWorker in backend/pkg/controller/assistant.go LoadAssistantWorker in backend/pkg/controller/assistant.go NewFlowWorker in backend/pkg/controller/flow.go LoadFlowWorker in backend/pkg/controller/flow.go **Each one has:** prompter := templates.NewDefaultPrompter() // TODO: change to flow prompter by userID from DB NewDefaultPrompter() reads from the templates compiled into the binary, so the default system prompts are always used regardless of any UI customization. The UI correctly saves custom prompts to the database, but the controller never reads them back. I understand the TODO comment acknowledges this is incomplete, but the UI presents prompt customization as a fully functional feature. Prompts can be edited, validated, and saved with a "Custom" badge, with no indication that the changes won't take effect. It's only after investigating via Langfuse traces and looking at the source code that you realize the custom prompts are never applied. **Expected Behavior:** When a user customizes a system prompt through the Prompts UI, new assistant and flow sessions should use the custom prompt instead of the default one. The controller should query the database for user-customized prompts when creating new sessions, falling back to the defaults only when no customizations are found. Thank you for looking into this. Apologies if I'm missing a configuration step or misunderstanding how custom prompts are intended to work. ### Steps to Reproduce 1. In the UI, edit one of the system prompts in the Prompts section under Settings (e.g., the Assistant agent's system prompt) 2. Validate and Save Change. Validation passes, and "Custom" badge appears 3. Create a new flow or assistant session and send a message 4. Check the Langfuse trace for the session: Input --> messages --> where role is "system", the content field shows the default system prompt, not the custom version, and clearly the assistant doesn't follow the custom instructions. ### System Configuration - PentAGI v2.0.0 (commit 2ec8ef3) - Provider: Anthropic (Claude) ### Logs and Artifacts _No response_ ### Screenshots or Recordings _No response_ ### Verification - [x] I have checked that this issue hasn't been already reported - [x] I have provided all relevant configuration files (with sensitive data removed) - [x] I have included relevant logs and error messages - [x] I am running the latest version of PentAGI
yindo added the bug label 2026-06-06 22:09:06 -04:00
yindo closed this issue 2026-06-06 22:09:06 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#96