Skip to content

[FEATURE]: Plugin-safe raw text generation #39243

Closed as not planned
Closed as not planned

Description

@CarmeloCampos

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

Plugins that need a small isolated model call currently have to use client.session.prompt(). That creates a session and runs the normal agent pipeline, adding base prompts, project instructions, tools and context. A plugin-safe raw generation API should reuse OpenCode's provider authentication and model configuration while sending only an explicit system prompt and user prompt.

Suggested contract:

await client.experimental.generateText({
  query: { directory },
  body: {
    model: { providerID, modelID, variant },
    system: "You are a professional translator. Output only the translation.",
    prompt: "Translate this text...",
    temperature: 0,
    maxOutputTokens: 2048,
  },
})

Requirements:

  • Reuse existing provider resolution, API keys, OAuth, endpoints, variants, retries and timeouts.
  • Exclude session history, agent prompts, project instructions, tools, skills, MCP context and plugin system transforms unless explicitly requested.
  • Do not create or persist sessions/messages.
  • Do not expose credential material to plugins.
  • Return generated text, usage and typed provider errors.

This would let translation and similar plugins make a minimal model request without requiring duplicate credentials or paying for unrelated OpenCode context.

Activity

  1. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The issue appears to be a feature request but does not use the feature request template. The title should start with [FEATURE]: and the issue body should include the verification checkbox confirming this hasn't been suggested before.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. changed the title [-]Expose plugin-safe raw text generation using OpenCode provider auth[/-] [+][FEATURE]: Plugin-safe raw text generation[/+] on Jul 28, 2026
  3. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! Everything looks good now. We appreciate the clear description and the well-thought-out API contract.

  4. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions