Skip to content

runtime.llm.complete cannot pass a reasoning effort, and the omitted field can hard-fail reasoning-mandatory models #108255

Closed

Description

@gorkem2020

Summary

api.runtime.llm.complete gives plugins catalog-routed completions (provider routing, auth profiles, app attribution), but the params surface has no way to request a reasoning effort. The parameter a plugin sends is structurally absent from LlmCompleteParams, so host-routed calls always reach the provider without a reasoning field. Depending on provider routing, that ranges from silent quality collapse on reasoning models to a hard request rejection.

Verified on both v2026.6.10 and v2026.7.1 (the relevant code is byte-identical across the two tags):

  • LlmCompleteParams has no reasoning or effort field (src/plugins/runtime/types-core.ts, lines 155-167 on both tags).
  • The request options are built as { maxTokens, temperature, signal } with no reasoning key (src/plugins/runtime/runtime-llm.runtime.ts, lines 438-443).
  • The delegate one layer down already supports it: completeWithPreparedSimpleCompletionModel destructures params.options.reasoning and threads it into the completion call (src/agents/simple-completion-runtime.ts, lines 394-420; v2026.7.1 even adds an OpenAI effort clamp branch there).

So the capability exists one layer below the plugin API and is simply unreachable from it.

Observed impact (live, OpenRouter, gpt-oss-120b)

  1. Silent mode: with the reasoning field absent, some provider routes return reasoning-less output. A memory-extraction plugin lane that produces 5 candidates over its own direct client produced 0 over the host transport with identical input.
  2. Loud mode: other routes reject the request outright with "Reasoning is mandatory for this endpoint and cannot be disabled." (raw request captured showing the provider-bound body).

Either way a plugin that opts into the host transport for catalog benefits currently loses reasoning control entirely.

Proposed fix (small)

  1. Add an optional reasoning (or reasoningEffort) field to LlmCompleteParams (src/plugins/runtime/types-core.ts).
  2. Forward it in the options object at src/plugins/runtime/runtime-llm.runtime.ts:438-443.

No changes needed beneath that point; simple-completion-runtime already honors options.reasoning.

Happy to open a PR if useful.

