openclaw - ✅(Solved) Fix [Bug]: Intermittent deactivated_workspace after /new (session reset race with previous embedded run) !!! [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56832Fetched 2026-04-08 01:47:17
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1

After triggering /new, OpenClaw intermittently returns a raw internal error payload to chat ({"detail":{"code":"deactivated_workspace"}}) instead of cleanly resetting the session. This appears to happen when a previous embedded run is still draining during reset. Gateway and channels remain healthy, but the reset flow leaks the internal error to the user.

Error Message

After triggering /new, OpenClaw intermittently returns a raw internal error payload to chat ({"detail":{"code":"deactivated_workspace"}}) instead of cleanly resetting the session. This appears to happen when a previous embedded run is still draining during reset. Gateway and channels remain healthy, but the reset flow leaks the internal error to the user. • Gateway/channels remain healthy, but UX is broken by leaked internal error.

Root Cause

• Environment: Linux x64, Node v22.22.0. • Channels status at incident time: Telegram OK, WhatsApp OK, gateway healthy. • Suspected root cause: reset/session rotation can race with an in-flight embedded run; cleanup barrier/abort ordering may be incomplete.

PR fix notes

PR #213: Add upstream intelligence report from Scout

Description (problem / solution / changelog)

Added Scout report and journal files identifying inherited defects from the parent repository (openclaw/openclaw), including #56854, #56832, and #56892.


PR created automatically by Jules for task 7521594946744656005 started by @MillionthOdin16

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

  • Documentation
    • Added three new files documenting known issues, defect reports, and upstream problem tracking with detailed descriptions and impact assessments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Changed files

  • .jules/scout.md (added, +14/-0)
  • openclaw_issues.txt (added, +100/-0)
  • scout-report.txt (added, +19/-0)
  • test_output.log (added, +964/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After triggering /new, OpenClaw intermittently returns a raw internal error payload to chat ({"detail":{"code":"deactivated_workspace"}}) instead of cleanly resetting the session. This appears to happen when a previous embedded run is still draining during reset. Gateway and channels remain healthy, but the reset flow leaks the internal error to the user.

Steps to reproduce

  1. Run OpenClaw normally (Telegram direct chat is enough).
  2. Send a normal prompt so an embedded run is active/recent.
  3. Trigger /new while/shortly after that run is finishing.
  4. Repeat /new a few times (issue is intermittent).
  5. Check chat + logs.

Expected behavior

• /new should fully reset the session/workspace without exposing internal errors. • Previous run should be aborted/drained safely before session rotation. • User should not see raw JSON/internal backend codes.

Actual behavior

• User intermittently sees raw payload in chat: {"detail":{"code":"deactivated_workspace"}} • Logs show reset overlap symptoms (embedded run ends with deactivated_workspace). • Gateway/channels remain healthy, but UX is broken by leaked internal error.

OpenClaw version

2026.3.28

Operating system

Linux

Install method

No response

Model

gpt 5.3 codex

Provider / routing chain

codex oauth

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

• Environment: Linux x64, Node v22.22.0. • Channels status at incident time: Telegram OK, WhatsApp OK, gateway healthy. • Suspected root cause: reset/session rotation can race with an in-flight embedded run; cleanup barrier/abort ordering may be incomplete.

extent analysis

Fix Plan

To address the intermittent internal error payload issue, we need to ensure that the previous embedded run is safely aborted before resetting the session.

  • Step 1: Implement a cleanup barrier
    • Introduce a locking mechanism to prevent concurrent access to the session during reset.
    • Example (using Node.js and async/await):

const asyncMutex = require('async-mutex');

const mutex = new asyncMutex.Mutex();

async function resetSession() { await mutex.runExclusive(async () => { // Reset session logic here }); }

*   **Step 2: Abort in-flight embedded runs**
    *   Modify the `/new` trigger to wait for any ongoing embedded runs to complete or abort them if necessary.
    *   Example (using Node.js and async/await):
    ```javascript
async function triggerNew() {
  // Check for ongoing embedded runs
  if (embeddedRunInProgress) {
    // Abort the run if it's taking too long
    await abortEmbeddedRun();
  }
  // Proceed with session reset
  await resetSession();
}
  • Step 3: Handle deactivated workspace errors
    • Catch and handle deactivated_workspace errors to prevent them from being exposed to the user.
    • Example (using Node.js and try-catch):

try { // Code that may throw deactivated_workspace error } catch (error) { if (error.code === 'deactivated_workspace') { // Handle the error and reset the session cleanly await resetSession(); } else { // Rethrow or handle other errors throw error; } }


### Verification
To verify that the fix worked:

*   Repeat the steps to reproduce the issue.
*   Check the chat and logs for any instances of the raw internal error payload.
*   Verify that the session is reset cleanly without exposing internal errors.

### Extra Tips
*   Ensure that the locking mechanism is properly released after the session reset to prevent deadlocks.
*   Consider implementing a timeout for aborting in-flight embedded runs to prevent indefinite waits.
*   Review the error handling mechanism to ensure that it correctly handles other potential errors that may occur during the session reset process.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

• /new should fully reset the session/workspace without exposing internal errors. • Previous run should be aborted/drained safely before session rotation. • User should not see raw JSON/internal backend codes.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING