mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:40:43 +00:00
perf: route session store writes through writer queue
This commit is contained in:
@@ -114,11 +114,16 @@ Provider and channel execution paths must use the active runtime config snapshot
|
||||
|
||||
```typescript
|
||||
const storePath = api.runtime.agent.session.resolveStorePath(cfg);
|
||||
const store = api.runtime.agent.session.loadSessionStore(cfg);
|
||||
await api.runtime.agent.session.saveSessionStore(cfg, store);
|
||||
const store = api.runtime.agent.session.loadSessionStore(storePath);
|
||||
await api.runtime.agent.session.updateSessionStore(storePath, (nextStore) => {
|
||||
// Patch one entry without replacing the whole file from stale state.
|
||||
nextStore[sessionKey] = { ...nextStore[sessionKey], thinkingLevel: "high" };
|
||||
});
|
||||
const filePath = api.runtime.agent.session.resolveSessionFilePath(cfg, sessionId);
|
||||
```
|
||||
|
||||
Prefer `updateSessionStore(...)` or `updateSessionStoreEntry(...)` for runtime writes. They route through the Gateway-owned session-store writer, preserve concurrent updates, and reuse the hot cache. `saveSessionStore(...)` remains available for compatibility and offline maintenance-style rewrites.
|
||||
|
||||
</Accordion>
|
||||
<Accordion title="api.runtime.agent.defaults">
|
||||
Default model and provider constants:
|
||||
|
||||
Reference in New Issue
Block a user