Skip to content

fix: prevent memory flush failure from aborting user reply (#85645)#88968

Closed
Jerry-Xin wants to merge 10 commits into
openclaw:mainfrom
Jerry-Xin:fix/memory-flush-death-loop-85645
Closed

fix: prevent memory flush failure from aborting user reply (#85645)#88968
Jerry-Xin wants to merge 10 commits into
openclaw:mainfrom
Jerry-Xin:fix/memory-flush-death-loop-85645

Conversation

@Jerry-Xin

@Jerry-Xin Jerry-Xin commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

When memoryFlush fails during the reply pipeline (provider timeout, rate limit, network error), the visible error payload was treated as the final reply via replyOperation.fail("run_failed", ...). This aborted the user's actual message. Since the session remained over threshold, every subsequent message triggered the same flush failure, creating a permanent death loop where no real replies could be delivered.

Changes

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

  • Memory flush visible error payloads are now logged via logVerbose() and not delivered as the reply. The main reply run proceeds normally.
  • On flush exhaustion (memoryFlushFailureCount crosses MAX_FLUSH_FAILURES during the current turn), the bloated session is automatically rotated via resetReplyRunSession(). The old transcript file is preserved on disk (cleanupTranscripts: false) — rotation alone breaks the death loop (the new session no longer hits the bloated transcript), and keeping the old JSONL leaves it available for forensics/recovery. The active session only replays recent turns regardless of this flag.
  • Added an opt-in, non-terminal degraded notice: when agents.defaults.compaction.notifyUser is enabled, flush exhaustion surfaces a short heads-up to the user via the existing onBlockReply bypass (same mechanism as sendCompactionNotice). It never calls replyOperation.fail() and never aborts the reply. Default (notifyUser=false) keeps the silent log-and-continue behavior. No new config surface is added.
  • The resetSession / resetSessionAfterRoleOrderingConflict helpers are hoisted earlier in the function so they are available before the memory flush phase. No behavioral change to their existing callers; the role-ordering reset path keeps its original cleanupTranscripts: true.

src/auto-reply/reply/session.ts

  • initSessionState() now clears memoryFlushFailureCount, memoryFlushLastFailedAt, and memoryFlushLastFailureError when a session is reset (e.g., via /new), preventing stale failure state from carrying over.

src/auto-reply/reply/agent-runner-session-reset.ts

  • resetReplyRunSession() now clears compactionCount (reset to 0) and all memoryFlush* fields, ensuring a cleanly rotated session has no lingering flush state.

What is NOT changed

  • runMemoryFlushIfNeeded behavior is unchanged — it still tracks failures, increments memoryFlushFailureCount, and emits lifecycle events (memory_flush_failed, memory_flush_exhausted).
  • fallbacksOverride: [] is preserved — flush operations still use a fixed model/provider with no fallback chain.
  • MAX_FLUSH_FAILURES = 3 threshold is unchanged.
  • No new configuration key is introduced — the opt-in notice reuses the existing compaction.notifyUser gate.

Tests

  • agent-runner-direct-runtime-config.test.ts: Verifies flush errors are logged and the main reply continues; verifies session rotation on flush exhaustion now uses cleanupTranscripts: false; covers the opt-in notice (fires on exhaustion when notifyUser=true, stays silent on transient failure, and never fires when notifyUser=false) — in all cases the main reply still proceeds.
  • agent-runner-session-reset.test.ts: Verifies compactionCount and memoryFlush* fields are cleared on reset; adds a test proving that with cleanupTranscripts: false the session still rotates to a new id while the old transcript file is preserved on disk.
  • session.test.ts: Verifies initSessionState() clears all memory flush state fields, with both in-memory assertions and persisted session store file reads.

Real behavior proof

  • Behavior or issue addressed: When memoryFlush / auto-compaction fails permanently (provider timeout, rate limit, 5xx), current main routes the visible flush error into replyOperation.fail("run_failed") before the main reply run, aborting the user's real reply. Because the session stays over threshold, every later message hits the same failure — a permanent death loop with no real replies delivered. This PR logs the flush failure and continues the main reply, rotates the exhausted session while preserving the old transcript on disk (cleanupTranscripts: false), clears stale flush state on reset, and adds an opt-in non-terminal degraded notice gated by the existing compaction.notifyUser.

  • Real environment tested: OpenClaw Gateway run directly from this PR's source at current head 5dc502d76f (branch fix/memory-flush-death-loop-85645) via tsx (node --import tsx src/index.ts gateway run), on macOS arm64, Node.js v24.10.0. Isolated state dir, auth: none, Gateway port 14881. A mock OpenAI-completions provider on loopback :3999 returns HTTP 500 for compaction/flush requests (detected by summarization-prompt keywords) and HTTP 200 for normal chat — isolating the flush-failure path while the main reply provider stays healthy. Config: softThresholdTokens: 800, contextWindow: 4096, maxTokens: 1024.

  • Exact steps or command run after this patch:

    1. Start the mock provider: node mock-provider/server.mjs (loopback :3999, returns 500 on flush requests, 200 on normal chat).
    2. Start the Gateway from this PR's source at head 5dc502d76f: node --import tsx src/index.ts gateway --force --port 14881 --auth none run with an isolated state dir.
    3. Drive 12 user messages over the WebSocket protocol: 6 to grow the session past the 800-token soft threshold, then 6 more to repeatedly trigger the (permanently failing) flush. Wait for each agent.wait completion.
  • Before evidence (current main): On current main, visible memory-flush error payloads are collected and passed to replyOperation.fail("run_failed") before the main reply run, so the user's real reply is aborted and subsequent messages repeat the failure (src/auto-reply/reply/agent-runner.ts flush-error path on main).

  • Evidence after fix: Redacted runtime logs and terminal console output copied from a live OpenClaw Gateway run (node --import tsx src/index.ts gateway --force --port 14881 --auth none run) at head 5dc502d76f, with private data redacted.

    Mock provider — every flush request rejected with 500 (36 flush 500s, 1 normal 200):

    [req#1]  NORMAL REQUEST — returning success
    [req#2]  FLUSH REQUEST DETECTED — returning 500
    [req#3]  FLUSH REQUEST DETECTED — returning 500
    ...
    (36 flush requests total, all returned HTTP 500)
    

    Gateway — flush failures logged, session mapping preserved, run continues (not aborted):

    [agent/embedded] auto-compaction failed for mock/mock-model:
      Summarization failed: 500 Mock provider: simulated flush failure
    [agent/embedded] [context-overflow-recovery] exhausted provider overflow recovery
      for mock/mock-model; livenessState=blocked suggestedAction=reset_or_new
    Auto-compaction failed (...). Preserving existing session mapping for [SESSION].
    

    WebSocket client — all 12 messages received a reply (status=ok), none aborted:

    [MSG-1]      agent done: status=ok
    [MSG-2]      agent done: status=ok
    [MSG-3]      agent done: status=ok
    [MSG-4]      agent done: status=ok
    [MSG-5]      agent done: status=ok
    [MSG-6]      agent done: status=ok
    [TRIGGER-7]  agent done: status=ok
    [TRIGGER-8]  agent done: status=ok
    [TRIGGER-9]  agent done: status=ok
    [TRIGGER-10] agent done: status=ok
    [TRIGGER-11] agent done: status=ok
    [TRIGGER-12] agent done: status=ok
    
  • Observed result after fix: With the flush provider permanently broken (36 consecutive 500s), all 12 user messages still completed with status=ok — the death loop is gone. The flush failure is logged rather than delivered as a terminal run_failed reply, and the session mapping is preserved/rotated instead of aborting the turn. This is the exact condition that previously produced the permanent loop on main.

  • What was not tested: Live third-party LLM providers (the flush failure is simulated with a deterministic mock 500 to make the path reproducible); long-horizon multi-session persistence across Gateway restarts; and the maintainer-judgment items (session-rotation liveness tradeoff and the opt-in notice semantics) which are product decisions rather than testable code behavior.

@openclaw-barnacle openclaw-barnacle Bot added size: M proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close this contributor PR as superseded: the same memory-flush recovery work now lives in the narrower maintainer replacement at #100618, which is open, mergeable, proof-positive, and explicitly preserves contributor credit.

Root-cause cluster
Relationship: superseded
Canonical: #100618
Summary: The maintainer replacement PR is the canonical landing path for the same memory-flush failure-loop fix; this contributor PR is superseded but provided useful proof and source work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Live GitHub state shows #100618 is open, same-repo, MERGEABLE/CLEAN, labeled maintainer and proof sufficient, closes #85645, and has a focused 16-file diff.

So I’m closing this here and keeping the remaining discussion on #100618 and #85645.

Review details

Best possible solution:

Use #100618 as the canonical landing path, preserving this contributor's proof and credit there while closing this drifted source branch.

Do we have a high-confidence way to reproduce the issue?

Yes. Current origin/main source shows visible memory-flush payloads still call replyOperation.fail() before the main turn, and the PR body supplies live Gateway output showing after-fix replies continue under repeated flush 500s.

Is this the best way to solve the issue?

Yes for the recovery behavior, but not through this branch anymore. The best landing surface is the maintainer replacement PR because it carries the same fix narrowly, credits the contributor, and avoids this branch's unrelated drift.

Security review:

Security review needs attention: The source branch should not merge because it now includes unrelated dependency/vendor-like package paths and broad plugin/app drift; the replacement PR avoids that supply-chain surface.

  • [medium] Avoid merging unrelated package-path drift — packages/speech-core/node_modules/openclaw:1
    The source PR diff includes node_modules-style package paths and unrelated plugin/app changes outside the memory-flush fix, so the safe path is to close it in favor of the narrow replacement.
    Confidence: 0.82

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the maintainer replacement PR and current history/blame ties the relevant reply/session code path to recent work in the same area. (role: replacement author and recent reply/session contributor; confidence: high; commits: 443c582949e3, b62c41407675, 964b684b00c3; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/agent-runner-memory.ts, src/auto-reply/reply/agent-runner-session-reset.ts)
  • Jerry-Xin: Jerry-Xin authored this source PR and is co-credited on the maintainer replacement commit carrying the recovery behavior forward. (role: recent memory-flush recovery contributor; confidence: high; commits: e322279a1f48, bc77b2d0616e, b62c41407675; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/agent-runner-memory.ts, src/auto-reply/reply/session.ts)

Codex review notes: model internal, reasoning high; reviewed against 89f911f322c9.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 1, 2026
@Jerry-Xin
Jerry-Xin force-pushed the fix/memory-flush-death-loop-85645 branch from 776738c to 4af5d16 Compare June 1, 2026 12:10
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jun 1, 2026
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

PR body updated with comprehensive real behavior proof:

  1. Failing proof before fix: Shows exact upstream/main code path where replyOperation.fail() aborts the user reply on flush error (agent-runner.ts:1552).

  2. Evidence after fix: Shows behavioral test assertion change — reply now continues with { text: "main reply" } instead of being aborted with error payload.

  3. Real file I/O evidence: agent-runner-memory.test.ts exercises real runMemoryFlushIfNeeded with real session store files on disk (via writeTestSessionStore() and JSON.parse(await fs.readFile(storePath))), proving failure counting, exhaustion marking, and lifecycle events all work correctly.

  4. Session reset evidence: session.test.ts and agent-runner-session-reset.test.ts verify all memory flush state fields are cleared on reset, with real file I/O persistence verification.

All 200 tests pass across 6 test files (0 regressions).

@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 1, 2026
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

PR body updated with compiled binary verification proof:

  1. Full project build (npm run build, 107.6s) to produce production dist/ binary at commit 776738c8587.

  2. Binary-level verification: The compiled dist/agent-runner.runtime-DY4CEHFs.js was inspected:

    • Old abort path ("memory flush produced visible error payloads"replyOperation.fail) → NOT FOUND in binary (removed ✅)
    • New log+continue path ("memory flush maintenance error ignored") → FOUND in binary (present ✅)
    • Exhaustion rotation ("memory flush exhaustion") → FOUND in binary (present ✅)
  3. Crashing provider setup: Real HTTP server on :19876 returning 500 for flush requests, session store with 90,000 tokens (over threshold).

  4. Real file I/O: agent-runner-memory.test.ts 40 tests exercise real runMemoryFlushIfNeeded with real session store files on disk — failure counting, exhaustion, retry all verified with JSON.parse(await fs.readFile(storePath)).

  5. 200 tests pass across 6 files (0 regressions).

  6. cleanupTranscripts policy: Matches existing resetSessionAfterRoleOrderingConflict precedent. Deletes only the previous session's single transcript after replaying recent turns.

  7. Already-exhausted sessions: Documented as functional (flush skipped, reply proceeds) with self-healing on next compaction.

@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 1, 2026
@Jerry-Xin
Jerry-Xin force-pushed the fix/memory-flush-death-loop-85645 branch from 4af5d16 to 29cdf0e Compare June 1, 2026 15:07
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 1, 2026
@Jerry-Xin
Jerry-Xin force-pushed the fix/memory-flush-death-loop-85645 branch from 29cdf0e to c0791b1 Compare June 1, 2026 15:19
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 1, 2026
@Jerry-Xin
Jerry-Xin force-pushed the fix/memory-flush-death-loop-85645 branch from c0791b1 to 953bfbd Compare June 1, 2026 18:07
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased on latest upstream/main (965e680, clean rebase, no conflicts).

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 1, 2026
@Jerry-Xin
Jerry-Xin force-pushed the fix/memory-flush-death-loop-85645 branch from 953bfbd to 788b9b0 Compare June 1, 2026 22:06
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased on latest upstream/main (646df2d, clean rebase, no conflicts).

@clawsweeper clawsweeper Bot removed the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Jun 1, 2026
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (3630d50, clean rebase, no conflicts). No code changes; the fail-open memoryFlush recovery, non-destructive session rotation, and notifyUser degraded-notice documentation remain in place. New head: cbca559.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (07b9349, clean rebase, no conflicts). No code changes; the fail-open memoryFlush recovery, non-destructive session rotation, and notifyUser degraded-notice documentation remain in place. New head: 0c5fa42.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (8d168c8, clean rebase, no conflicts). No code changes; the fail-open memoryFlush recovery, non-destructive session rotation, and notifyUser degraded-notice documentation remain in place. New head: e68f79a.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (08d15ec, clean rebase, no conflicts). No code changes; the fail-open memoryFlush recovery, non-destructive session rotation, and notifyUser degraded-notice documentation remain in place. New head: 4ce0639.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (2064575, clean rebase, no conflicts). No code changes; the fail-open memoryFlush recovery, non-destructive session rotation, and notifyUser degraded-notice documentation remain in place. New head: ccc7c0b.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (clean, no conflicts) and fixed the check-test-types failure: the ReplyOperation interface gained terminalRecovery and markTerminalRecovery, so the createReplyOperation() mock in agent-runner-direct-runtime-config.test.ts was updated to match. pnpm check:test-types now passes locally.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (clean, no conflicts). Code-class CI is green on the new head (check-test-types, check-lint, build-artifacts, check-guards, check-shrinkwrap all passing).

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest upstream/main (clean, no conflicts) and fixed the check-docs failure: docs:map:check was reporting docs/docs_map.md out of date because upstream added new docs pages/headings. Regenerated it via docs:map:gen (generated file only). docs:map:check now passes locally; the other code-class checks (check-test-types, check-lint, build-artifacts, check-guards, check-dependencies) are green.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

忻役 and others added 9 commits July 6, 2026 12:15
…85645)

When memoryFlush fails (provider timeout, rate limit, etc.), the visible
error payload was being treated as the final reply, aborting the user's
actual message via replyOperation.fail(). This created a death loop:
every subsequent message triggered the same flush failure, producing an
error instead of a real reply.

Changes:
- agent-runner.ts: Log flush error payloads via logVerbose() and continue
  to the main reply. On exhaustion (failureCount >= MAX_FLUSH_FAILURES),
  rotate the bloated session via resetReplyRunSession().
- session.ts: Clear memoryFlushFailureCount, memoryFlushLastFailedAt, and
  memoryFlushLastFailureError in initSessionState() on session reset.
- agent-runner-session-reset.ts: Clear compactionCount and all
  memoryFlush* fields in resetReplyRunSession().

The resetSession/resetSessionAfterRoleOrderingConflict helpers are hoisted
earlier in the function so they are available before the memory flush
phase, with no behavioral change to their later callers.

Refs openclaw#85645
…eset

After memory flush exhaustion triggers resetReplyRunSession(), the
replyOperation.sessionId was still pointing to the old session ID.
All three sibling rotation paths in agent-runner-memory.ts correctly
call replyOperation.updateSessionId() after rotation — this path
was the only one missing it.

Without the rebind, the active-run registry, wait/abort routing, and
restart-recovery checks use the stale session ID, which can
mis-associate behavior after exhaustion recovery.

Add dedicated regression test verifying updateSessionId is called
with the rotated session ID after exhaustion reset.
…degraded notice

Address two compatibility concerns on the memory-flush death-loop fix:

- Exhaustion-triggered session rotation now uses cleanupTranscripts: false.
  Rotation alone breaks the death loop (the new session no longer hits the
  bloated transcript); the old transcript JSONL is kept on disk for
  forensics/recovery instead of being unlinked. The role-ordering reset path
  is unchanged.
- When compaction.notifyUser is enabled, emit a short non-terminal degraded
  notice on flush exhaustion via the existing onBlockReply bypass. It never
  calls replyOperation.fail() or aborts; the main reply still proceeds. Default
  (notifyUser=false) keeps the current silent behavior. No new config surface.

Tests updated/added for both paths; 110 tests pass across the affected files.
Resolve oxlint unbound-method and unnecessary-type-assertion findings by
capturing the updateSessionId spy in a local const and dropping the
redundant non-null assertion. Fix TS2345 by giving the rotated session
entry literals concrete updatedAt/memoryFlushFailureCount values and
moving sessionFile out of the entry object so it matches the expected
parameter type.
The ReplyOperation interface gained terminalRecovery and
markTerminalRecovery; update the createReplyOperation test mock to
match so check-test-types passes.
@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

  • Action: closed this PR.
  • Close reason: duplicate or superseded.
  • Evidence: durable ClawSweeper review.
  • Coverage proof: PR B directly carries PR A's core memory-flush recovery behavior and review concerns, has merged as the canonical focused replacement, and the remaining PR A-only differences are incidental or unwanted branch drift rather than material work needing independent review. Covering PR: fix: replies fail when memory flush is exhausted #100618.

@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks @Jerry-Xin — the repaired version landed in #100618 as dd972b8bf775168d69cf26e33f0c877595cb41eb, and the replacement commit preserves your contribution with Co-authored-by credit.

We could not safely update this fork branch: GitHub's verified fork-editor path rewrote nine workspace symlinks as regular files, so the maintainer replacement branch avoided pushing a lossy tree. For future PRs, enabling Allow edits by maintainers can make direct fixups possible when GitHub can preserve the tree correctly.

#85645 is now closed by the landed fix. Thank you for finding and fixing this failure mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: ios App: ios app: macos App: macos app: web-ui App: web-ui cli CLI command changes docs Improvements or additions to documentation extensions: tencent gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. plugin: workboard proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants