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

推荐订阅源

腾讯CDC
The Cloudflare Blog
IT之家
IT之家
V
V2EX
雷峰网
雷峰网
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
小众软件
小众软件
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
A
About on SuperTechFans
B
Blog
月光博客
月光博客
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI

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 session guard tests · openclaw/openclaw@dc...
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 tool schema normalization remains stable across runtime paths.

12

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

23

import {

34

createNativeOpenAIResponsesModel,

@@ -56,6 +57,7 @@ describe("OpenAI transport schema normalization runtime contract", () => {

5657

});

5758
5859

it("passes prepared executable schemas through compaction-triggered Responses requests", () => {

60+

// Server-side compaction must not strip provider-prepared strict tool schemas.

5961

const hooks = buildProviderToolCompatFamilyHooks("openai");

6062

const tools = hooks.normalizeToolSchemas({

6163

provider: "openai",

Original file line numberDiff line numberDiff line change

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

1+

// Verifies quota suspension persists lane state and auto-resumes safely.

12

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

23

import { DEFAULT_CRON_MAX_CONCURRENT_RUNS } from "../config/cron-limits.js";

34

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

@@ -24,6 +25,7 @@ vi.mock("./command/session.js", () => ({

2425

}));

2526
2627

async function suspendLane(ttlMs: number, cfg: OpenClawConfig, laneId: CommandLane) {

28+

// All cases exercise the public suspendSession path with fixed failure metadata.

2729

const { suspendSession } = await import("./session-suspension.js");

2830

await suspendSession({

2931

cfg,

@@ -104,6 +106,7 @@ describe("session suspension", () => {

104106

});

105107
106108

it("clamps oversized suspension TTLs for timers and persisted resume time", async () => {

109+

// Persisted expectedResumeBy must match the clamped timer, not MAX_SAFE_INTEGER.

107110

vi.useFakeTimers();

108111

vi.setSystemTime(1_000);

109112

const setTimeoutSpy = vi.spyOn(globalThis, "setTimeout");

Original file line numberDiff line numberDiff line change

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

1+

// Verifies session tool-result guard inserts, truncates, and repairs tool results.

12

import type { AgentMessage } from "openclaw/plugin-sdk/agent-core";

23

import { SessionManager } from "openclaw/plugin-sdk/agent-sessions";

34

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

@@ -32,6 +33,7 @@ function appendAssistantToolCall(

3233

sm: SessionManager,

3334

params: { id: string; name: string; withArguments?: boolean },

3435

) {

36+

// Builds pending tool calls with optional missing arguments for repair cases.

3537

const toolCall: {

3638

type: "toolCall";

3739

id: string;

@@ -61,6 +63,7 @@ function getPersistedMessages(sm: SessionManager): AgentMessage[] {

6163

}

6264
6365

function expectPersistedRoles(sm: SessionManager, expectedRoles: AgentMessage["role"][]) {

66+

// Role-order assertions prove where synthetic toolResult messages were inserted.

6467

const messages = getPersistedMessages(sm);

6568

expect(messages.map((message) => message.role)).toEqual(expectedRoles);

6669

return messages;

@@ -387,9 +390,7 @@ describe("installSessionToolResultGuard", () => {

387390

);

388391
389392

const messages = expectPersistedRoles(sm, ["assistant", "assistant", "toolResult"]);

390-

expect((messages[2] as { toolCallId?: string; isError?: boolean }).toolCallId).toBe(

391-

"call_1",

392-

);

393+

expect((messages[2] as { toolCallId?: string; isError?: boolean }).toolCallId).toBe("call_1");

393394

expect((messages[2] as { isError?: boolean }).isError).toBe(false);

394395

expect(JSON.stringify(messages)).not.toContain("missing tool result");

395396

expect(guard.getPendingIds()).toStrictEqual(["call_2"]);

Original file line numberDiff line numberDiff line change

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

1+

// Verifies persisted tool results are redacted/capped and can be transformed by hooks.

12

import fs from "node:fs";

23

import os from "node:os";

34

import path from "node:path";

@@ -17,6 +18,7 @@ const originalConfigPath = process.env.OPENCLAW_CONFIG_PATH;

1718

let tempDirs: string[] = [];

1819
1920

function writeTempPlugin(params: { dir: string; id: string; body: string }): string {

21+

// Temp plugin manifests allow testing real hook loading without bundled plugins.

2022

const pluginDir = path.join(params.dir, params.id);

2123

fs.mkdirSync(pluginDir, { recursive: true });

2224

const file = path.join(pluginDir, `${params.id}.mjs`);

@@ -99,6 +101,7 @@ function expectPersistedToolResultTextCapped(sm: ReturnType<typeof SessionManage

99101

}

100102
101103

function expectPersistedToolResultDetailsCapped(sm: ReturnType<typeof SessionManager.inMemory>) {

104+

// Large details are summarized before persistence to keep transcript files bounded.

102105

const toolResult = requirePersistedToolResult(sm);

103106

const details = toolResult.details as Record<string, unknown>;

104107

expect(details.persistedDetailsTruncated).toBe(true);

Original file line numberDiff line numberDiff line change

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

1+

// Verifies guarded session managers emit transcript update events with stable sequence ids.

12

import type { AgentMessage } from "openclaw/plugin-sdk/agent-core";

23

import { SessionManager } from "openclaw/plugin-sdk/agent-sessions";

34

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

@@ -10,6 +11,7 @@ import { guardSessionManager } from "./session-tool-result-guard-wrapper.js";

1011

const listeners: Array<() => void> = [];

1112
1213

afterEach(() => {

14+

// Remove all transcript listeners between tests to avoid duplicate broadcasts.

1315

while (listeners.length > 0) {

1416

listeners.pop()?.();

1517

}

@@ -124,6 +126,7 @@ describe("guardSessionManager transcript updates", () => {

124126

});

125127
126128

it("caches real tool result sequence before final assistant messages", () => {

129+

// Tool results are persisted but not broadcast, so later visible messages must skip their seq.

127130

const updates: SessionTranscriptUpdate[] = [];

128131

listeners.push(onSessionTranscriptUpdate((update) => updates.push(update)));

129132
Original file line numberDiff line numberDiff line change

@@ -1,9 +1,11 @@

1+

// Verifies transcript repair preserves sessions_spawn attachments and ACP routing fields.

12

import type { AgentMessage } from "openclaw/plugin-sdk/agent-core";

23

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

34

import { sanitizeToolCallInputs } from "./session-transcript-repair.js";

45

import { castAgentMessage, castAgentMessages } from "./test-helpers/agent-message-fixtures.js";

56
67

function mkSessionsSpawnToolCall(content: string): AgentMessage {

8+

// sessions_spawn attachments are transcript-owned payloads, not redaction targets.

79

return castAgentMessage({

810

role: "assistant",

911

content: [