GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [FEATURE]: Add systemPrompt option to SDK like Claude Agent SDK · Issue #7351 · anomalyco/opencode Closed as not planned DescriptionFeature hasn't been suggested before.
Describe the enhancement you want to requestSummaryAdd a BackgroundThe Claude Agent SDK provides flexible system prompt customization through the // Option 1: Complete replacement with custom prompt for await (const message of query({ prompt: "Help me write code", options: { systemPrompt: "You are a Python specialist...", }, })) { console.log(message); } // Option 2: Use preset with append for await (const message of query({ prompt: "Help me write code", options: { systemPrompt: { type: "preset", preset: "claude_code", append: "Always include docstrings and type hints.", }, }, })) { console.log(message); } Current OpenCode SDK LimitationCurrently, the OpenCode SDK does not provide a direct way to modify the system prompt. Available workarounds include:
None of these provide the flexibility of directly setting Proposed APIimport { createOpencode } from "@opencode-ai/sdk"; const { client } = await createOpencode(); // Option 1: Direct system prompt replacement const session = await client.session.create({ body: { title: "My session", systemPrompt: "You are a specialized assistant for..." }, }); // Option 2: Append to default system prompt const session = await client.session.create({ body: { title: "My session", systemPrompt: { type: "preset", preset: "default", append: "Additional instructions here..." } }, }); // Option 3: Per-prompt system prompt override await client.session.prompt({ path: { id: session.id }, body: { systemPrompt: "Custom system prompt for this interaction", parts: [{ type: "text", text: "Hello!" }], }, }); Benefits
Related Issues
This feature would address many of the concerns raised in these issues from an SDK perspective. Reacted by jinyang, Tom, Chris Yang, Gary Thung, Filip Sobol, Raúl Fernández Fernández, Ashu, ZheNing Hu and Mohammad Hosein Bahmani Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |