Skip to content

[Bug]: Slack inbound wedge after context overflow/compaction; Socket Mode remains connected but replies stop #96836

Closed as not planned

Description

@josephtchung

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Slack inbound wedge after context overflow / compaction; Socket Mode stays connected but messages stop producing replies

Environment

  • OpenClaw: 2026.6.10 aa69b12
  • Host: Linux 6.1.163-186.299.amzn2023.x86_64, Node 24.15.0
  • Runtime/model: OpenAI Codex, gpt-5.5, 272k context
  • Channel: Slack via external @openclaw/slack plugin, Socket Mode
  • Instance: staging, loopback Gateway on 127.0.0.1:18790

Symptom

Slack stops responding to inbound messages even though:

  • Gateway is reachable/healthy
  • Slack channel status says OK
  • Slack Socket Mode logs slack socket mode connected
  • outbound Slack sends still work
  • no obvious Slack token/auth failure

Inbound Slack messages appear not to create/advance a successful agent reply.

Expected

Slack inbound messages should enqueue/dispatch normally, or stale active work should be force-cleared so the lane recovers.

Actual

Slack/main session lane gets wedged after context overflow/compaction. Recovery detects stale session state but repeatedly skips because it thinks there is active reply work.

Representative logs:

context overflow detected ... attempting auto-compaction for openai/gpt-5.5
[compaction] rotated active transcript after compaction
auto-compaction succeeded ... retrying prompt

### Steps to reproduce

Use slack until compaction


### Expected behavior

Should compact and continue without interruption

### Actual behavior

Slack channel becomes unresponsive

### OpenClaw version

2026.06.10

### Operating system

Linux 6.1.163-186.299.amzn2023.x86_64

### Install method

npm

### Model

gpt-5.5 medium

### Provider / routing chain

openclaw->Slack

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

No response

