Skip to content

[bug] WebUI/OpenClaw sessions can never be wrapped — triggerWrap requires tmuxSession but webui records null #334

Description

@Jason-Vaughan

What

WebUI-launched sessions (including OpenClaw webui sessions) can never be wrapped. The session-wrap trigger is gated on a tmux session handle that webui sessions never have.

Why / root cause

Verified during the 4.0 methodology re-arch design (6-agent code read, 2026-06-12):

  • lib/sessions.js:363 — webui-mode sessions are recorded with tmuxSession: null.
  • lib/sessions.js:987triggerWrap requires a non-null tmuxSession before it will run.

So any session created via the webui transport falls through the wrap gate silently: no L2 wrap pipeline, no hooks, no Critic — even though the V2 wrap pipeline is server-side and does not actually need a tmux pane.

Expected behavior

WebUI sessions should reach triggerWrap and run the server-side (non-tmux) V2 wrap path. The tmux requirement should be relaxed/branched so a tmuxSession: null webui session routes to the server-side wrap instead of being skipped.

Repro

  1. Launch an OpenClaw session in webui mode (not ssh/tmux).
  2. Attempt a session wrap.
  3. Observe the wrap never triggers (the tmuxSession guard at sessions.js:987 short-circuits).

Notes

  • Folded into the 4.0 build plan as chunk 0 (smallest first step). Fix lives in lib/sessions.js; regression test belongs in test/sessions-webui.test.js / test/session-wrapper.test.js.
  • Verify the server-side V2 wrap path itself doesn't assume a tmux pane capture before relying on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions