Summary
When using the browser tool (via Browser Relay Chrome extension), the session enters a deadlock state during post-response compaction. The compaction process gets stuck in a retry loop, creates a stale .lock file, and never completes. This causes the typing indicator to expire after 2 minutes, making the bot appear "offline" to users.
Steps to reproduce
- Start OpenClaw gateway with default configuration
- Install and configure Browser Relay Chrome extension
- Connect extension to gateway (localhost:18789)
- Send a message to the bot that triggers browser tool usage
- Bot responds successfully but then enters compaction
- Compaction gets stuck in retry loop
- After 2 minutes, typing TTL expires and bot appears "offline"
- Node Version: 22.22.0
- Model: Google Gemini 2.5 Flash
- Context Window: 100,000 tokens
- Channel: Telegram
Expected behavior
- Compaction should complete within a few seconds
- Session should remain responsive after browser tool usage
- No stale lock files should remain
Actual behavior
- Compaction enters retry loop and never completes
- Session lock file (
*.jsonl.lock) remains indefinitely
- Bot becomes unresponsive (typing TTL expires)
- User perceives bot as "offline"
OpenClaw version
2026.2.17
Operating system
macOS (darwin)
Install method
node
Logs, screenshots, and evidence
2026-02-19T20:09:10.775Z [agent] embedded run tool start: tool=browser
2026-02-19T20:09:10.809Z [agent] embedded run tool end: tool=browser
2026-02-19T20:09:12.027Z [agent] embedded run agent end: isError=false
2026-02-19T20:09:12.028Z [agent] embedded run compaction start
2026-02-19T20:09:13.411Z [agent] embedded run compaction retry <-- STUCK HERE
2026-02-19T20:11:12.030Z typing TTL reached (2m); stopping typing indicator
Note: There is NO `embedded run done` log entry - the session never completes.
## Session Lock File
After the issue occurs, a stale lock file is present:
/Users/kameltakla/.openclaw/agents/main/sessions/<session-id>.jsonl.lock
This lock file prevents subsequent operations from proceeding.
Impact and severity
-
Remove stale lock files:
rm -f ~/.openclaw/agents/main/sessions/*.lock
-
Restart gateway:
pkill -f openclaw-gateway
openclaw gateway run --bind loopback --port 18789
-
Start a new session with /new before using browser features
Root Cause Analysis
The issue appears to be in the compaction logic when triggered after browser tool usage:
- Browser tool execution completes successfully
- Post-response compaction is triggered
- Compaction acquires a session lock
- Something in the browser tool context prevents compaction from completing
- Compaction enters retry loop but never succeeds
- Lock is never released
- Session is effectively deadlocked
Frequency
- Reproducible: Yes, consistently when using browser tool
- Frequency: 100% of browser tool invocations trigger this issue
Configuration
{
"agents": {
"defaults": {
"model": {
"primary": "google/gemini-2.5-flash"
},
"contextTokens": 100000
}
},
"tools": {
"elevated": { "enabled": true },
"fs": { "workspaceOnly": true },
"exec": { "applyPatch": { "workspaceOnly": true } }
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback"
}
}
Additional Context
- The issue does NOT occur with other tools (read, write, web_search, etc.)
- The issue occurs specifically after the
browser tool completes its operation
- The browser tool itself works correctly - the issue is in the post-tool compaction phase
- Switching models (gemini-2.5-pro vs gemini-2.5-flash) does not resolve the issue
- Increasing context window from 16,000 to 100,000 does not resolve the issue
Related Files
- Session files:
~/.openclaw/agents/main/sessions/*.jsonl
- Lock files:
~/.openclaw/agents/main/sessions/*.lock
- Gateway logs:
~/.openclaw/logs/gateway.log
- Agent logs:
/tmp/openclaw/openclaw-YYYY-MM-DD.log
Additional information
No response
Summary
When using the
browsertool (via Browser Relay Chrome extension), the session enters a deadlock state during post-response compaction. The compaction process gets stuck in a retry loop, creates a stale.lockfile, and never completes. This causes the typing indicator to expire after 2 minutes, making the bot appear "offline" to users.Steps to reproduce
Expected behavior
Actual behavior
*.jsonl.lock) remains indefinitelyOpenClaw version
2026.2.17
Operating system
macOS (darwin)
Install method
node
Logs, screenshots, and evidence
Impact and severity
Remove stale lock files:
Restart gateway:
Start a new session with
/newbefore using browser featuresRoot Cause Analysis
The issue appears to be in the compaction logic when triggered after browser tool usage:
Frequency
Configuration
{ "agents": { "defaults": { "model": { "primary": "google/gemini-2.5-flash" }, "contextTokens": 100000 } }, "tools": { "elevated": { "enabled": true }, "fs": { "workspaceOnly": true }, "exec": { "applyPatch": { "workspaceOnly": true } } }, "gateway": { "port": 18789, "mode": "local", "bind": "loopback" } }Additional Context
browsertool completes its operationRelated Files
~/.openclaw/agents/main/sessions/*.jsonl~/.openclaw/agents/main/sessions/*.lock~/.openclaw/logs/gateway.log/tmp/openclaw/openclaw-YYYY-MM-DD.logAdditional information
No response