Activity

  1. clawsweeper commented on Jun 25, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 25, 2026, 1:39 PM ET / 17:39 UTC.

    Summary
    Keep open. The older dormant follow-up and stale active-run fixes are already in the reported v2026.6.10 build, but current main is not proven to fix this newer Slack plus Codex compaction wedge and still has the threshold-gated active_reply_work recovery path.

    Reproducibility: no. high-confidence live reproduction was run. The reporter supplied v2026.6.10 Slack/Codex logs, and current source still contains the compaction retry and active_reply_work keep-lane path needed for the reported failure shape.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Share version, platform, channel/provider, and relevant config details.

    Next step
    The issue has concrete source and release evidence but needs maintainer scoping plus live Slack/Codex reproduction before any automated fix lane is safe.

    Review details

    Best possible solution:

    Keep this open until maintainers can prove the Slack/Codex compaction path and land a focused reply-owner or diagnostic-recovery fix with live or Crabbox evidence that queued inbound Slack messages resume.

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

    No high-confidence live reproduction was run. The reporter supplied v2026.6.10 Slack/Codex logs, and current source still contains the compaction retry and active_reply_work keep-lane path needed for the reported failure shape.

    Is this the best way to solve the issue?

    Unclear. The best fix is likely at the reply-owner cleanup or diagnostic recovery boundary, but maintainers need to choose the liveness semantics and prove the Slack/Codex compaction trigger before changing recovery behavior.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live Slack plus Codex current-main reproduction was run, so the exact timing and transport split remain unproven.
    • The issue body contains a short representative log sequence but not the full recovery loop around active_reply_work and stale progress.
    • A recovery change that force-clears too aggressively could abort legitimate slow active work unless it is bounded by terminal-progress or liveness proof.

    Codex review notes: model internal, reasoning high; reviewed against 7cce191b0530.

    Label changes

    Label changes:

    • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.

    Label justifications:

    • P1: A real Slack workflow can stop producing replies after compaction while Gateway health and Socket Mode still look connected.
    • impact:message-loss: The report is about inbound Slack messages not producing agent replies while the lane is wedged.
    • impact:session-state: The suspected failure is stale reply/session state after Codex compaction and terminal run progress.
    Evidence reviewed

    What I checked:

    • Live issue state: The live issue is open, externally authored, labeled bug/regression/P1, and reports OpenClaw v2026.6.10 with Slack Socket Mode and OpenAI Codex gpt-5.5 wedging after context overflow detected, transcript rotation, and auto-compaction success.
    • Older queue fix shipped before the reported release: GitHub compare shows v2026.6.10 is ahead of the fix(queue): restart dormant followup drains #95039 merge commit with behind_by=0, so the older dormant follow-up drain fix is already present in the reporter's build and does not close this report by itself. (023993249f35)
    • Current recovery can still keep active reply work: Current main checks broad active reply work and returns status=skipped, action=keep_lane, reason=active_reply_work when the stale-progress threshold is not reached. (src/logging/diagnostic-stuck-session-recovery.runtime.ts:193, 7cce191b0530)
    • Reporter log shape matches current overflow compaction path: The embedded runner logs context overflow, runs context-engine compaction, adopts the result, then logs auto-compaction succeeded ... retrying prompt, matching the representative sequence in the issue. (src/agents/embedded-agent-runner/run.ts:2639, 7cce191b0530)
    • Current code records post-compaction transcript rotation: The compaction implementation still logs [compaction] rotated active transcript after compaction, another message from the report's sequence. (src/agents/embedded-agent-runner/compact.ts:1546, 7cce191b0530)
    • Codex native compaction contract inspected: Sibling Codex source defines thread/compact/start as a thread-scoped RPC taking thread_id and returning an empty immediate response, so OpenClaw must own the surrounding session/recovery lifecycle. (../codex/codex-rs/app-server-protocol/src/protocol/common.rs:577, 268328001f89)

    Likely related people:

    • openperf: Authored fix(diagnostics): reclaim wedged session lanes with a stale leaked active run #86056, the merged stale active-run recovery fix in the central stuck-session recovery runtime that directly touches the active_reply_work behavior. (role: active-reply recovery contributor; confidence: high; commits: 6f76d9f246a3, f194be19e261; files: src/logging/diagnostic-stuck-session-recovery.runtime.ts, src/logging/diagnostic.ts)
    • steipete: Authored fix(queue): restart dormant followup drains #95039 for the older dormant follow-up drain race and appears repeatedly in adjacent queue, diagnostic, and Codex compaction history. (role: adjacent queue and recovery contributor; confidence: high; commits: 023993249f35, 44d5330993ce, ae4ab2a41fb7; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/queue/enqueue.ts, extensions/codex/src/app-server/compact.ts)
    • joshavant: Authored Fix context-engine compaction ownership for Codex sessions #91590, the merged context-engine and Codex native compaction ownership work intersecting the reported Codex app-server compaction path. (role: Codex compaction ownership contributor; confidence: high; commits: a8d33f23a09d, e0405ecc9bd6; files: extensions/codex/src/app-server/compact.ts, src/agents/embedded-agent-runner/compact.queued.ts, src/agents/embedded-agent-runner/compact.hooks.test.ts)
    • vincentkoc: Recent GitHub history shows work on auto-reply followups and embedded runner surfaces adjacent to reply/session lifecycle and compaction retry behavior. (role: recent auto-reply and embedded-runner contributor; confidence: medium; commits: 3179692f0e44, 31a65e0647ae, 2b75806197ab; files: src/auto-reply/reply/agent-runner.ts, src/agents/embedded-agent-runner/run.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on Jun 25, 2026
  3. shannon0430 commented on Jul 3, 2026

    @shannon0430
    Contributor

    Additional live repro / operator evidence from an OpenClaw Slack agent on 2026-07-03 (JST).

    Observed user-visible symptom:

    :warning: Context is too large and auto-compaction could not recover this turn. Try again, use /compact, or use /new to start a fresh session.
    

    Runtime/environment:

    • OpenClaw: 2026.6.10
    • macOS: 26.3, arm64
    • Gateway health during incident: {"ok":true,"status":"live"}
    • Slack Socket Mode process remained running; gateway itself was not dead.
    • Agent config already had defensive scoping enabled:
      • session.dmScope="per-channel-peer"
      • channels.slack.thread.historyScope="thread"
      • channels.slack.thread.inheritParent=false
      • Slack streaming off

    Important state found during recovery:

    • The affected direct Slack session was still bound to an old peer-wide key shaped like agent:main:slack:direct:<peer>.
    • The corresponding session file was 2,001,720 bytes with 601 JSONL entries.
    • Recent entries included very large tool outputs and encrypted reasoning blocks.
    • The session did not recover by relying on auto-compaction; the same Slack user kept receiving the generic overflow fallback.

    Immediate operator remediation that restored the agent path:

    1. Backed up agents/main/sessions/sessions.json.
    2. Backed up and renamed the affected large JSONL session file.
    3. Removed only the affected direct Slack session key from sessions.json.
    4. Restarted the Gateway via LaunchAgent.
    5. Verified /health returned {"ok":true,"status":"live"} and the affected direct key was absent.

    This looks like the product gap is not just "tell the user to /new". For Slack/Gateway agents, when auto-compaction cannot recover a turn, OpenClaw should probably be able to mark that exact session key as overflowed and start a fresh session on the next inbound message, while preserving the old JSONL as an archive. Otherwise a non-technical Slack user remains stuck even though Socket Mode and Gateway health are green.

  4. openclaw-barnacle commented on Jul 18, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. openclaw-barnacle commented on Jul 26, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.

  6. locked as resolved and limited conversation to collaborators on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.regressionBehavior that previously worked and now failsstaleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions