惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
The Cloudflare Blog
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
C
Check Point Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
F
Fortinet All Blogs
B
Blog
大猫的无限游戏
大猫的无限游戏
N
Netflix TechBlog - Medium
B
Blog RSS Feed
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(agents): preserve reasoning replay from model metadat...
steipete · 2026-05-31 · via Recent Commits to openclaw:main
11

import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

22

import type { OpenClawConfig } from "../config/types.openclaw.js";

33

import { resolveProviderRuntimePlugin } from "../plugins/provider-hook-runtime.js";

4+

import type { ProviderRuntimeModel } from "../plugins/provider-runtime-model.types.js";

4556

vi.mock("../plugins/provider-hook-runtime.js", async () => {

67

const replayHelpers = await vi.importActual<

@@ -229,6 +230,24 @@ describe("resolveTranscriptPolicy", () => {

229230

expect(policy.validateAnthropicTurns).toBe(true);

230231

}

231232233+

function makeOpenAiCompatibleReasoningModel(

234+

overrides: Partial<ProviderRuntimeModel> = {},

235+

): ProviderRuntimeModel {

236+

return {

237+

id: "qwen3.6-27b",

238+

name: "Qwen3.6 27B",

239+

provider: "custom-openai-proxy",

240+

api: "openai-completions",

241+

baseUrl: "https://example.invalid",

242+

reasoning: false,

243+

input: ["text"],

244+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

245+

contextWindow: 128_000,

246+

maxTokens: 16_384,

247+

...overrides,

248+

};

249+

}

250+232251

it("enables sanitizeToolCallIds for Anthropic provider", () => {

233252

const policy = resolveTranscriptPolicy({

234253

provider: "anthropic",

@@ -345,7 +364,7 @@ describe("resolveTranscriptPolicy", () => {

345364

expect(policy.validateAnthropicTurns).toBe(true);

346365

});

347366348-

it("strips historical reasoning for strict OpenAI-compatible providers", () => {

367+

it("strips historical reasoning for strict OpenAI-compatible providers by default", () => {

349368

const policy = resolveTranscriptPolicy({

350369

provider: "custom-openai-proxy",

351370

modelId: "qwen3.6-27b",

@@ -361,6 +380,17 @@ describe("resolveTranscriptPolicy", () => {

361380

expect(responsesPolicy.dropReasoningFromHistory).toBe(false);

362381

});

363382383+

it("preserves historical reasoning for strict OpenAI-compatible models with reasoning metadata", () => {

384+

const policy = resolveTranscriptPolicy({

385+

provider: "custom-openai-proxy",

386+

modelId: "qwen3.6-27b",

387+

modelApi: "openai-completions",

388+

model: makeOpenAiCompatibleReasoningModel({ reasoning: true }),

389+

});

390+391+

expect(policy.dropReasoningFromHistory).toBe(false);

392+

});

393+364394

it.each([

365395

"kimi-for-coding",

366396

"moonshotai/kimi-k2.6",

@@ -488,6 +518,28 @@ describe("resolveTranscriptPolicy", () => {

488518

expect(noReasoningPolicy.dropThinkingBlocks).toBe(true);

489519

});

490520521+

it("does not reuse cached OpenAI-compatible policies across reasoning metadata changes", () => {

522+

const config = {} as OpenClawConfig;

523+524+

const defaultPolicy = resolveTranscriptPolicy({

525+

config,

526+

provider: "custom-openai-proxy",

527+

modelId: "qwen3.6-27b",

528+

modelApi: "openai-completions",

529+

model: makeOpenAiCompatibleReasoningModel(),

530+

});

531+

const reasoningPolicy = resolveTranscriptPolicy({

532+

config,

533+

provider: "custom-openai-proxy",

534+

modelId: "qwen3.6-27b",

535+

modelApi: "openai-completions",

536+

model: makeOpenAiCompatibleReasoningModel({ reasoning: true }),

537+

});

538+539+

expect(defaultPolicy.dropReasoningFromHistory).toBe(true);

540+

expect(reasoningPolicy.dropReasoningFromHistory).toBe(false);

541+

});

542+491543

it("preserves transport defaults when a runtime plugin has not adopted replay hooks", () => {

492544

expectStrictOpenAiCompatibleReplayDefaults("vllm");

493545

});