How to fix OpenClaw agent not responding in a session (stuck run)?

OpenClawLogin & AccessUpdated May 17, 2026
Quick Answer

An OpenClaw agent stuck in a run is almost always caused by one of three things: a tool call that has hit the default 60-second execution timeout, an Anthropic API rate limit pausing the agent mid-task, or a browser/bash tool blocked on a network operation. Open the run's live log in the OpenClaw dashboard, identify the last successful tool call, and use the Cancel Run button to terminate it cleanly before restarting with a revised configuration.

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 timeout or Rate 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: 120 for 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 use timeout 30s your-command for 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 Requests in 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

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

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

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

View all OpenClaw guides

OpenClaw · Login & Access

More OpenClaw login & access guides

Browse all guides in this category to troubleshoot related issues faster.

Browse all guides →

Frequently Asked Questions

OpenClaw enforces a maximum run duration that varies by plan tier — typically 10 minutes for standard plans and up to 30 minutes for higher tiers. Individual tool calls have a separate default timeout of 60 seconds. If a bash command, browser operation, or API call does not return within 60 seconds, the tool call fails with a timeout error, which may or may not stop the entire run depending on how your agent handles errors. If the overall run duration limit is reached, OpenClaw automatically terminates the run and logs a timeout event.

Related Guides

Continue with nearby guides in the same topic to rule out adjacent causes faster.

OpenClaw login not working on desktop app?

Desktop app login failures on OpenClaw are fixed in most cases by three steps: quit the app completely, delete the app's local credential cache (on macOS: ~/Library/Application Support/OpenClaw/; on Windows: %APPDATA%/OpenClaw/), relaunch and sign in fresh. If that fails, update the app to the latest version — older desktop builds sometimes have OAuth flow bugs that are patched in newer releases.

OpenClaw login not working on mobile (iOS/Android)?

Mobile login failures on OpenClaw are fixed in 80% of cases by force-closing the app, clearing app storage (iOS: Settings > OpenClaw > Clear Storage; Android: Settings > Apps > OpenClaw > Clear Storage + Clear Cache), then reinstalling if clearing does not help. If login opens a browser that does not redirect back to the app, the custom URL scheme handler may have been broken by a system update — reinstalling the app re-registers it.

OpenClaw Login & API Key Issues

Most OpenClaw API key failures are fixed in under 2 minutes: go to Settings > API Keys, revoke the old key, generate a new one, and update your OPENCLAW_API_KEY environment variable. API keys do not auto-rotate, but they are invalidated immediately if you revoke them or reset your account password.

How to fix OpenClaw Telegram delivery not working (messages not sent)?

Telegram message delivery failures in OpenClaw are caused by one of three issues: an invalid or revoked Telegram bot token, the target chat ID is wrong or the bot has not been added to the target group/channel, or the Telegram API is rate limiting the bot at 30 messages per second per bot or 20 messages per minute to the same chat. Verify your bot token in BotFather, confirm the chat ID with a test message, and check OpenClaw's run logs for the Telegram API error response code.