メインコンテンツへスキップ
D

dsh-max-reasoning-effort

devzer0o0/dsh-max-reasoning-effort

Pins reasoning effort to the highest level every model offers, and keeps it pinned for agents created after the plugin loads.

インストール

dsh plugin --profile web add github:devzer0o0/dsh-max-reasoning-effort

README

dsh-max-reasoning-effort

A Host-only DeepSeek Harness plugin. While it is installed and enabled, every session runs at Max reasoning effort, whichever model you pick — in the Web picker, from an ACP client, through the SDK, or in a headless run.

What it actually does

Each request carries a reasoningEffort that comes from the session's durable model selection. The plugin rewrites that selection at the one point every entry point funnels through — agent.model.select(...) on the live Agent — so the appended model/selection event always names the pinned level, and the next request is built from it.

It also pins the selection once when an Agent is announced, which covers:

  • new sessions,
  • resumed sessions whose recorded selection lacks the level,
  • a model switch that arrives with the model's own default effort.

The pin survives a model switch: choosing a different model re-runs the same coercion, so the effort stays at Max.

Behaviour on models that cannot do Max

The plugin asks the LLM runtime what each model advertises and adapts:

model advertiseseffort used
max among its levelsmax
only lower levelsits highest level
no reasoning supportnone (the field is dropped)
not resolved yet / unknownmax right away, corrected when the lookup lands

Dropping the field for non-reasoning models matters: an explicit effort there is rejected with UNSUPPORTED_REASONING_EFFORT before any provider I/O.

Compatibility

Built and verified against DeepSeek Harness 0.2.2-rc.3 (engines.dsh: >=0.2.0). The seam this plugin depends on is still the same one the host uses itself:

  • dsh-agent: AgentModel.current() / AgentModel.select({ provider, model, reasoningEffort }), and ctx.agents.list() for the Agents that already exist;
  • dsh-agent-loop: the loop snapshots this.model.current() once per step before agent/pre-step and rejects any agent/request that proposes a different effort;
  • dsh-llm: llm.resolveModelInfo(provider, model) returns reasoning.efforts[].id, which is what the fallback picks from;
  • agent/created / agent/disposed on ctx.agents, and llm/adapters-updated as the adapter catalog's announcement.

Two checks keep that honest: npm test drives apply() through every branch with a stub context, and the release was additionally loaded into the host's own cordis 4.1.0 runtime (extracted from the app bundle) with stubbed agents/llm services.

Tests

npm test     # node:test, no dependencies, no network
npm run check   # node --check index.js && npm test

Configuration

The insert in cordis.patch.yml takes:

- insert:
    - id: max-reasoning-effort
      name: dsh-max-reasoning-effort
      config:
        enabled: true   # false: keep the plugin loaded, stop pinning
        effort: max     # preferred level; falls back to the model's highest

Changing the module code needs a Host restart; changing config in the profile's cordis.patch.yml is picked up by the Loader.

What it does not touch

  • Not the stored default model setting. agentDefaultModel keeps whatever the picker saved, so Settings → default model can still show the model's own default effort while every session actually runs at Max.
  • Not the request body. No temperature, token budget, prompt, or tool changes.
  • Not models or providers. It never switches models; it only sets the effort on the selection that was already made.

Notes

  • Nothing else in this profile rewrites reasoningEffort: dsh-fast-mode returns agent/request results untouched since 1.7.0, and @feiyu999/dsh-prompt-optimizer only hooks agent/pre-step. Forcing the effort therefore cannot collide.

関連プラグイン