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

推荐订阅源

I
InfoQ
S
SegmentFault 最新的问题
T
Tailwind CSS Blog
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
量子位
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
The Cloudflare Blog
小众软件
小众软件
云风的 BLOG
云风的 BLOG
WordPress大学
WordPress大学
P
Proofpoint News Feed
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point 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
fix: parse sessions filters strictly · openclaw/openclaw@...
steipete · 2026-05-29 · via Recent Commits to openclaw:main

@@ -5,6 +5,7 @@ import {

55

createSessionAndRefresh,

66

deleteSessionsAndRefresh,

77

loadSessions,

8+

parseSessionsFilterInteger,

89

subscribeSessions,

910

syncSelectedSessionMessageSubscription,

1011

type SessionsState,

@@ -70,6 +71,17 @@ describe("subscribeSessions", () => {

7071

});

7172

});

727374+

describe("parseSessionsFilterInteger", () => {

75+

it("accepts safe decimal integer filters only", () => {

76+

expect(parseSessionsFilterInteger("120")).toBe(120);

77+

expect(parseSessionsFilterInteger(" 50 ")).toBe(50);

78+

expect(parseSessionsFilterInteger("1e3")).toBe(0);

79+

expect(parseSessionsFilterInteger("0x1000")).toBe(0);

80+

expect(parseSessionsFilterInteger("1.5")).toBe(0);

81+

expect(parseSessionsFilterInteger("9007199254740993")).toBe(0);

82+

});

83+

});

84+7385

describe("syncSelectedSessionMessageSubscription", () => {

7486

it("subscribes to the selected session message stream", async () => {

7587

const request = vi.fn(async () => ({ key: "agent:main:main" }));

@@ -639,6 +651,63 @@ describe("loadSessions", () => {

639651

});

640652

});

641653654+

it("ignores non-decimal and unsafe sessions filter numbers", async () => {

655+

const request = vi.fn(async (method: string) => {

656+

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

657+

throw new Error(`unexpected method: ${method}`);

658+

}

659+

return {

660+

ts: 1,

661+

path: "(multiple)",

662+

count: 0,

663+

defaults: { modelProvider: null, model: null, contextTokens: null },

664+

sessions: [],

665+

};

666+

});

667+

const state = createState(request, {

668+

sessionsFilterActive: "1e3",

669+

sessionsFilterLimit: "9007199254740993",

670+

sessionsShowArchived: false,

671+

});

672+673+

await loadSessions(state);

674+675+

expect(request).toHaveBeenCalledWith("sessions.list", {

676+

includeGlobal: true,

677+

includeUnknown: true,

678+

configuredAgentsOnly: true,

679+

});

680+

});

681+682+

it("ignores unsafe numeric session filter overrides", async () => {

683+

const request = vi.fn(async (method: string) => {

684+

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

685+

throw new Error(`unexpected method: ${method}`);

686+

}

687+

return {

688+

ts: 1,

689+

path: "(multiple)",

690+

count: 0,

691+

defaults: { modelProvider: null, model: null, contextTokens: null },

692+

sessions: [],

693+

};

694+

});

695+

const state = createState(request);

696+697+

await loadSessions(state, {

698+

activeMinutes: Number.MAX_SAFE_INTEGER + 1,

699+

limit: Number.MAX_SAFE_INTEGER + 1,

700+

includeGlobal: true,

701+

includeUnknown: true,

702+

});

703+704+

expect(request).toHaveBeenCalledWith("sessions.list", {

705+

includeGlobal: true,

706+

includeUnknown: true,

707+

configuredAgentsOnly: true,

708+

});

709+

});

710+642711

it("forwards scoped agent refreshes to sessions.list", async () => {

643712

const request = vi.fn(async (method: string) => {

644713

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