Step-by-Step Fix
1. Open the Run Log and Identify the Stuck Point
In the OpenClaw dashboard, navigate to Runs or Run History. Click on the stuck run — it will show as Running with no recent activity. Open the Log tab and scroll to the bottom. Look for:
- The last completed tool call (e.g.,
bash_execute completed) - A pending tool call that has been waiting with no output
- An error message like
Tool execution timeoutorRate limit hit — retrying
The last pending tool call tells you exactly where the agent stopped.
2. Cancel the Run Cleanly
Click the Cancel Run button (or Stop) in the run detail view. Wait for the status to change to Cancelled before proceeding. Do not close the browser tab or navigate away during cancellation — doing so may leave the worker process running in the background until the platform-level timeout clears it.
3. Diagnose the Root Cause
Based on what the log showed in step 1:
If the last call was a bash or exec operation:
The command likely ran a long-running process (e.g., npm install, a build step, or a network request to a slow endpoint). Break it into smaller steps or add a timeout flag:
# Add explicit timeout to long commands
timeout 30s npm install --prefer-offline
If the last call was a browser tool: The browser may be waiting for a page load that never completed, or the site blocked the automated request. Check whether the target URL is accessible and consider adding wait conditions or increasing the browser timeout in your agent config.
If the last call was an API call: The agent may have hit Anthropic's rate limits. Anthropic enforces per-minute token limits that vary by API tier — hitting these causes a temporary pause. Add retry logic with exponential backoff to your agent, or reduce the frequency of API calls.
4. Adjust Agent Configuration
Open your agent's workflow configuration and make the relevant fix:
- Increase tool timeout: In your agent YAML or workflow settings, set
tool_timeout_seconds: 120for operations that legitimately need more time - Add error handling: Configure your agent to catch tool failures and either retry with a smaller task or terminate gracefully
- Reduce parallelism: If your agent runs multiple tool calls simultaneously, reduce concurrency to avoid resource contention
5. Test with a Manual Trigger
Before re-enabling a scheduled run, trigger the updated agent manually. Watch the live log from start to finish. Confirm each tool call completes within the expected time and the run reaches a Completed status.
6. Enable Failure Notifications
Go to your workflow settings and enable Email Alerts or Discord Notifications for run failures. Set the alert threshold to trigger if a run has not completed within 150% of its typical duration. This catches stuck runs before they consume significant time.
Why This Happens
OpenClaw runs agents in containerized workers that execute tool calls sequentially or in parallel. When a tool call — such as a browser automation that waits for a JavaScript-heavy page to load, or a bash command that calls a slow external API — does not return within the timeout window, the worker continues waiting indefinitely. Unlike a local terminal where you can press Ctrl+C, the container has no way to receive an interrupt signal from the user unless you explicitly trigger a cancellation through the dashboard. Anthropic API rate limits can also cause agents to stall if the platform's built-in retry logic waits passively for the rate limit window to reset.
Common Mistakes to Avoid
- Not setting explicit timeouts on shell commands: Commands like
curl,wget, or long build processes can hang indefinitely if a network connection drops. Always usetimeout 30s your-commandfor any network-dependent operations. - Using the browser tool on sites with anti-bot protection: Pages that detect automated browsers and serve infinite loading spinners will cause browser tool calls to hang. Test target URLs manually before building automations around them.
- Ignoring rate limit warnings in logs: If you see
429 Too Many Requestsin a previous run's log, your next run will likely get stuck at the same point. Add delays between API-heavy steps. - Running the same stuck configuration repeatedly: Each stuck run consumes plan resources. Fix the configuration between attempts rather than re-triggering a known-failing run.
Q: How do I tell if my agent is in an infinite loop versus just running a slow task?
Check the run log timestamps. If you see the same tool call repeating at regular intervals (e.g., a bash command executing every 15 seconds with identical output), the agent is in a loop. Legitimate slow tasks produce either no log output (waiting) or progressive output with changing data. Look for repeated identical log lines — that pattern almost always indicates a loop condition in the agent's control flow, not a slow external dependency. Cancel the run and review the agent logic to add a termination condition.
Q: Does cancelling a stuck run affect my next scheduled cron execution?
No. Cancelling a run manually does not affect the cron schedule. The next scheduled run will trigger at the configured time regardless of whether you cancelled the previous run. However, if the same configuration that caused the stuck run is still in place, the next scheduled run will likely get stuck at the same point. Fix the underlying issue before the next scheduled execution, or temporarily disable the cron job while you debug.
Q: Can I set up automatic cancellation for runs that exceed a time threshold?
Yes. In your workflow or agent configuration, you can set a max_run_duration_minutes parameter (exact name may vary by OpenClaw version). When a run exceeds this duration, OpenClaw automatically cancels it and logs a run_timeout event. Set this to 150% of your typical run duration — for example, if your agent normally completes in 8 minutes, set the timeout to 12 minutes. Automatic cancellation prevents runaway workers from consuming plan resources overnight.
Related Issues
- OpenClaw tool calls failing – timeouts and not available
- OpenClaw timeouts in tool execution
- OpenClaw rate limits affecting runs
- OpenClaw cron job failing – find logs and root cause
Additional FAQ
Q: What is the fastest way to diagnose a login problem? The fastest diagnostic is to open an incognito or private browser window and attempt to sign in there. Incognito windows run without extensions and use fresh cookies, which isolates the two most common causes: a browser extension interfering with authentication, or corrupted session cookies. If login works in incognito, the issue is your main browser profile. If it still fails, the problem is your network, your account, or a platform-side incident.
Q: Why does clearing browser cache fix login issues? Your browser caches session tokens and authentication cookies that prove you are logged in. If these become corrupted or expire mid-session, the browser may present an invalid token on each page load, causing the server to reject the session and redirect you to login. Clearing site-specific data forces the browser to request fresh tokens on the next login, which resolves most session-related loops without affecting your other browser data.
Q: Should I try a different browser if login keeps failing? Yes — testing in a second browser is one of the most useful steps. Different browsers use different cookie stores, extension ecosystems, and caching mechanisms. If login works in Browser B but fails in Browser A, the issue is specific to Browser A's state (likely extensions or corrupted profile data), not your account. You can continue working in Browser B while you troubleshoot the original browser.
Related Articles
- OpenClaw login / API key fix
- OpenClaw rate limits affecting runs
- OpenClaw agent not starting
- OpenClaw tool calls failing
Additional FAQ
Q: What is the fastest way to diagnose a login problem? The fastest diagnostic is to open an incognito or private browser window and attempt to sign in there. Incognito windows run without extensions and use fresh cookies, which isolates the two most common causes: a browser extension interfering with authentication, or corrupted session cookies. If login works in incognito, the issue is your main browser profile. If it still fails, the problem is your network, your account, or a platform-side incident.
Related Articles
- OpenClaw login / API key fix
- OpenClaw rate limits affecting runs
- OpenClaw agent not starting
- OpenClaw tool calls failing
Additional FAQ
Q: What is the fastest way to diagnose a login problem? The fastest diagnostic is to open an incognito or private browser window and attempt to sign in there. Incognito windows run without extensions and use fresh cookies, which isolates the two most common causes: a browser extension interfering with authentication, or corrupted session cookies. If login works in incognito, the issue is your main browser profile. If it still fails, the problem is your network, your account, or a platform-side incident.