dsh-perplexity-api-fix-plugin
在终端中运行以下命令:
dsh plugin install Kinfxhk/dsh-perplexity-api-fix-plugin
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在 DeepSeek Harness 中执行 `dsh plugin install Kinfxhk/dsh-perplexity-api-fix-plugin` 安装本插件,源码仓库为 https://github.com/Kinfxhk/dsh-perplexity-api-fix-plugin,安装后重启 DSH 并在侧栏 Perplexity 页按需修复设定。
插件介绍
在 DeepSeek Harness 里走 Perplexity 作为模型提供商时,Claude Opus 5.5、Claude Sonnet 5.5 和 GPT-6.1 Sol 这类模型很容易因为缺少输出上限、工具名与 Perplexity 内置能力撞车、或工具 schema 不合规而直接返回 HTTP 400;provider 侧若 api、baseURL、maxTokens、reasoningEffort 等配置不完整,也会让同一路由反复失败。Perplexity Guard(套件名 @local/perplexity-guard)在每次发往所配置 provider(默认 perplexity)的请求上自动做「保路由」修正,而不是改你的对话内容。
核心能力分两层:请求层会自动补齐 maxTokens(并受剩余上下文窗口约束)、把易冲突的 DSH 工具名在链路上改为 dsh_ 前缀并在流式工具调用里还原原名、为不合规的 object schema 补上 properties 与默认描述,并移除或钳制 stop、越界 temperature、不支持的 reasoningEffort 等字段。产品层提供侧栏「Perplexity」页,展示路由与设定检查结果、最近约 40 条改写或错误记录,并支持一键 Repair settings,或通过 perplexity_guard 工具执行 status / repair,为上述三款模型补全 openai-responses、baseURL(仅缺失时默认官方地址)、maxTokens、contextWindow、reasoningEfforts 与流式空闲超时等,且不会删掉其它模型、也不会覆盖你已自定义的 baseURL。
它不会读写 API Key,也不会改写消息正文;若上游返回 finish_reason=refusal,插件只记录。适合已经在 DSH(≥ 0.2.1-rc.5)里配置了 llm-pi-ai 的 perplexity 提供商并持有 Perplexity API Key、又希望稳定用 Opus/Sonnet 5.5 或 GPT-6.1 Sol 的用户。需要留意:当请求被改写并重新进入 stream 时,若在流式过程中改了 provider 配置,该次调用可能读到新设定——这是公开中间件 API 限制下的已知行为。
使用场景
- 在 DSH 里用 Perplexity 跑 Claude Opus/Sonnet 5.5 或 GPT-6.1 Sol 时频繁 400
- Agent 带 web_search 等工具走 Perplexity 路由被内置工具名冲突拦截
- provider 缺 maxTokens、api 模式或 reasoningEffort 导致同模型无法稳定流式输出
适合人员
- 已在 DSH 配置 perplexity 提供商并持有 API Key 的用户
- 需要 Opus/Sonnet 5.5 或 GPT-6.1 Sol 走 Perplexity 路线的开发者
- 希望侧栏诊断改写记录并一键修复 provider 设定的进阶用户