Skip to content

Add session-meta parameter for system prompt customization#283

Open
ElleNajt wants to merge 1 commit intoxenodium:mainfrom
ElleNajt:add-session-meta
Open

Add session-meta parameter for system prompt customization#283
ElleNajt wants to merge 1 commit intoxenodium:mainfrom
ElleNajt:add-session-meta

Conversation

@ElleNajt
Copy link
Contributor

Summary

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, which is useful for multi-agent systems where certain agents need persistent instructions that survive context compaction.

Changes

  • Added :session-meta parameter to agent-shell--make-state
  • Added :session-meta parameter to agent-shell-start and agent-shell--start
  • Store session-meta in buffer-local state
  • Pass it to acp-make-session-new-request when creating the session

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 the first prompt:

(map-put! agent-shell--state :session-meta
          '((systemPrompt . ((append . "Instructions here")))))

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 :meta parameter support (merged in xenodium/acp.el#13).

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>
@ElleNajt ElleNajt marked this pull request as ready for review February 12, 2026 18:49
@xenodium
Copy link
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?

@ElleNajt
Copy link
Contributor Author

Yeah that would be good! Mostly I just want to be able to pass other parameters to claude-code-acp.

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