opencode
opencode copied to clipboard
noReply property not being respected in client.session.prompt call
Description
Setting noReply: true is not preventing the AI from responding to prompts sent via the session.prompt SDK method.
I was expecting the call to session.prompt with noReply: true to insert the payload into the session context without triggering an assistant response. As shown in the screenshot, the assistant is automatically responding.
I've tested with a simple plugin -
import { type Plugin, tool } from "@opencode-ai/plugin";
export const PromptTestPlugin: Plugin = async ({ client }) => {
return {
tool: {
prompt_test: tool({
description: "Prompt test",
args: {},
async execute(_args, ctx) {
await client.session.prompt({
path: { id: ctx.sessionID },
body: {
noReply: true,
parts: [
{
type: "text",
text: "Hello, world!",
},
],
},
});
return "";
},
}),
},
};
};
OpenCode version
1.0.218
Steps to reproduce
- Install the test plugin shown above.
- Start a new Opencode TUI session.
- Ask the assistant to call the
prompt_testtool.
At this point you should see Hello, world! output as a user message in the TUI. The assistant will then reply, as if the message had been typed directly.
Screenshot and/or share link
Operating System
Arch Linux
Terminal
Ghostty