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

推荐订阅源

博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
B
Blog
GbyAI
GbyAI
爱范儿
爱范儿
月光博客
月光博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
腾讯CDC
MyScale Blog
MyScale Blog
V
Visual Studio Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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): filter session previews after visibility · o...
steipete · 2026-04-23 · via Recent Commits to openclaw:main

@@ -1,3 +1,5 @@

1+

import fs from "node:fs";

2+

import os from "node:os";

13

import path from "node:path";

24

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

35

import type { ChannelMessagingAdapter } from "../channels/plugins/types.js";

@@ -297,9 +299,7 @@ describe("sessions tools", () => {

297299

params: {

298300

activeMinutes: undefined,

299301

agentId: "main",

300-

includeDerivedTitles: true,

301302

includeGlobal: true,

302-

includeLastMessage: true,

303303

includeUnknown: true,

304304

label: "mailbox",

305305

limit: undefined,

@@ -356,6 +356,93 @@ describe("sessions tools", () => {

356356

expect(cronDetails.sessions?.[0]?.kind).toBe("cron");

357357

});

358358359+

it("derives mailbox previews only after agent visibility filtering", async () => {

360+

const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-sessions-list-preview-"));

361+

const storePath = path.join(tmpDir, "sessions.json");

362+

try {

363+

fs.writeFileSync(

364+

path.join(tmpDir, "visible.jsonl"),

365+

[

366+

JSON.stringify({ type: "session", id: "visible" }),

367+

JSON.stringify({ message: { role: "user", content: "Visible project kickoff" } }),

368+

JSON.stringify({ message: { role: "assistant", content: "Visible latest reply" } }),

369+

].join("\n"),

370+

"utf-8",

371+

);

372+

fs.writeFileSync(

373+

path.join(tmpDir, "hidden.jsonl"),

374+

[

375+

JSON.stringify({ type: "session", id: "hidden" }),

376+

JSON.stringify({ message: { role: "user", content: "Hidden cross-agent topic" } }),

377+

JSON.stringify({ message: { role: "assistant", content: "Hidden latest reply" } }),

378+

].join("\n"),

379+

"utf-8",

380+

);

381+382+

callGatewayMock.mockImplementation(async (opts: unknown) => {

383+

const request = opts as { method?: string; params?: Record<string, unknown> };

384+

if (request.method === "sessions.list") {

385+

expect(request.params?.includeDerivedTitles).toBeUndefined();

386+

expect(request.params?.includeLastMessage).toBeUndefined();

387+

return {

388+

path: storePath,

389+

sessions: [

390+

{

391+

key: "agent:main:main",

392+

kind: "direct",

393+

sessionId: "visible",

394+

updatedAt: 20,

395+

},

396+

{

397+

key: "agent:other:main",

398+

kind: "direct",

399+

sessionId: "hidden",

400+

updatedAt: 21,

401+

},

402+

],

403+

};

404+

}

405+

return {};

406+

});

407+408+

const tool = createOpenClawTools({

409+

agentSessionKey: "agent:main:main",

410+

config: {

411+

...TEST_CONFIG,

412+

tools: {

413+

sessions: { visibility: "agent" },

414+

agentToAgent: { enabled: false },

415+

},

416+

} as OpenClawConfig,

417+

}).find((candidate) => candidate.name === "sessions_list");

418+

expect(tool).toBeDefined();

419+

if (!tool) {

420+

throw new Error("missing sessions_list tool");

421+

}

422+423+

const result = await tool.execute("call-preview", {

424+

includeDerivedTitles: true,

425+

includeLastMessage: true,

426+

});

427+

const details = result.details as {

428+

sessions?: Array<{

429+

key?: string;

430+

derivedTitle?: string;

431+

lastMessagePreview?: string;

432+

}>;

433+

};

434+

expect(details.sessions).toHaveLength(1);

435+

expect(details.sessions?.[0]).toMatchObject({

436+

key: "agent:main:main",

437+

derivedTitle: "Visible project kickoff",

438+

lastMessagePreview: "Visible latest reply",

439+

});

440+

expect(JSON.stringify(details.sessions)).not.toContain("Hidden");

441+

} finally {

442+

fs.rmSync(tmpDir, { recursive: true, force: true });

443+

}

444+

});

445+359446

it("sessions_list resolves transcriptPath from agent state dir for multi-store listings", async () => {

360447

callGatewayMock.mockImplementation(async (opts: unknown) => {

361448

const request = opts as { method?: string };