Repository navigation
fix(dsh): document the strict-mode switch for custom Responses providers - #2998
Merged
knqiufan merged 1 commit intoDec 3, 2026
Merged
Conversation
A custom llm-pi-ai provider with api: openai-responses sends function tools without a strict field. OpenAI then applies strict mode and fails requests that carry the PowerContext MCP tool definitions with server_error. Document compat.supportsStrictMode in both locales, add it to the gateway provider example, and cover the wire result with a real-host runtime test. Closes oceanbase#2996 Co-Authored-By: Claude <noreply@anthropic.com>
jasper-yl
requested review from
PsiACE,
hidb4ai,
knqiufan and
zhanghuidinah
as code owners
December 3, 2026 06:40
frf12
approved these changes
Dec 3, 2026
frf12
left a comment
Member
There was a problem hiding this comment.
The documented provider setting preserves the MCP schemas while explicitly sending strict: false, and the runtime regression checks that behavior. No blocking issues found. The remaining CI checks should pass before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue or RFC does this PR close?
Closes #2996.
Rationale for this change
With the PowerContext plugin loaded in DeepSeek Harness, every request through a custom
llm-pi-aiprovider withapi: openai-responsesfails withserver_error.Cause: for a custom provider, pi-ai's
openai-responsesadapter defaultssupportsStrictModetofalseand then omits thestrictfield on function tools. OpenAI applies strict mode to a function tool that omits the field and fails on the 63 MCP tool schemas (129anyOfnodes). Models that DSH serves from its installed catalog, such as the built-inopenaiprovider, enable the switch and already sendstrict: false, so they are not affected.The plugin cannot change the tool definitions DSH puts on the wire: the hooks it can reach are
llm/stream(no compat access) andllm-pi-ai/request-headers(headers only), and the adapter maps tools to{name, description, parameters}. The schema-preserving fix is therefore the provider switch that @frf12 pointed to:compat.supportsStrictMode: true, at provider or model level. With it, DSH sends every function tool withstrict: falseand the schema unchanged.What changes are included in this PR?
docs/{en,zh}/docs/integrations/dsh.md: a new section, "Use a custom Responses API provider", with the symptom, the switch, and which providers need it.tests/runtime/runtime.test.mjs: a real-host regression test. With a custom Responses provider that sets the switch, real DSH and a real Server, everymcp__powercontext__*tool reaches the model endpoint withstrict: falseandparametersdeep-equal to the Server's MCPinputSchema.fixture.mjsanswers the Responses API for this scenario and accepts extra patch rows and a provider/model override.No plugin or Server code changes.
Are there any user-facing changes?
Documentation only. Users of a custom Responses provider must add
compat.supportsStrictMode: true; a profile without it keeps failing. Sendingstrict: falseby default for custom Responses providers would have to change in DSH / pi-ai.How was this change tested?
Original setup from the issue (DSH
0.2.2-rc.5, pi-ai 1.7.0, headless profile,gpt-4.1-minion api.openai.com, plugin and Server from master9e40f8996), requests captured through a logging proxy:server_error)strictabsentcompat.supportsStrictMode: trueon the providerstrict: false, 129anyOfkeptmcp__powercontext__get_scopeopenaicatalog provider, no switchstrict: falseReplaying the request body captured for the issue: as sent fails 2 of 2; with
strict: falseon every tool passes 4 of 4; withstrict: falseon the MCP tools only passes 2 of 2.Automated:
pnpm --dir integrations/dsh/plugins/powercontext test:e2e:runtime: 20 of 20 pass, including the new test. The new test fails when the switch is removed from its provider. The pinned runtime (DSH0.1.2-rc.1, pi-ai 0.84.4) has the same switch behavior as 0.2.2.make docs-test: passes.uv run prek run --files <changed files>: passes.Not run: the gateway route end to end with the switch. That the gateway forwards tool definitions unchanged is from reading
pc-gateway-protocol(tools: Vec<serde_json::Value>), not from a run.The new test failed once on its first run in a fresh checkout, in cleanup (
e2e Server did not exit, 50 s); four repeated runs and the full suite passed afterwards.AI usage statement
Investigated, written and verified with Claude Code (Claude Fable 5), reviewed by the author.
中文摘要:自定义的
llm-pi-aiprovider(api: openai-responses)发出的函数工具不带strict字段,OpenAI 默认按 strict 模式处理,在 PowerContext 的 63 个 MCP 工具 schema 上返回server_error。插件无法改写 DSH 发出的工具定义,因此修复是 provider 配置compat.supportsStrictMode: true,schema 不变。本 PR 在中英文文档中新增说明,给 gateway provider 示例加上该开关,并增加真实 DSH 的回归测试。原环境(DSH 0.2.2-rc.5、gpt-4.1-mini)验证:不带开关 2/2 失败,带开关全部通过,129 个anyOf保留。gateway 路径未实跑。🤖 Generated with Claude Code