-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
When implementing a memory plugin, I noticed there’s no first-class way to make a plugin-internal LLM call that is side-effect-free (doesn’t pollute session history).
Current plugin SDK exposes hooks + ctx.client, but no dedicated internal LLM primitive. Plugins currently either maintain provider adapter logic themselves, or route through session endpoints and add guard/cleanup logic.
In my WIP plugin (https://github.com/wakamex/opencode-observational-memory), I currently use worker-session orchestration (session.create + session.prompt) with recursion/cleanup guards. In supermemory (https://github.com/supermemoryai/opencode-supermemory), similar framework constraints show up in a different form (session.summarize, session.promptAsync, and compaction context injection).
Request: add a plugin API like ctx.llm.generate(...) for internal calls with:
- no transcript persistence by default
- no normal chat/event hook recursion by default
- OpenCode-native provider/model routing
- optional per-call model override (for example, Observer model != chat model)
Related plugin API discussion: #10868 (this request is narrower and focused on internal LLM execution).
If this direction is approved, I can open a small PR for ctx.llm.generate first (text-only + isolated by default), with tests for no message persistence, no chat/event hook recursion, per-call model override.