From 467b8309746f67107f17b47b30752369df6ac5f0 Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Mon, 23 Feb 2026 00:56:48 -0600 Subject: [PATCH] fix state load failing when no browser is running (#527) `state load` always fails with "Cannot load state while browser is running" even when no browser is running, making the command completely unusable (#526). The daemon's auto-launch logic starts a browser before `state_load` gets to handle the command. This adds `state_load` to the exclusion list alongside `launch` and `close`, so `handleStateLoad` can perform its own launch with the state file. --- AGENTS.md | 4 ++++ src/daemon.ts | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9f92b07..0dd7052 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,6 +2,10 @@ Instructions for AI coding agents working with this codebase. +## Package Manager + +This project uses **pnpm**. Always use `pnpm` instead of `npm` or `yarn` for installing dependencies, running scripts, etc. (e.g., `pnpm install`, `pnpm run build`). + ## Code Style - Do not use emojis in code, output, or documentation. Unicode symbols (✓, ✗, →, ⚠) are acceptable. diff --git a/src/daemon.ts b/src/daemon.ts index 36d5acc..8a331df 100644 --- a/src/daemon.ts +++ b/src/daemon.ts @@ -373,11 +373,12 @@ export async function startDaemon(options?: { continue; } - // Auto-launch if not already launched and this isn't a launch/close command + // Auto-launch if not already launched and this isn't a launch/close/state_load command if ( !manager.isLaunched() && parseResult.command.action !== 'launch' && - parseResult.command.action !== 'close' + parseResult.command.action !== 'close' && + parseResult.command.action !== 'state_load' ) { if (isIOS && manager instanceof IOSManager) { // Auto-launch iOS Safari