Activity

  1. added
    P2Normal backlog priority with limited blast radius.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    no-staleExclude from stale automation
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jul 16, 2026
  2. clawsweeper commented on Jul 16, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 15, 2026, 11:10 PM ET / July 16, 2026, 03:10 UTC.

    Summary
    Keep this issue open. The released plugin runtime completion API omits reasoning control while its downstream completion helper already accepts and forwards that option, leaving catalog-routed plugin calls unable to use some reasoning models reliably; no merged replacement or current-main implementation was found.

    Reproducibility: yes. at source level: call api.runtime.llm.complete for a reasoning-mandatory catalog model and observe that the public params and forwarding options cannot carry reasoning, although the immediate callee supports it. A fresh live provider run would strengthen the already detailed report.

    Next step
    The missing bridge is narrow, the owner boundary and likely files are clear, and the existing lower-level reasoning contract provides a concrete implementation target.

    Review details

    Best possible solution:

    Add an optional canonically typed reasoning field to LlmCompleteParams, forward it unchanged into the existing prepared-completion options, and cover both reasoning-mandatory and omitted-field compatibility paths in runtime tests and SDK documentation.

    Do we have a high-confidence way to reproduce the issue?

    Yes at source level: call api.runtime.llm.complete for a reasoning-mandatory catalog model and observe that the public params and forwarding options cannot carry reasoning, although the immediate callee supports it. A fresh live provider run would strengthen the already detailed report.

    Is this the best way to solve the issue?

    Yes, with one refinement: thread the repository's existing canonical reasoning type through the current API rather than adding a parallel effort representation or provider-specific workaround.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The reporter's OpenRouter failure was not independently rerun during this read-only review, so provider-specific rejection wording remains externally observed evidence rather than a fresh verification.
    • The public field name and accepted value type should reuse the existing canonical reasoning type rather than introduce a parallel plugin-only vocabulary.

    Codex review notes: model internal, reasoning high; reviewed against 957cc81175a3.

    Label changes

    Label changes:

    • add P2: The defect breaks or degrades a bounded plugin completion workflow for reasoning models, but it does not make the general OpenClaw runtime unusable.
    • add impact:auth-provider: The missing parameter changes model/provider request behavior and can cause selected reasoning endpoints to reject or silently alter completions.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P2: The defect breaks or degrades a bounded plugin completion workflow for reasoning models, but it does not make the general OpenClaw runtime unusable.
    • impact:auth-provider: The missing parameter changes model/provider request behavior and can cause selected reasoning endpoints to reject or silently alter completions.
    Evidence reviewed

    Acceptance criteria:

    • node scripts/run-vitest.mjs src/plugins/runtime/runtime-llm.runtime.test.ts
    • node scripts/check-changed.mjs -- src/plugins/runtime/types-core.ts src/plugins/runtime/runtime-llm.runtime.ts src/plugins/runtime/runtime-llm.runtime.test.ts docs/plugins/sdk-runtime.md
    • pnpm plugin-sdk:surface:check
    • git diff --check

    What I checked:

    • Public parameter gap: In v2026.7.1, LlmCompleteParams exposes completion controls such as token and temperature settings but no reasoning or effort field, matching the reported unreachable capability. (src/plugins/runtime/types-core.ts:155, 2d2ddc43d0dc)
    • Forwarding gap: The released runtime builds downstream completion options without a reasoning value, so a plugin cannot influence the provider-bound reasoning setting through this API. (src/plugins/runtime/runtime-llm.runtime.ts:438, 2d2ddc43d0dc)
    • Existing downstream support: The prepared simple-completion layer already consumes options.reasoning and forwards it through the completion path, indicating that the missing link is confined to the plugin runtime API boundary. (src/agents/simple-completion-runtime.ts:394, 2d2ddc43d0dc)
    • Current public documentation: The current plugin runtime documentation describes api.runtime.llm.complete and its model-override controls without documenting any reasoning parameter, so current main does not present an alternative supported path for plugins. Public docs: docs/plugins/sdk-runtime.md. (docs/plugins/sdk-runtime.md, 957cc81175a3)
    • Feature provenance: The runtime helper originated in the merged catalog-aware completion work in feat(plugin-sdk): add LLM completion API to plugin #64294; that history establishes the intended owner boundary as the generic plugin runtime rather than provider-specific plugin code. (src/plugins/runtime/runtime-llm.runtime.ts, 3042195ff2c1)
    • No canonical replacement: The supplied related-item search contains provider, subagent, and context-engine issues with different contracts and failure paths; none tracks this missing runtime.llm.complete reasoning field or supplies an open fix PR.

    Likely related people:

    • DaevMithran: Authored the merged work that introduced the catalog-aware runtime.llm.complete helper and its plugin runtime API surface. (role: introduced behavior; confidence: high; commits: 3042195ff2c1; files: src/plugins/runtime/types-core.ts, src/plugins/runtime/runtime-llm.runtime.ts, src/plugins/runtime/runtime-llm.runtime.test.ts)
    • jalehman: Reviewed and merged the original runtime completion API work, making them a strong routing candidate for the intended public contract. (role: reviewer and merger; confidence: high; commits: 3042195ff2c1; files: src/plugins/runtime/runtime-llm.runtime.ts, docs/plugins/sdk-runtime.md)
    • steipete: Participated in review of the original helper and is connected to subsequent runtime completion diagnostics and plugin-runtime maintenance. (role: adjacent runtime contributor; confidence: medium; commits: 3042195ff2c1; files: src/plugins/runtime/runtime-llm.runtime.ts, src/agents/simple-completion-runtime.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  3. locked as resolved and limited conversation to collaborators on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions