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

推荐订阅源

Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
爱范儿
爱范儿
罗磊的独立博客
博客园_首页
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
V
Visual Studio Blog
T
Tailwind CSS Blog

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
docs: document openai transport tests · openclaw/openclaw...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies OpenAI Responses replay preserves reasoning and response item ids.

12

import type { AssistantMessage, Model, ToolResultMessage } from "openclaw/plugin-sdk/llm";

23

import { stream } from "openclaw/plugin-sdk/llm";

34

import { Type } from "typebox";

@@ -88,6 +89,7 @@ async function runAbortedOpenAIResponsesStream(params: {

8889

}>;

8990

replayResponsesItemIds?: boolean;

9091

}) {

92+

// Abort after payload capture so tests inspect serialization without network I/O.

9193

const controller = new AbortController();

9294

controller.abort();

9395

let payload: Record<string, unknown> | undefined;

@@ -224,6 +226,7 @@ describe("openai-responses reasoning replay", () => {

224226

});

225227
226228

it("does not replay a signed assistant message id after its reasoning item was pruned", async () => {

229+

// Signed message ids are only safe to replay when their preceding reasoning item survived.

227230

expect(

228231

resolveReplayableResponsesMessageId({

229232

replayResponsesItemIds: true,

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies OpenAI model selections route between OpenClaw and Codex runtimes.

12

import { describe, expect, it } from "vitest";

23

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

34

import {

@@ -21,6 +22,7 @@ describe("OpenAI runtime routing policy", () => {

2122

});

2223
2324

it("does not force Codex for custom OpenAI-compatible base URLs", () => {

25+

// A custom baseUrl means the provider key is only OpenAI-compatible, not official OpenAI.

2426

const config = {

2527

models: {

2628

providers: {

@@ -90,6 +92,7 @@ describe("OpenAI runtime routing policy", () => {

9092

});

9193
9294

it("keeps explicit OpenClaw plus Codex auth profile under the unified OpenAI provider", () => {

95+

// OpenAI auth now stays canonical even when the runtime is not Codex.

9396

expect(

9497

listOpenAIAuthProfileProvidersForAgentRuntime({

9598

provider: "openai",

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies session thinking levels reach OpenAI and Codex Responses transports.

12

import { Agent, type StreamFn } from "openclaw/plugin-sdk/agent-core";

23

import {

34

createAssistantMessageEventStream,

@@ -119,6 +120,7 @@ function createCapturingStreamFn(

119120

model: ResponsesModel,

120121

capturedOptions: SimpleStreamOptions[],

121122

): StreamFn {

123+

// Captures Agent -> stream options while returning a complete assistant event.

122124

return (_model, _context, options) => {

123125

capturedOptions.push({ ...options });

124126

const stream = createAssistantMessageEventStream();

@@ -164,6 +166,7 @@ async function captureProviderPayload<

164166

) => ReturnType<StreamFn>;

165167

options: SimpleStreamOptions;

166168

}): Promise<Record<string, unknown>> {

169+

// Stop at onPayload so transport serialization can be asserted without HTTP.

167170

const payloadPromise = new Promise<Record<string, unknown>>((resolve, reject) => {

168171

const timeout = setTimeout(

169172

() => reject(new Error(`provider payload callback was not invoked for ${params.model.api}`)),

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies OpenAI strict tool schema normalization and cache behavior.

12

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

23

import {

34

clearOpenAIToolSchemaCacheForTest,

@@ -35,6 +36,7 @@ describe("OpenAI strict tool schema normalization", () => {

3536

});

3637
3738

it("does not close permissive nested object schemas implicitly", () => {

39+

// Nested permissive objects stay incompatible unless callers make them strict.

3840

const schema = {

3941

type: "object",

4042

properties: {

@@ -69,6 +71,7 @@ describe("OpenAI strict tool schema normalization", () => {

6971

});

7072
7173

it("reuses normalized strict schemas for stable tool schema objects", () => {

74+

// Cache keys include unsupported-keyword policy, not just object identity.

7275

const schema = {

7376

type: "object",

7477

properties: {

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies OpenAI-compatible streaming payloads, failures, and transport wrapping.

12

import { createServer } from "node:http";

23

import type { Api, Model } from "openclaw/plugin-sdk/llm";

34

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

@@ -99,6 +100,7 @@ function createAzureResponsesModel(): Model<"azure-openai-responses"> {

99100

}

100101
101102

function neverYieldsStream(): AsyncIterable<unknown> {

103+

// Simulates an HTTP stream that opened but never delivered the first SSE event.

102104

return {

103105

[Symbol.asyncIterator]() {

104106

return {

@@ -116,6 +118,7 @@ async function* streamChunks(chunks: readonly unknown[]): AsyncGenerator<never>

116118

}

117119
118120

function expectRecordFields(record: unknown, expected: Record<string, unknown>) {

121+

// Shared assertion helper for parsed transport payload/event records.

119122

if (!record || typeof record !== "object") {

120123

throw new Error("Expected record");

121124

}

@@ -141,6 +144,7 @@ describe("openai transport stream", () => {

141144

});

142145
143146

it("observes detail-less Responses failures without leaking request ids", async () => {

147+

// Observation should preserve hashes/metadata shape while dropping raw request ids.

144148

const model = createAzureResponsesModel();

145149

const event = {

146150

type: "response.failed",

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies OpenClaw gateway tool schema, restart signaling, and config mutations.

12

import fs from "node:fs/promises";

23

import os from "node:os";

34

import path from "node:path";

@@ -19,13 +20,15 @@ vi.mock("./tools/gateway.js", () => ({

1920

}));

2021
2122

function requireGatewayTool(agentSessionKey?: string) {

23+

// Tests run with restart enabled so schema and execution paths are visible.

2224

return createGatewayTool({

2325

...(agentSessionKey ? { agentSessionKey } : {}),

2426

config: { commands: { restart: true } },

2527

});

2628

}

2729
2830

function collectActionValues(schema: unknown, values: Set<string>): void {

31+

// Tool schemas can expose actions through const, enum, or anyOf variants.

2932

if (!schema || typeof schema !== "object") {

3033

return;

3134

}

@@ -109,6 +112,7 @@ function expectConfigMutationCall(params: {

109112

raw: string;

110113

sessionKey: string;

111114

}) {

115+

// Config writes must include the base hash from a preceding config.get read.

112116

expect(params.callGatewayTool.mock.calls.some(([method]) => method === "config.get")).toBe(true);

113117

const call = params.callGatewayTool.mock.calls.find(([method]) => method === params.action);

114118

if (!call) {