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

推荐订阅源

WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
B
Blog
F
Fortinet All Blogs
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
A
About on SuperTechFans
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
B
Blog RSS Feed

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 session utilities · openclaw/openc...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1+

// Gateway run-id to session-key resolver.

2+

// Bridges live agent run context with persisted session stores.

13

import {

24

asDateTimestampMs,

35

resolveExpiresAtMsFromDurationMs,

@@ -53,6 +55,8 @@ function setResolvedSessionKeyCache(

5355

}

5456

let expiresAt: number | null = null;

5557

if (sessionKey === null) {

58+

// Negative caching avoids repeated full-store scans while still allowing

59+

// a just-created run/session pair to appear shortly after the first lookup.

5660

const missExpiresAt = resolveExpiresAtMsFromDurationMs(RUN_LOOKUP_MISS_TTL_MS);

5761

if (missExpiresAt === undefined) {

5862

return;

@@ -122,6 +126,8 @@ export function resolveSessionKeyForRun(runId: string, opts: { agentId?: string

122126

);

123127

const storeKey = resolvePreferredSessionKeyForSessionIdMatches(matches, runId);

124128

if (storeKey) {

129+

// Return caller-facing agent request keys, not raw store keys, because

130+

// HTTP/RPC clients reuse this value in later session operations.

125131

const sessionKey = resolveRunSessionKeyForCaller(storeKey);

126132

setResolvedSessionKeyCache(runId, cacheAgentId, sessionKey);

127133

return sessionKey;

Original file line numberDiff line numberDiff line change

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

1+

// Gateway startup logging helpers.

2+

// Produces the compact ready banner with resolved model and safety state.

13

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

24

import chalk from "chalk";

35

import { resolveDefaultAgentId, resolveAgentConfig } from "../agents/agent-scope.js";

Original file line numberDiff line numberDiff line change

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

1+

// Gateway startup session-store migration runner.

2+

// Keeps old orphaned session keys from surviving process upgrades.

13

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

24

import { migrateOrphanedSessionKeys } from "../infra/state-migrations.js";

35
Original file line numberDiff line numberDiff line change

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

1+

// Session patch hook dispatcher.

2+

// Publishes internal mutation notifications after Gateway session patch calls.

13

import type { SessionsPatchParams } from "../../packages/gateway-protocol/src/index.js";

24

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

35

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

Original file line numberDiff line numberDiff line change

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

1+

// Gateway session reset/delete service.

2+

// Rotates transcripts and coordinates lifecycle cleanup across runtimes/hooks.

13

import { randomUUID } from "node:crypto";

24

import fs from "node:fs";

35

import path from "node:path";

@@ -80,6 +82,8 @@ function resolveResetSessionFile(params: {

8082

agentId: string;

8183

}): string {

8284

const currentEntry = params.currentEntry;

85+

// Preserve explicit session-file placement across reset while swapping the

86+

// embedded session id, so linked runtimes keep writing beside old transcripts.

8387

const rewrittenSessionFile = currentEntry?.sessionId

8488

? rewriteSessionFileForNewSessionId({

8589

sessionFile: currentEntry.sessionFile,

@@ -108,6 +112,8 @@ function stripRuntimeModelState(entry?: SessionEntry): SessionEntry | undefined

108112

}

109113

return {

110114

...entry,

115+

// Reset should keep user selection preferences but drop per-run resolved

116+

// model state so the next turn rehydrates from current config.

111117

model: undefined,

112118

modelProvider: undefined,

113119

contextTokens: undefined,

Original file line numberDiff line numberDiff line change

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

1+

// Subagent session reactivation helper.

2+

// Replaces completed subagent run records when a user steers the child session.

13

import { getLatestSubagentRunByChildSessionKey } from "../agents/subagent-registry-read.js";

24
35

// Completed subagent sessions can be reactivated after a user steer by replacing

Original file line numberDiff line numberDiff line change

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

1+

// Gateway session listing and projection helpers.

2+

// Normalizes persisted session stores into UI/RPC rows without mutating state.

13

import fs from "node:fs";

24

import path from "node:path";

35

import {

@@ -173,6 +175,8 @@ function resolveIdentityAvatarUrl(

173175

return undefined;

174176

}

175177

try {

178+

// Avatars can be workspace-relative, but projection must keep the file

179+

// read inside the agent workspace and cap bytes before encoding.

176180

const opened = openRootFileSync({

177181

absolutePath: resolvedCandidate,

178182

rootPath: workspaceRoot,

@@ -421,6 +425,8 @@ function shouldKeepStoreOnlyChildLink(entry: SessionEntry, now: number): boolean

421425

if (entry.status === "running" || isFinitePositiveTimestamp(entry.startedAt)) {

422426

return true;

423427

}

428+

// Store-only child links lack a live subagent registry entry. Keep recent

429+

// unknown-state rows visible briefly so reloads do not hide fresh children.

424430

return (

425431

isFinitePositiveTimestamp(entry.updatedAt) &&

426432

now - entry.updatedAt <= STALE_STORE_ONLY_CHILD_LINK_MS

Original file line numberDiff line numberDiff line change

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

1+

// Shared Gateway session projection types.

2+

// Keeps server methods and Control UI payloads aligned.

13

import type { ChatType } from "../channels/chat-type.js";

24

import type {

35

SessionCompactionCheckpoint,

Original file line numberDiff line numberDiff line change

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

1+

// Ordered Gateway startup task runner.

2+

// Used for best-effort side effects that should not abort the server.

13

import { formatErrorMessage } from "../infra/errors.js";

24
35

// Startup tasks run sequentially so logs and side effects stay ordered during