Skip to content

Commit 68502c9

Browse files
authored
fix(openrouter): parse visible reasoning_details output (#68577)
* fix(openrouter): parse visible reasoning_details output * fix(openrouter): preserve reasoning_details ordering * fix(openrouter): harden reasoning details compat * fix(openrouter): queue post-tool-call reasoning text * chore(config): refresh generated schema baselines * fix(openrouter): keep fallback reasoning with visible details * fix(openrouter): bound streaming tool-call buffers
1 parent 6638567 commit 68502c9

8 files changed

Lines changed: 942 additions & 46 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ Docs: https://docs.openclaw.ai
170170
- Webchat/security: reject remote-host `file://` URLs in the media embedding path. (#67293) Thanks @pgondhi987.
171171
- Dreaming/memory-core: use the ingestion day, not the source file day, for daily recall dedupe so repeat sweeps of the same daily note can increment `dailyCount` across days instead of stalling at `1`. (#67091) Thanks @Bartok9.
172172
- Node-host/tools.exec: let approval binding distinguish known native binaries from mutable shell payload files, while still fail-closing unknown or racy file probes so absolute-path node-host commands like `/usr/bin/whoami` no longer get rejected as unsafe interpreter/runtime commands. (#66731) Thanks @tmimmanuel.
173+
- Codex/gateway: fix gateway crash when the codex-acp subprocess terminates abruptly; an unhandled EPIPE on the child stdin stream now routes through graceful client shutdown, rejecting pending requests instead of propagating as an uncaught exception that crashes the entire gateway daemon and all connected channels. Fixes #67886. (#67947) thanks @openperf
174+
- Slack/streaming: resolve native streaming recipient teams from the inbound user when available, with a monitor-team fallback, so DM and shared-workspace streams target the right recipient more reliably.
175+
- OpenRouter/streaming: treat `reasoning_details.response.output_text` and `reasoning_details.response.text` as visible assistant output on OpenRouter-compatible completions streams, while keeping `reasoning.text` hidden and refusing to surface ambiguous bare `text` items by default so visible replies, thinking blocks, and tool calls can coexist in the same chunk. (#67410) Thanks @neeravmakwana.
173176

174177
## 2026.4.14
175178

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
c69926b2da5cb8a329e28025506e4bca026888e9848fff930d09345a3aaa7283 config-baseline.json
2-
85cc004ee1628ab2096af61c640d514ef68601bd4eaa1fceaacd91d20baf9833 config-baseline.core.json
1+
5ce9d439f8cf84fc9d20c93436fea6492bdab0e84e9e51867648343e0375b670 config-baseline.json
2+
10b7c57a6198526b846471e1bcda6e361c1f3db2e3b1cd24abd8bac11db56e16 config-baseline.core.json
33
99bb34fcf83ba6bb50a3fc11f170bd379bee5728b0938707fc39ebd7638e12eb config-baseline.channel.json
44
b695cb31b4c0cf1d31f842f2892e99cc3ff8d84263ae72b72977cae844b81d6e config-baseline.plugin.json

src/agents/openai-completions-compat.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type OpenAICompletionsCompatDefaults = {
1717
supportsUsageInStreaming: boolean;
1818
maxTokensField: "max_completion_tokens" | "max_tokens";
1919
thinkingFormat: "openai" | "openrouter" | "zai";
20+
visibleReasoningDetailTypes: string[];
2021
supportsStrictMode: boolean;
2122
};
2223

@@ -82,6 +83,7 @@ export function resolveOpenAICompletionsCompatDefaults(
8283
(!isNonStandard && (!usesConfiguredNonOpenAIEndpoint || supportsNativeStreamingUsageCompat)),
8384
maxTokensField: usesMaxTokens ? "max_tokens" : "max_completion_tokens",
8485
thinkingFormat: isZai ? "zai" : isOpenRouterLike ? "openrouter" : "openai",
86+
visibleReasoningDetailTypes: isOpenRouterLike ? ["response.output_text", "response.text"] : [],
8587
supportsStrictMode: !isZai && !usesConfiguredNonOpenAIEndpoint,
8688
};
8789
}

0 commit comments

Comments
 (0)