Skip to content

Add support for appending or overriding the system prompt - #91

Merged
benbrandt merged 2 commits into
agentclientprotocol:mainfrom
WhiskeyJack96:main
Oct 15, 2025
Merged

benbrandt merged 2 commits into
agentclientprotocol:mainfrom
WhiskeyJack96:main

Conversation

@WhiskeyJack96

@WhiskeyJack96 WhiskeyJack96 commented Oct 11, 2025 •

Copy link
Copy Markdown
Contributor

resolves #90

Tested both the append and override flows by sending:

const resp = await this.connection.newSession({
			cwd: basePath,
			_meta: {
				systemPrompt: "you are an obsidian assistant agent, you should be helpful to the user when working with their notes"
			},
			mcpServers: []
		});
const resp = await this.connection.newSession({
			cwd: basePath,
			_meta: {
				systemPrompt: {
					append: "always speak in spanish"
				}
			},
			mcpServers: []
		});

and confirmed that in both cases those prompts are what gets sent to the agent!

@cla-bot

cla-bot Bot commented Oct 11, 2025

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @WhiskeyJack96 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@WhiskeyJack96

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Oct 11, 2025
@cla-bot

cla-bot Bot commented Oct 11, 2025

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

Comment thread src/acp-agent.ts Outdated

let systemPrompt: Options["systemPrompt"] = { type: "preset", preset: "claude_code" }
if (params._meta?.systemPrompt){
if (typeof params._meta.systemPrompt === "string") {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typescript isnt my strong suit, so if theres a more idiomatic way to handle the union disambiguation I'm happy to give it a go!

@benbrandt

Copy link
Copy Markdown
Member

@WhiskeyJack96 this looks great! I made the checks slightly stricter to be safe, but otherwise it makes sense to me!

@benbrandt
benbrandt merged commit ea796f3 into agentclientprotocol:main Oct 15, 2025
1 check passed
AObuchow pushed a commit to AObuchow/claude-code-acp that referenced this pull request Jan 12, 2026
…tprotocol#91)

resolves agentclientprotocol#90 

Tested both the `append` and `override` flows by sending:
```javascript
const resp = await this.connection.newSession({
			cwd: basePath,
			_meta: {
				systemPrompt: "you are an obsidian assistant agent, you should be helpful to the user when working with their notes"
			},
			mcpServers: []
		});
```

```javascript
const resp = await this.connection.newSession({
			cwd: basePath,
			_meta: {
				systemPrompt: {
					append: "always speak in spanish"
				}
			},
			mcpServers: []
		});
```

and confirmed that in both cases those prompts are what gets sent to the
agent!

---------

Co-authored-by: Ben Brandt <[email protected]>
KUKUShuang pushed a commit to KUKUShuang/claude-code-acp that referenced this pull request Feb 11, 2026
Vercantez added a commit to Vercantez/acpx that referenced this pull request Apr 7, 2026
…P _meta

Adds global flags --system-prompt <text> and --append-system-prompt <text>
that forward through ACP session/new _meta.systemPrompt, using the shape
landed in agentclientprotocol/claude-agent-acp#91:

  _meta.systemPrompt = "..."                 # replace
  _meta.systemPrompt = { append: "..." }     # append

The value is persisted in session_options.system_prompt so
acpx claude sessions ensure / reuse flows keep the override, and rides
alongside the existing claudeCode options in _meta. Codex and other
agents ignore the field.

Mutual exclusion between the two flags is enforced at resolve time.
steipete pushed a commit to Vercantez/acpx that referenced this pull request Apr 25, 2026
…P _meta

Adds global flags --system-prompt <text> and --append-system-prompt <text>
that forward through ACP session/new _meta.systemPrompt, using the shape
landed in agentclientprotocol/claude-agent-acp#91:

  _meta.systemPrompt = "..."                 # replace
  _meta.systemPrompt = { append: "..." }     # append

The value is persisted in session_options.system_prompt so
acpx claude sessions ensure / reuse flows keep the override, and rides
alongside the existing claudeCode options in _meta. Codex and other
agents ignore the field.

Mutual exclusion between the two flags is enforced at resolve time.
steipete pushed a commit to Vercantez/acpx that referenced this pull request Apr 25, 2026
…P _meta

Adds global flags --system-prompt <text> and --append-system-prompt <text>
that forward through ACP session/new _meta.systemPrompt, using the shape
landed in agentclientprotocol/claude-agent-acp#91:

  _meta.systemPrompt = "..."                 # replace
  _meta.systemPrompt = { append: "..." }     # append

The value is persisted in session_options.system_prompt so
acpx claude sessions ensure / reuse flows keep the override, and rides
alongside the existing claudeCode options in _meta. Codex and other
agents ignore the field.

Mutual exclusion between the two flags is enforced at resolve time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support overriding the system prompt

2 participants