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

推荐订阅源

Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
量子位
V
Visual Studio Blog
博客园 - Franky
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
罗磊的独立博客
小众软件
小众软件
V
V2EX
GbyAI
GbyAI
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
月光博客
月光博客
Recent Announcements
Recent Announcements
雷峰网
雷峰网
F
Fortinet All Blogs
M
MIT News - Artificial intelligence

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 gateway state helpers · openclaw/openclaw@...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1+

// Gateway chat/agent abort tracking.

2+

// Registers active run abort controllers and projects in-flight chat state.

13

import {

24

asDateTimestampMs,

35

resolveDateTimestampMs,

@@ -133,6 +135,8 @@ export function registerChatAbortController(params: {

133135

};

134136
135137

if (!params.sessionKey || params.chatAbortControllers.has(params.runId)) {

138+

// Duplicate run ids keep their fresh controller for caller cancellation, but

139+

// do not replace the registered entry that owns active-run projection.

136140

return { controller, registered: false, cleanup };

137141

}

138142
Original file line numberDiff line numberDiff line change

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

1+

// OpenResponses output item factories.

2+

// Keeps assistant/function-call output assembly in schema-compatible shapes.

13

import type { OutputItem } from "./open-responses.schema.js";

24
35

// Small OpenResponses output factories keep streamed assistant/function-call

Original file line numberDiff line numberDiff line change

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

1+

// Gateway WebSocket broadcaster.

2+

// Applies event scope guards and slow-consumer handling before sending frames.

13

import { logRejectedLargePayload } from "../logging/diagnostic-payload.js";

24

import {

35

ADMIN_SCOPE,

@@ -54,6 +56,8 @@ const EVENT_SCOPE_GUARDS: Record<string, string[]> = {

5456

const NODE_ALLOWED_EVENTS = new Set<string>(["voicewake.changed", "voicewake.routing.changed"]);

5557
5658

function serializeFrameField(name: "payload" | "stateVersion", value: unknown): string {

59+

// Serialize one field through JSON.stringify so embedded values keep JSON

60+

// escaping, then splice it into the shared per-client frame body.

5761

const fieldJSON = JSON.stringify({ [name]: value });

5862

const keyJSON = JSON.stringify(name);

5963

const prefix = `{${keyJSON}:`;

Original file line numberDiff line numberDiff line change

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

1+

// Gateway session child-discovery helpers.

2+

// Finds direct parent/child relationships across canonical and legacy fields.

13

import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";

24

import { loadCombinedSessionStoreForGateway } from "../config/sessions/combined-store-gateway.js";

35

import type { SessionEntry } from "../config/sessions/types.js";

Original file line numberDiff line numberDiff line change

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

1+

// Gateway session-history projection state.

2+

// Tracks transcript sequence windows for paginated chat-history SSE updates.

13

import { asPositiveSafeInteger } from "@openclaw/normalization-core/number-coercion";

24

import {

35

DEFAULT_CHAT_HISTORY_TEXT_MAX_CHARS,

@@ -108,6 +110,8 @@ function paginateSessionMessages(

108110

limit: number | undefined,

109111

cursor: string | undefined,

110112

): PaginatedSessionHistory {

113+

// Cursors point at transcript sequence watermarks. The returned page is the

114+

// window before that cursor, matching "older messages" pagination.

111115

const cursorSeq = resolveCursorSeq(cursor);

112116

let endExclusive = messages.length;

113117

if (typeof cursorSeq === "number") {

Original file line numberDiff line numberDiff line change

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

1+

// Gateway session lifecycle state projection.

2+

// Converts agent run lifecycle events into session row/store status updates.

13

import {

24

buildAgentRunTerminalOutcome,

35

type AgentRunTerminalOutcome,

@@ -129,6 +131,8 @@ export function deriveGatewaySessionLifecycleSnapshot(params: {

129131
130132

const existing = params.session ?? undefined;

131133

if (phase === "start") {

134+

// A start event clears terminal fields from the previous run so UI rows do

135+

// not show stale runtime/end state while the new run is active.

132136

const startedAt = resolveLifecycleStartedAt(existing?.startedAt, params.event);

133137

const updatedAt = startedAt ?? existing?.updatedAt;

134138

return {

Original file line numberDiff line numberDiff line change

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

1+

// Gateway sessions.resolve implementation helper.

2+

// Resolves key/sessionId/label selectors into one canonical session key.

13

import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";

24

import {

35

ErrorCodes,

@@ -119,6 +121,8 @@ export async function resolveSessionKeyFromResolveParams(params: {

119121

}

120122
121123

if (hasKey) {

124+

// Key lookups may hit legacy store aliases. Migrate/prune before returning

125+

// the canonical key so later calls operate on one store identity.

122126

const target = resolveGatewaySessionStoreTarget({ cfg, key });

123127

const store = loadSessionStore(target.storePath);

124128

if (store[target.canonicalKey]) {

@@ -168,6 +172,8 @@ export async function resolveSessionKeyFromResolveParams(params: {

168172

}

169173
170174

if (hasSessionId) {

175+

// sessionId can collide across stores; delegate selection so exact key

176+

// matches and ambiguity rules stay shared with other session-id callers.

171177

const { store } = loadCombinedSessionStoreForGateway(cfg, { agentId: p.agentId });

172178

const matches = findVisibleSessionIdMatches({ cfg, store, p, sessionId });

173179

const selection = resolveSessionIdMatchSelection(matches, sessionId);

Original file line numberDiff line numberDiff line change

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

1+

// Gateway WebSocket log formatting.

2+

// Redacts and compacts request/response/event metadata for console diagnostics.

13

import { readStringValue } from "@openclaw/normalization-core/string-coerce";

24

import chalk from "chalk";

35

import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";

@@ -39,6 +41,8 @@ function collectWsRestMeta(meta?: Record<string, unknown>): string[] {

3941

return restMeta;

4042

}

4143

for (const [key, value] of Object.entries(meta)) {

44+

// Core frame fields are rendered elsewhere; this loop only emits extra

45+

// metadata so logs stay compact and stable.

4246

if (value === undefined) {

4347

continue;

4448

}