Skip to content

Fix Claude provider dropping the CoC system message#309

Merged
plusplusoneplusplus merged 1 commit into
mainfrom
pr/bdde59f1e-fix-claude-provider-dropping-the-coc-sys
Jun 10, 2026
Merged

Fix Claude provider dropping the CoC system message#309
plusplusoneplusplus merged 1 commit into
mainfrom
pr/bdde59f1e-fix-claude-provider-dropping-the-coc-sys

Conversation

@plusplusoneplusplus

Copy link
Copy Markdown
Owner

ClaudeSDKService passed customSystemPrompt/appendSystemPrompt to
query(), but @anthropic-ai/claude-agent-sdk >= 0.1 only reads the
unified systemPrompt option and silently discards the legacy keys,
so every CoC-authored system message (ask-mode read-only
instructions, repo instructions, memory guidance) never reached
Claude and sessions ran with an explicitly empty system prompt.

Map mode 'append' to systemPrompt { type: 'preset', preset:
'claude_code', append } (Claude Code default prompt plus CoC
instructions) and mode 'replace' to a custom string systemPrompt;
blank or absent content still omits the field. Verified at the wire
level that the initialize control request now carries the appended
content, while the old shape produced systemPrompt [""] with the
instructions dropped.

Tests cover append/replace mapping, blank/absent omission, resumed
sessions, and regression assertions that the ignored legacy options
are never sent.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

ClaudeSDKService passed customSystemPrompt/appendSystemPrompt to
query(), but @anthropic-ai/claude-agent-sdk >= 0.1 only reads the
unified systemPrompt option and silently discards the legacy keys,
so every CoC-authored system message (ask-mode read-only
instructions, repo instructions, memory guidance) never reached
Claude and sessions ran with an explicitly empty system prompt.

Map mode 'append' to systemPrompt { type: 'preset', preset:
'claude_code', append } (Claude Code default prompt plus CoC
instructions) and mode 'replace' to a custom string systemPrompt;
blank or absent content still omits the field. Verified at the wire
level that the initialize control request now carries the appended
content, while the old shape produced systemPrompt [""] with the
instructions dropped.

Tests cover append/replace mapping, blank/absent omission, resumed
sessions, and regression assertions that the ignored legacy options
are never sent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@plusplusoneplusplus plusplusoneplusplus merged commit 50ee20b into main Jun 10, 2026
36 checks passed
@plusplusoneplusplus plusplusoneplusplus deleted the pr/bdde59f1e-fix-claude-provider-dropping-the-coc-sys branch June 10, 2026 06:09
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.

1 participant