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:987 — triggerWrap 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
- Launch an OpenClaw session in webui mode (not ssh/tmux).
- Attempt a session wrap.
- 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.
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 withtmuxSession: null.lib/sessions.js:987—triggerWraprequires a non-nulltmuxSessionbefore 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
triggerWrapand run the server-side (non-tmux) V2 wrap path. The tmux requirement should be relaxed/branched so atmuxSession: nullwebui session routes to the server-side wrap instead of being skipped.Repro
tmuxSessionguard atsessions.js:987short-circuits).Notes
lib/sessions.js; regression test belongs intest/sessions-webui.test.js/test/session-wrapper.test.js.