Why this issue exists
This came from the local:session-concurrency eval. The original issue combined two failures:
- Same-session contention did not surface as Webcmd
SESSION_BUSY in the weak run.
data: documents could not use localStorage, which made the assigned fixture harder for agents to drive.
Source reports:
/Users/ankitranjan/Work/agentrhq/evals/results/run-20260820T085734Z/report.md
/Users/ankitranjan/Work/agentrhq/evals/results/run-20260820T103952Z/report.md
Current Webcmd state
As of origin/main 22974697bb3fe784bad5ef5a208f2d6ee5a272a8 (webcmd-v0.7.4-2-g2297469):
- Local Webcmd has a structured
SESSION_BUSY error.
- The error says another holder is already driving the session and tells the agent to wait, then retry the same command.
- The daemon has session lease coverage and
browser run help says a second overlapping run returns SESSION_BUSY.
- Browser-run now maps
data: / about:blank storage failures to BROWSER_RUN_INVALID_INPUT with the hint: data: pages cannot use localStorage.
- A maintainer comment asks to make sure the hosted version is fixed as well.
- There is still no evidence in this issue that hosted Webcmd returns the same
SESSION_BUSY behavior and same data-page limitation guidance.
Observed agent behavior
The failed run showed the confusion clearly:
- The agent created separate sessions but did not create CLI-level contention.
- It attempted overlap inside one
browser run using two page.evaluate(applyUpdate) calls.
- No
SESSION_BUSY envelope appeared because the second operation was not a second Webcmd invocation.
- The agent concluded the structured busy response did not exist in page code.
- The count ended at
3, not the intended wait/retry count of 2.
The successful run eventually did the correct Webcmd flow:
- Started one browser run holding a session.
- Issued a second
webcmd --session <same-id> browser run while the first was live.
- Received structured
SESSION_BUSY naming the holder pid.
- Waited, retried the same second command, and verified count
2.
What went wrong
The root local SESSION_BUSY behavior appears fixed, but this issue is not fully stale because the cross-mode guarantee is still open.
The agent behavior also shows why the CLI must carry the concept. Agents naturally try to solve concurrency inside the page unless Webcmd makes it obvious that session contention is between CLI invocations.
The data: part is now a named limitation rather than a silent mystery. That may be good enough, but senior review should decide whether eval fixtures should avoid data: + localStorage or Webcmd should provide a stronger workaround.
Solution directions
Product-first options:
- Verify hosted Webcmd returns structured
SESSION_BUSY before browser work starts when a session is already held.
- Verify hosted error text/hints match local behavior closely enough for agents to recover.
- Decide whether
data: + localStorage should remain unsupported with a clear error, or whether eval fixtures/product behavior should change.
- Keep skill changes minimal: one line at most saying
SESSION_BUSY is produced by a second webcmd --session <id> ... invocation, not by page.evaluate.
Open questions for senior review
- Is local
SESSION_BUSY complete enough to close the original local bug and leave only hosted parity?
- Should hosted parity be tracked here or split into a separate Cloud issue?
- Should eval tasks avoid
data: pages that require localStorage, now that the CLI explicitly rejects that storage path?
Acceptance criteria
- Local and hosted both return structured
SESSION_BUSY for overlapping commands on the same session.
- The busy error tells the agent to wait and retry the same command.
--force is presented only as a last resort for a dead holder.
data: / about:blank storage failures produce a clear typed error or the storage path is supported intentionally.
Non-goals
- No in-page mutex as the Webcmd safety mechanism.
- No eval-specific workaround text.
- No silent queued second driver on the same session.
Why this issue exists
This came from the
local:session-concurrencyeval. The original issue combined two failures:SESSION_BUSYin the weak run.data:documents could not uselocalStorage, which made the assigned fixture harder for agents to drive.Source reports:
/Users/ankitranjan/Work/agentrhq/evals/results/run-20260820T085734Z/report.md/Users/ankitranjan/Work/agentrhq/evals/results/run-20260820T103952Z/report.mdCurrent Webcmd state
As of
origin/main22974697bb3fe784bad5ef5a208f2d6ee5a272a8(webcmd-v0.7.4-2-g2297469):SESSION_BUSYerror.browser runhelp says a second overlapping run returnsSESSION_BUSY.data:/about:blankstorage failures toBROWSER_RUN_INVALID_INPUTwith the hint:data: pages cannot use localStorage.SESSION_BUSYbehavior and same data-page limitation guidance.Observed agent behavior
The failed run showed the confusion clearly:
browser runusing twopage.evaluate(applyUpdate)calls.SESSION_BUSYenvelope appeared because the second operation was not a second Webcmd invocation.3, not the intended wait/retry count of2.The successful run eventually did the correct Webcmd flow:
webcmd --session <same-id> browser runwhile the first was live.SESSION_BUSYnaming the holder pid.2.What went wrong
The root local
SESSION_BUSYbehavior appears fixed, but this issue is not fully stale because the cross-mode guarantee is still open.The agent behavior also shows why the CLI must carry the concept. Agents naturally try to solve concurrency inside the page unless Webcmd makes it obvious that session contention is between CLI invocations.
The
data:part is now a named limitation rather than a silent mystery. That may be good enough, but senior review should decide whether eval fixtures should avoiddata:+localStorageor Webcmd should provide a stronger workaround.Solution directions
Product-first options:
SESSION_BUSYbefore browser work starts when a session is already held.data:+localStorageshould remain unsupported with a clear error, or whether eval fixtures/product behavior should change.SESSION_BUSYis produced by a secondwebcmd --session <id> ...invocation, not bypage.evaluate.Open questions for senior review
SESSION_BUSYcomplete enough to close the original local bug and leave only hosted parity?data:pages that requirelocalStorage, now that the CLI explicitly rejects that storage path?Acceptance criteria
SESSION_BUSYfor overlapping commands on the same session.--forceis presented only as a last resort for a dead holder.data:/about:blankstorage failures produce a clear typed error or the storage path is supported intentionally.Non-goals