This commit is contained in:
h z
2026-04-12 14:05:56 +01:00
parent 9cd90f7213
commit 49af2129ae

View File

@@ -17,7 +17,8 @@ export type OpenAITool = {
export type ClaudeDispatchOptions = { export type ClaudeDispatchOptions = {
prompt: string; prompt: string;
/** System prompt passed via --system-prompt on every invocation (stateless, not stored in session) */ /** Appended to Claude Code's built-in system prompt via --append-system-prompt on every invocation.
* Stateless: not persisted in session file, fully replaces any prior appended content on resume. */
systemPrompt?: string; systemPrompt?: string;
workspace: string; workspace: string;
agentId?: string; agentId?: string;
@@ -115,11 +116,12 @@ export async function* dispatchToClaude(
"--dangerously-skip-permissions", "--dangerously-skip-permissions",
]; ];
// --system-prompt is stateless (not persisted in session file) and fully // --append-system-prompt appends to Claude Code's built-in system prompt rather
// replaces any prior system prompt on each invocation, including resumes. // than replacing it, preserving the full agent SDK instructions (tool use behavior,
// We pass it every turn so skills/persona stay current. // memory management, etc.). The appended bootstrap (persona + skills) is stateless:
// not persisted in the session file, takes effect every invocation including resumes.
if (systemPrompt) { if (systemPrompt) {
args.push("--system-prompt", systemPrompt); args.push("--append-system-prompt", systemPrompt);
} }
if (resumeSessionId) { if (resumeSessionId) {