Add session-meta parameter for system prompt customization#283
Open
ElleNajt wants to merge 1 commit intoxenodium:mainfrom
Open
Add session-meta parameter for system prompt customization#283ElleNajt wants to merge 1 commit intoxenodium:mainfrom
ElleNajt wants to merge 1 commit intoxenodium:mainfrom
Conversation
Add :session-meta parameter to agent-shell-start and related functions,
allowing callers to pass metadata when creating ACP sessions. This
enables customizing the system prompt by appending to the default.
Example usage:
(agent-shell-start
:config (agent-shell--resolve-preferred-config)
:session-meta '((systemPrompt . ((append . "Custom instructions...")))))
Or set it on an existing buffer before first prompt:
(map-put! agent-shell--state :session-meta
'((systemPrompt . ((append . "Instructions here")))))
Requires acp.el with :meta parameter support (merged in PR xenodium#13).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
|
I'm wondering how to scale this a bit better, so we don't keep injecting parameters every time we watn to customize a request. I'm thinking perhaps we can use request-decorating functions that receive and return a request, giving you the opportunity to customize the request before it's sent out. Lemme think a bit more about this. Would a solution along these lines work for your purpose? |
Contributor
Author
|
Yeah that would be good! Mostly I just want to be able to pass other parameters to claude-code-acp. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add
:session-metaparameter toagent-shell-startand related functions, allowing callers to pass metadata when creating ACP sessions. This enables customizing the system prompt by appending to the default, which is useful for multi-agent systems where certain agents need persistent instructions that survive context compaction.Changes
:session-metaparameter toagent-shell--make-state:session-metaparameter toagent-shell-startandagent-shell--startacp-make-session-new-requestwhen creating the sessionExample Usage
Or set it on an existing buffer before the first prompt:
Use Case
This is useful for building systems like meta-agent-shell where "dispatcher" agents need persistent instructions. Previously, instructions sent as user messages would be lost on context compaction. With session-meta, they're appended to the system prompt and persist.
Dependencies
Requires acp.el with
:metaparameter support (merged in xenodium/acp.el#13).