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

推荐订阅源

罗磊的独立博客
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
A
About on SuperTechFans
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
Recent Announcements
Recent Announcements
D
DataBreaches.Net
B
Blog
博客园 - 【当耐特】
爱范儿
爱范儿
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
WordPress大学
WordPress大学
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
量子位
G
Google Developers 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
perf(gateway): borrow session reads on turn hot paths · o...
steipete · 2026-05-27 · via Recent Commits to openclaw:main

@@ -762,16 +762,17 @@ export function resolveDeletedAgentIdFromSessionKey(

762762

return agentId;

763763

}

764764765-

export function loadSessionEntry(sessionKey: string, opts?: { agentId?: string }) {

765+

export function loadSessionEntry(sessionKey: string, opts?: { agentId?: string; clone?: boolean }) {

766766

const cfg = getRuntimeConfig();

767767

const key = normalizeOptionalString(sessionKey) ?? "";

768768

const target = resolveGatewaySessionStoreTarget({

769769

cfg,

770770

key,

771+

...(opts?.clone === false ? { clone: false } : {}),

771772

...(opts?.agentId ? { agentId: opts.agentId } : {}),

772773

});

773774

const storePath = target.storePath;

774-

const store = loadSessionStore(storePath);

775+

const store = loadSessionStore(storePath, opts?.clone === false ? { clone: false } : undefined);

775776

const freshestMatch = resolveFreshestSessionStoreMatchFromStoreKeys(store, target.storeKeys);

776777

const legacyKey = freshestMatch?.key !== target.canonicalKey ? freshestMatch?.key : undefined;

777778

return {

@@ -1148,6 +1149,7 @@ function resolveGatewaySessionStoreLookup(params: {

11481149

key: string;

11491150

canonicalKey: string;

11501151

agentId: string;

1152+

clone?: boolean;

11511153

initialStore?: Record<string, SessionEntry>;

11521154

}): {

11531155

storePath: string;

@@ -1160,8 +1162,9 @@ function resolveGatewaySessionStoreLookup(params: {

11601162

agentId: params.agentId,

11611163

storePath: resolveStorePath(params.cfg.session?.store, { agentId: params.agentId }),

11621164

};

1165+

const loadOptions = params.clone === false ? { clone: false } : undefined;

11631166

let selectedStorePath = fallback.storePath;

1164-

let selectedStore = params.initialStore ?? loadSessionStore(fallback.storePath);

1167+

let selectedStore = params.initialStore ?? loadSessionStore(fallback.storePath, loadOptions);

11651168

let selectedMatch = findFreshestStoreMatch(selectedStore, ...scanTargets);

11661169

let selectedUpdatedAt = selectedMatch?.entry.updatedAt ?? Number.NEGATIVE_INFINITY;

11671170

@@ -1170,7 +1173,7 @@ function resolveGatewaySessionStoreLookup(params: {

11701173

if (!candidate) {

11711174

continue;

11721175

}

1173-

const store = loadSessionStore(candidate.storePath);

1176+

const store = loadSessionStore(candidate.storePath, loadOptions);

11741177

const match = findFreshestStoreMatch(store, ...scanTargets);

11751178

if (!match) {

11761179

continue;

@@ -1196,6 +1199,7 @@ function resolveGatewaySessionStoreLookup(params: {

11961199

function resolveExplicitDeletedLegacyMainStoreTarget(params: {

11971200

cfg: OpenClawConfig;

11981201

key: string;

1202+

clone?: boolean;

11991203

scanLegacyKeys?: boolean;

12001204

}): {

12011205

agentId: string;

@@ -1232,11 +1236,12 @@ function resolveExplicitDeletedLegacyMainStoreTarget(params: {

12321236

match: { entry: SessionEntry; key: string };

12331237

}

12341238

| undefined;

1239+

const loadOptions = params.clone === false ? { clone: false } : undefined;

12351240

for (const target of resolveAllAgentSessionStoreTargetsSync(params.cfg)) {

12361241

if (target.agentId !== legacyAgentId) {

12371242

continue;

12381243

}

1239-

const store = loadSessionStore(target.storePath);

1244+

const store = loadSessionStore(target.storePath, loadOptions);

12401245

const match = findFreshestStoreMatch(store, ...lookupSeeds);

12411246

if (!match) {

12421247

continue;

@@ -1274,6 +1279,7 @@ export function resolveGatewaySessionStoreTarget(params: {

12741279

cfg: OpenClawConfig;

12751280

key: string;

12761281

agentId?: string;

1282+

clone?: boolean;

12771283

scanLegacyKeys?: boolean;

12781284

store?: Record<string, SessionEntry>;

12791285

}): {

@@ -1286,6 +1292,7 @@ export function resolveGatewaySessionStoreTarget(params: {

12861292

const explicitDeletedMainTarget = resolveExplicitDeletedLegacyMainStoreTarget({

12871293

cfg: params.cfg,

12881294

key,

1295+

clone: params.clone,

12891296

scanLegacyKeys: params.scanLegacyKeys,

12901297

});

12911298

if (explicitDeletedMainTarget) {

@@ -1306,6 +1313,7 @@ export function resolveGatewaySessionStoreTarget(params: {

13061313

key,

13071314

canonicalKey,

13081315

agentId,

1316+

clone: params.clone,

13091317

initialStore: params.store,

13101318

});

13111319