refactor(agent): disable system prompt setting #848
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
ModelLoadedToolAdded: read_fileToolAdded: write_to_fileSystemPromptSet: you are a helpful assistant.PreConversationUserMessage: helloRequestCompleted: Hi, ...PostConversationSuch history will have duplicated events when resuming from disk:
ModelLoadedToolAdded: read_fileToolAdded: write_to_fileSystemPromptSet: you are a helpful assistant.PreConversationUserMessage: helloRequestCompleted: Hi, ...PostConversationModelLoadedToolAdded: read_fileToolAdded: write_to_fileSystemPromptSet: you are a helpful assistant.Changes
This PR:
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.
Removed the existing API endpoints to set system-prompt:
POST /v1/system-promptPOST /v1/task/{id}/system-promptThese api have not yet been used in
ui, but they are used by the debug web interface. However, theGET /v1/system-promptis kept for informational functionality and testing.Does not removed the
SystemPromptSetevent. The removal ofSystemPromptSetfit more into refactor(event): remove state events #839, not here.