mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[GH-ISSUE #300] [Bug]: Custom system prompts saved via Prompts section are not applied to sessions #96
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
System Configuration
2ec8ef3)Logs and Artifacts
No response
Screenshots or Recordings
No response
Verification