Skip to content

v2 session.prompt dropped system and noReply #48345

Closed

Description

@remorses

Description

v1 session.promptAsync let a harness pass a per-request system prompt and a silent context message:

await client.session.promptAsync({
  sessionID,
  parts: [{ type: 'text', text: userText }],
  system: 'You are running in Discord via kimaki.dev.',
  noReply: true,
})

v2 session.prompt / session.command only take text, files, delivery. There is no system and no noReply.

Kimaki has to dump the system prompt to a file and have a plugin copy it into ctx.session.hook('context'). Silent context (a user message that should not start a turn) has no replacement.

Please add system?: string and noReply?: boolean back on session.prompt and session.command, same as v1 promptAsync.

Plugins

None required. This is the v2 client / serve API.

OpenCode version

@opencode-ai/client / @opencode-ai/cli 0.0.0-beta-19271

Steps to reproduce

  1. Call v2 session.prompt({ sessionID, text }).
  2. There is no field to attach a session system prompt or a no-reply context message.
  3. Compare with v1 session.promptAsync({ system, noReply, parts }).

Screenshot and/or share link

N/A

Operating System

macOS

Terminal

N/A, SDK client

Activity

  1. remorses commented on Sep 10, 2026

    @remorses
    ContributorAuthor

    while waiting for system on prompt/command, i tried session.instructions.entry.put as the replacement.

    that api is capped at 8kb (InstructionEntry.MaxValueBytes in https://github.com/anomalyco/opencode/blob/v2/packages/schema/src/instruction-entry.ts, from #36254). over that it 413s with InstructionEntryValueTooLargeError. no truncate.

    that limit does not make sense as a stand-in for v1 system.

    v1 promptAsync({ system }) took a full session system prompt. kimaki's is tens of kb: discord routing, slash commands, shell extra fields, session ids. AGENTS.md / skill files already inject large instruction text through discovery. hashing and blob storage in #36254 already handle arbitrary json values. an 8kb wall only on the public PUT is an artificial client limit, not a storage one.

    please remove MaxValueBytes (or raise it to something that can actually hold a session system prompt). otherwise entry.put cannot replace system, and every harness has to invent a side channel (file, sqlite, plugin hook) to do what v1 did in one field.

    still want system / noReply on session.prompt and session.command as the real fix. dropping the 8kb cap is the workaround so entry.put after session.create can hold the same text until then.

  2. opencode-agent commented on Sep 10, 2026

    @opencode-agent
    Contributor

    These behaviors are available through separate V2 APIs:

    // Admit a normal user message without starting the agent loop.
    await client.session.prompt({
      sessionID,
      text: userText,
      resume: false,
    })
    
    // Admit model-visible synthetic context without starting the agent loop.
    await client.session.synthetic({
      sessionID,
      text: context,
      resume: false,
    })
    
    // Attach durable, session-scoped system instructions.
    await client.session.instructions.entry.put({
      sessionID,
      key: "kimaki",
      value: system,
    })

    resume: false is the V2 equivalent of admitting input without requesting a reply. Instruction-entry changes apply at the next step boundary. The 8 KiB limit is per entry; larger instruction sets can be split across stable keys such as kimaki.000, kimaki.001, etc.

    session.command immediately executes a slash-command callback rather than admitting a prompt, so prompt admission and system context are handled through the APIs above.

    Closing as covered by the current V2 API.

  3. nexxeln commented on Sep 10, 2026

    @nexxeln
    Contributor

    looking into the limit thing

  4. nexxeln commented on Sep 10, 2026

    @nexxeln
    Contributor

    raised the limit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions