feat: support system prompt append - #454
Open
Shuryne wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a provider-neutral “system prompt append” capability to ACP session lifecycle flows, validating client metadata and mapping the appended text onto Codex developerInstructions so the base/system prompt remains unchanged.
Changes:
- Introduces a versioned
_meta.systemPromptcapability advertisement during ACPinitialize. - Parses/validates
_meta.systemPrompt.appendand applies it tothreadStart,threadResume(resume/load), andthreadForkwhile omitting absent/blank values. - Documents the extension and adds a CLI option to exercise it in the real-Codex test runner script.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/SystemPrompt.ts | Adds the extension capability constants and the _meta.systemPrompt.append parser/validator. |
| src/SessionFork.ts | Passes validated append text through to threadFork as developerInstructions. |
| src/CodexAcpServer.ts | Advertises the capability in initialize and validates metadata early on session lifecycle routes. |
| src/CodexAcpClient.ts | Applies validated append text to Codex thread start/resume calls via developerInstructions. |
| src/tests/CodexACPAgent/system-prompt.test.ts | Adds coverage for parsing/validation and propagation to Codex calls across lifecycle routes. |
| src/tests/CodexACPAgent/initialize.test.ts | Asserts the new capability is included in the initialize response _meta. |
| README.md | Documents the new extension at the top-level feature list. |
| docs/system-prompt-extension.md | Adds detailed extension documentation and usage examples. |
| .claude/skills/run-codex/scripts/run-codex-test.ts | Adds --system-prompt-append flag and wires it into session creation for real-Codex runs. |
Suppressed comments (1)
.claude/skills/run-codex/scripts/run-codex-test.ts:165
- The
systemPromptAppend && {...}spread includes_metafor whitespace-only values, but the server treats blank/whitespace append text as unspecified. Using a trim-based condition avoids sending a no-op_metapayload while still preserving the original (untrimmed) text when present.
...(systemPromptAppend && {
_meta: {systemPrompt: {append: systemPromptAppend}},
}),
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| console.log(`Prompt: ${prompt}`); | ||
| console.log(`CWD: ${cwd}`); | ||
| console.log(`Output: ${output}`); | ||
| console.log(`System prompt append: ${systemPromptAppend ? "configured" : "none"}`); |
| if (typeof append !== "string") { | ||
| throw RequestError.invalidParams(undefined, "systemPrompt.append must be a string"); | ||
| } | ||
| if (new TextEncoder().encode(append).byteLength > SYSTEM_PROMPT_APPEND_MAX_BYTES) { |
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
Validation
Local environment note
The repository-pinned Codex 0.148 platform executable was not runnable on this macOS host, so real-Codex verification used the installed Codex 0.151 binary. Under that substitution, three existing MCP config merge tests exited during app-server initialization; all other tests passed, and this change does not touch MCP configuration.