Skip to content

Conversation

@tonyfettes
Copy link
Contributor

@tonyfettes tonyfettes commented Dec 16, 2025

Motivation

As mentioned in PR #839, events on fixed system attribute will be duplicated, if #787 is introduced. Specifically, this means if we have a event history below:

  • ModelLoaded
  • ToolAdded: read_file
  • ToolAdded: write_to_file
  • SystemPromptSet: you are a helpful assistant.
  • PreConversation
  • UserMessage: hello
  • RequestCompleted: Hi, ...
  • PostConversation

Such history will have duplicated events when resuming from disk:

  • (old) ModelLoaded
  • (old) ToolAdded: read_file
  • (old) ToolAdded: write_to_file
  • (old) SystemPromptSet: you are a helpful assistant.
  • (old) PreConversation
  • (old) UserMessage: hello
  • (old) RequestCompleted: Hi, ...
  • (old) PostConversation
  • (new) ModelLoaded
  • (new) ToolAdded: read_file
  • (new) ToolAdded: write_to_file
  • (new) SystemPromptSet: you are a helpful assistant.

Changes

This PR:

  1. Restructured the code so that the system prompt is fixed after the agent is created, and not changed afterward. This holds true even in refactor(conversation): support resuming all events #787, meaning that even if a conversation is resumed, the system prompt is still the original one that the agent is created with, and cannot be changed.

  2. Removed the existing API endpoints to set system-prompt:

    • Server: POST /v1/system-prompt
    • Daemon: POST /v1/task/{id}/system-prompt

    These api have not yet been used in ui, but they are used by the debug web interface. However, the GET /v1/system-prompt is kept for informational functionality and testing.

  3. Does not removed the SystemPromptSet event. The removal of SystemPromptSet fit more into refactor(event): remove state events #839, not here.

@tonyfettes tonyfettes force-pushed the haoxiang/disable-system-prompt-setting branch 3 times, most recently from 0125469 to 9e04e15 Compare December 16, 2025 06:29
@tonyfettes tonyfettes force-pushed the haoxiang/disable-system-prompt-setting branch from 9e04e15 to 8343f0d Compare December 16, 2025 09:53
@tonyfettes tonyfettes closed this Dec 17, 2025
@tonyfettes
Copy link
Contributor Author

Closed, because we think it is ok for user to change the system prompt during the conversation. However, we think we should get rid of the SystemPromptSet event because storing multiple SystemPromptSet is expensive, because system prompt are very likely to be pretty long.

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.

2 participants