fix(compaction): forward abortSignal through delegateCompactionToRuntime bridge#93248
fix(compaction): forward abortSignal through delegateCompactionToRuntime bridge#932481052326311 wants to merge 1 commit into
Conversation
…ime bridge When a user presses the stop button during auto-compaction, the abort signal cancels the wait but the compaction LLM call continues in-flight and writes its result to the session transcript. This causes model confusion as the model receives only a compaction summary instead of the full context. The bridge gap: delegateCompactionToRuntime forwarded sessionId, sessionFile, tokenBudget, and other params, but not abortSignal. The runtime already accepts this field in CompactEmbeddedAgentSessionParams, but it was never populated by the delegate. Fix: forward params.abortSignal so the runtime can properly abort compaction when the stop button or safety timeout fires. Closes openclaw#89868
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate/superseded: the same compaction abort-signal bridge fix is already owned by an older open, mergeable, maintainer-modifiable PR with successful real-behavior-proof checks, while this newer branch lacks accepted proof and currently fails lint. Canonical path: Continue the fix through the existing canonical PR and close this duplicate branch instead of repairing two copies of the same change. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Continue the fix through the existing canonical PR and close this duplicate branch instead of repairing two copies of the same change. Do we have a high-confidence way to reproduce the issue? Yes. Current main can be source-reproduced by passing an Is this the best way to solve the issue? No for this PR as the landing vehicle. Forwarding the existing abort signal is the right code fix, but the older proof-positive PR is the better canonical path for that fix. Security review: Security review cleared: The diff only changes context-engine source and tests, with no dependency, workflow, secret, packaging, or code-download surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 0314819f918a. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
When a user presses the stop button during auto-compaction, the abort signal cancels the wait but the compaction LLM call continues in-flight and writes its result to the session transcript. This causes model confusion as the model receives only a compaction summary instead of the full context.
Closes #89868
Root cause
delegateCompactionToRuntimeforwardedsessionId,sessionFile,tokenBudget,currentTokenCount,force, andcustomInstructionstocompactEmbeddedAgentSessionDirect, but notabortSignal. The runtime already accepts this field inCompactEmbeddedAgentSessionParams(src/agents/embedded-agent-runner/compact.types.ts:96), but the delegate never populated it.The surrounding contract confirms abort propagation is expected:
compactContextEngineWithSafetyTimeoutalready composes and passes an abort signal into context-enginecompact()calls.Fix
One-line fix: forward
params.abortSignalfrom the delegate to the runtime compact call.Change Type
Scope
Evidence
Source-level reproduction (from ClawSweeper review, issue #89868):
src/context-engine/delegate.ts:54src/agents/embedded-agent-runner/compact.types.ts:91compaction-safety-timeout.ts:163Test coverage:
forwards abortSignal to the compaction runtime bridge— verifies signal pass-throughabortSignalis undefined when not provided (backward compat)@clawsweeper review