Skip to content

Commit 193d3c0

Browse files
vincentkocfuller-stack-dev
authored andcommitted
fix(auto-reply): preserve sessions after compaction failures
1 parent cbafafe commit 193d3c0

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4918,7 +4918,8 @@ Docs: https://docs.openclaw.ai
49184918
- Providers/SDK retry: cap long `Retry-After` sleeps in Stainless-based Anthropic/OpenAI model SDKs so 60s+ retry windows surface immediately for OpenClaw failover instead of blocking the run. (#68474) Thanks @jetd1.
49194919
- Agents/TTS: preserve spoken text in TTS tool results while defusing reply directives in transcript content, so future turns remember voice replies without treating spoken `MEDIA:` or voice tags as delivery metadata. (#68869) Thanks @zqchris.
49204920
- Providers/OpenAI: harden Voice Call realtime transcription against OpenAI Realtime session-update drift, forward language and prompt hints, and add live coverage for realtime STT.
4921-
- Agents/Pi embedded runs: suppress the "⚠️ Agent couldn't generate a response" warning when the assistant already delivered user-visible content through a messaging tool and the turn ended cleanly (`stopReason=stop`). Real failure modes (tool errors, provider `stopReason=error`, interrupted tool use) still surface the existing "verify before retrying" warning. Fixes #70396. (#70425) Thanks @neeravmakwana.
4921+
- Agents/Pi embedded runs: suppress the "⚠️ Agent couldn't generate a response" warning when the assistant already delivered user-visible content through a messaging tool and the turn ended cleanly (`stopReason=stop`). Real failure modes (tool errors, provider `stopReason=error`, interrupted tool use) still surface the existing "verify before retrying" warning. Fixes #70396. (#70425) Thanks @neeravmakwana.
4922+
- Auto-reply/WebChat: preserve the active session mapping when context-overflow recovery or auto-compaction fails, and return retry, `/compact`, and `/new` guidance instead of silently rotating to a fresh session. Fixes #70472. (#70479) Thanks @fuller-stack-dev.
49224923
- Gateway/Linux: wrap gateway-managed supervisor, PTY, MCP stdio, and browser child processes in a tiny `/bin/sh` shim that raises the child's own `oom_score_adj` on Linux, so under cgroup memory pressure the kernel prefers transient workers over the long-lived gateway. Opt out with `OPENCLAW_CHILD_OOM_SCORE_ADJ=0`. Fixes #70404. (#70419) Thanks @neeravmakwana.
49234924
- Providers/Moonshot: stop strict-sanitizing Kimi's native tool_call IDs (shaped like `functions.<name>:<index>`) on the OpenAI-compatible transport, so multi-turn agentic flows through Kimi K2.6 no longer break after 2-3 tool-calling rounds when the serving layer fails to match mangled IDs against the original tool definitions. Adds a `sanitizeToolCallIds` opt-out to the shared `openai-compatible` replay family helper and wires Moonshot to it. Fixes #62319. (#70030) Thanks @LeoDu0314.
49244925
- Dependencies/security: override transitive `uuid` to `14.0.0`, clearing the runtime advisory across dependencies.

docs/reference/session-management-compaction.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ tokens`, `input is too long for the model`, `ollama error: context length
276276
exceeded`, and similar provider-shaped variants) → compact → retry.
277277
If overflow recovery still fails, OpenClaw surfaces explicit guidance to the
278278
user and preserves the current session mapping instead of silently rotating
279-
the session key to a fresh session id.
279+
the session key to a fresh session id. The next step is operator-controlled:
280+
retry the message, run `/compact`, or run `/new` when a fresh session is
281+
preferred.
280282
2. **Threshold maintenance**: after a successful turn, when:
281283

282284
`contextTokens > contextWindow - reserveTokens`

src/auto-reply/reply/agent-runner-execution.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4400,9 +4400,7 @@ describe("runAgentTurnWithFallback", () => {
44004400

44014401
expect(result.kind).toBe("final");
44024402
if (result.kind === "final") {
4403-
expect(result.payload.text).toContain(
4404-
"kept this conversation mapped to the current session",
4405-
);
4403+
expect(result.payload.text).toContain("kept this conversation mapped to the current session");
44064404
expect(result.payload.text).toContain("reserveTokensFloor");
44074405
expectRecordFields(requireRecord(getReplyPayloadMetadata(result.payload), "reply metadata"), {
44084406
deliverDespiteSourceReplySuppression: true,
@@ -4445,9 +4443,7 @@ describe("runAgentTurnWithFallback", () => {
44454443

44464444
expect(result.kind).toBe("final");
44474445
if (result.kind === "final") {
4448-
expect(result.payload.text).toContain(
4449-
"kept this conversation mapped to the current session",
4450-
);
4446+
expect(result.payload.text).toContain("kept this conversation mapped to the current session");
44514447
expect(result.payload.text).toContain("reserveTokensFloor");
44524448
expectRecordFields(requireRecord(getReplyPayloadMetadata(result.payload), "reply metadata"), {
44534449
deliverDespiteSourceReplySuppression: true,

0 commit comments

Comments
 (0)