Skip to content

Turn-triggered context-engine maintenance is awaited inline and can stall the session lane #65220

@100yenadmin

Description

@100yenadmin

Problem

OpenClaw currently awaits context-engine turn maintenance inline. That means even when the assistant has already produced visible output, the session lane can remain occupied by maintenance work long enough to stall the next command, delay subagent completion announce, or make the system appear frozen.

This is especially painful in:

  • orchestrated runs with up to 4 subagents in write mode
  • read-heavy runs with up to 4 agents querying LCM concurrently
  • sessions where proactive maintenance and normal user traffic overlap

Why Plugin-Only Fixes Are Not Enough

lossless-claw can remove heavy foreground work, but the host still owns when turn maintenance runs. As long as the host awaits maintenance inline, the foreground lane can still be blocked.

We need a host-level primitive for hidden, idle-aware background maintenance that can coalesce per session and avoid any visible subagent/announce path.

Goal

Add a host-side background maintenance path for context engines so proactive turn maintenance never blocks the next foreground user turn.

Acceptance Criteria

  • Proactive turn maintenance no longer blocks the next foreground user turn.
  • There is one pending maintenance task per session key, coalesced if more requests arrive.
  • Maintenance waits for the session lane to be idle or yields to active user work.
  • The maintenance path is hidden:
    • no visible subagent session
    • no announce flow
  • Overflow/timeout recovery compaction remains synchronous.
  • User-visible status remains subtle and limited to long-running or failed maintenance.

Validation Notes

  • Reproduce with one orchestrator plus multiple subagents and confirm the session lane stays responsive.
  • Reproduce with read-heavy LCM traffic and confirm background maintenance does not block reads.
  • Verify background maintenance state is visible in task/status tooling without creating user-facing subagent noise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions