opencode icon indicating copy to clipboard operation
opencode copied to clipboard

noReply property not being respected in client.session.prompt call

Open rmhubbert opened this issue 2 weeks ago • 1 comments

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

  1. Install the test plugin shown above.
  2. Start a new Opencode TUI session.
  3. Ask the assistant to call the prompt_test tool.

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

Image

Operating System

Arch Linux

Terminal

Ghostty

rmhubbert avatar Dec 31 '25 06:12 rmhubbert