WASD258-jpg/dsh-preset-force0

@wasd258/dsh-preset-force

Force-switch the agent preset (mode) of a DSH session after it has started, bypassing the blank-only lock. 会话模式强切插件:绕过「仅空白会话可切换」锁定,随时强制切换当前会话的模式。

AI Analysis

允许在已有历史记录的活跃会话中随时强制切换智能体预设(模式),即时更换工具集与提示词。适合需要在复杂对话中途灵活调整模型能力的开发与调试任务。

Package
@wasd258/dsh-preset-force
Version
0.1.2
License
NOASSERTION
Last updated
Aug 15, 2026

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗

Usage

/preset command

Type it in the composer input. With no argument (/preset, /preset list, /preset ls, /preset ?) it prints the current mode and the full roster:

当前模式:standard(标准模式)
可用模式:
  minimal(极简模式)
  standard(标准模式) ← 当前
  code(代码模式)
  cordis(创造模式)
  my-custom(我的自定义模式)

用法:/preset  —— 强制切换当前会话的模式(不要求会话为空,工具集立即更换)

The host emits these strings in Chinese: first line = current mode ((未加入 preset) when none), rows = (display name), ← 当前 marks the active one, [损坏: ...] a broken preset; last line = usage hint.

With an argument:

> /preset code          # switch
已强制切换当前会话模式:standard → code。模型可见的工具与提示词已更换;已产生的历史记录保持原样。
> /preset code          # already on target
当前会话已经是模式 code。
> /preset bogus         # failure
切换失败:

The success line reads: "Force-switched this session's mode: standardcode. The model-visible tools and prompts have been replaced; existing history is left as-is."

set_agent_preset tool

The model calls it on your behalf; visible under every preset (the tool registry resolves agent → preset → global).

ParameterTypeRequiredDescription
presetstringyesTarget preset id (standard / minimal / code / cordis, or a locally authored id); pass "" to list available ids
{ "preset": "code" }   // → { "ok": true, "from": "standard", "to": "code" }
{ "preset": "" }       // → { "ok": true, "unchanged": true, "available": [ { "id": "minimal", "name": "极简模式" }, ... ] }
// subagent call       // → { "ok": false, "error": "set_agent_preset 只能切换顶层会话的模式,子代理不可切换。" }

Result shape: { ok, from?, to?, unchanged?, available?, error? }.

Composer tool-row dropdown

A compact selector in the input tool row (conversation.input.right slot, order 10, label "模式切换"), next to the model picker:

  1. Open it — every available mode is listed as name (id).
  2. Pick one; the session switches immediately.
  3. On failure a browser alert shows the reason and the selection snaps back.

It polls /status every 5 seconds (changes from any entry point are reflected) and is disabled while a switch is in flight, when the session is not live, or when no presets are installed (a single disabled "模式" entry).