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

推荐订阅源

The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
WordPress大学
WordPress大学
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
P
Proofpoint News Feed
D
DataBreaches.Net

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: carry transcript update sequence · openclaw/openclaw...
steipete · 2026-05-14 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -15,6 +15,7 @@ Docs: https://docs.openclaw.ai

1515

### Fixes

1616
1717

- CLI: lazy-load model and plugin runtime helpers for command actions so parent/help output renders without importing those runtime paths.

18+

- Gateway/session history: carry monotonic transcript message sequence through live updates and refresh SSE history when stale sequence input would otherwise append bad incremental state. (#81474) Thanks @samzong.

1819

- Security/sandbox: include Windows `USERPROFILE` in the sandbox blocked home roots so credential-bearing binds (such as `.codex`, `.openclaw`, or `.ssh` under the Windows user profile) are denied even when `HOME` points at a different shell home. (#63074) Thanks @luoyanglang.

1920

- Models config/auth: stop inferring provider env-var markers from broad `^[A-Z_][A-Z0-9_]*$` strings, and resolve config-backed provider `apiKey` values only through structured env SecretRefs (`secrets.providers[id]` / `secrets.defaults`), so unrelated env vars cannot accidentally become provider credentials. Thanks @sallyom.

2021

- Media fetch: skip allocating and buffering the response body for bodyless media responses (HEAD probes and 204-style empty bodies), avoiding wasted heap on streams that carry no payload. Thanks @shakkernerd.

Original file line numberDiff line numberDiff line change

@@ -1,5 +1,6 @@

11

import type { SessionLifecycleEvent } from "../sessions/session-lifecycle-events.js";

22

import type { SessionTranscriptUpdate } from "../sessions/transcript-events.js";

3+

import { asPositiveSafeInteger } from "../shared/number-coercion.js";

34

import { projectChatDisplayMessage } from "./chat-display-projection.js";

45

import type { GatewayBroadcastToConnIdsFn } from "./server-broadcast-types.js";

56

import type {

@@ -18,10 +19,6 @@ import {

1819

type SessionEventSubscribers = Pick<SessionEventSubscriberRegistry, "getAll">;

1920

type SessionMessageSubscribers = Pick<SessionMessageSubscriberRegistry, "get">;

2021
21-

function normalizeMessageSeq(value: unknown): number | undefined {

22-

return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : undefined;

23-

}

24-
2522

function buildGatewaySessionSnapshot(params: {

2623

sessionRow: GatewaySessionRow | null | undefined;

2724

includeSession?: boolean;

@@ -122,11 +119,11 @@ async function handleTranscriptUpdateBroadcast(

122119

if (connIds.size === 0) {

123120

return;

124121

}

125-

let messageSeq = normalizeMessageSeq(update.messageSeq);

122+

let messageSeq = asPositiveSafeInteger(update.messageSeq);

126123

if (messageSeq === undefined) {

127124

const { entry, storePath } = loadSessionEntry(sessionKey);

128125

messageSeq = entry?.sessionId

129-

? normalizeMessageSeq(

126+

? asPositiveSafeInteger(

130127

await readSessionMessageCountAsync(entry.sessionId, storePath, entry.sessionFile),

131128

)

132129

: undefined;

Original file line numberDiff line numberDiff line change

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

1+

import { asPositiveSafeInteger } from "../shared/number-coercion.js";

12

import {

23

DEFAULT_CHAT_HISTORY_TEXT_MAX_CHARS,

34

projectChatDisplayMessages,

@@ -67,10 +68,6 @@ function resolveCursorSeq(cursor: string | undefined): number | undefined {

6768

return Number.isFinite(value) && value > 0 ? value : undefined;

6869

}

6970
70-

function resolvePositiveInteger(value: unknown): number | undefined {

71-

return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : undefined;

72-

}

73-
7471

function toSessionHistoryMessages(messages: unknown[]): SessionHistoryMessage[] {

7572

return messages.filter(

7673

(message): message is SessionHistoryMessage =>

@@ -92,7 +89,7 @@ function buildPaginatedSessionHistory(params: {

9289

}

9390
9491

function resolveMessageSeq(message: SessionHistoryMessage | undefined): number | undefined {

95-

return resolvePositiveInteger(message?.__openclaw?.seq);

92+

return asPositiveSafeInteger(message?.__openclaw?.seq);

9693

}

9794
9895

function paginateSessionMessages(

@@ -238,7 +235,7 @@ export class SessionHistorySseState {

238235

if (this.limit !== undefined || this.cursor !== undefined) {

239236

return null;

240237

}

241-

const carriedSeq = resolvePositiveInteger(update.messageSeq);

238+

const carriedSeq = asPositiveSafeInteger(update.messageSeq);

242239

if (carriedSeq !== undefined) {

243240

if (carriedSeq <= this.rawTranscriptSeq) {

244241

return { shouldRefresh: true };

Original file line numberDiff line numberDiff line change

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

1+

import { asPositiveSafeInteger } from "../shared/number-coercion.js";

12

import { normalizeOptionalString } from "../shared/string-coerce.js";

23
34

export type SessionTranscriptUpdate = {

@@ -12,10 +13,6 @@ type SessionTranscriptListener = (update: SessionTranscriptUpdate) => void;

1213
1314

const SESSION_TRANSCRIPT_LISTENERS = new Set<SessionTranscriptListener>();

1415
15-

function normalizeMessageSeq(value: unknown): number | undefined {

16-

return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : undefined;

17-

}

18-
1916

export function onSessionTranscriptUpdate(listener: SessionTranscriptListener): () => void {

2017

SESSION_TRANSCRIPT_LISTENERS.add(listener);

2118

return () => {

@@ -38,7 +35,7 @@ export function emitSessionTranscriptUpdate(update: string | SessionTranscriptUp

3835

if (!trimmed) {

3936

return;

4037

}

41-

const messageSeq = normalizeMessageSeq(normalized.messageSeq);

38+

const messageSeq = asPositiveSafeInteger(normalized.messageSeq);

4239

const nextUpdate: SessionTranscriptUpdate = {

4340

sessionFile: trimmed,

4441

...(normalizeOptionalString(normalized.sessionKey)

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,7 @@

11

export function asFiniteNumber(value: unknown): number | undefined {

22

return typeof value === "number" && Number.isFinite(value) ? value : undefined;

33

}

4+
5+

export function asPositiveSafeInteger(value: unknown): number | undefined {

6+

return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : undefined;

7+

}