Keep agents on separate tabs
Use a stable alias across reloads and fail safely on duplicates.
Demo: apps/plain-demo
Start the hub and demo in separate shells:
npx @genie-react/cli hub --port 4390pnpm --filter @genie-react/plain-demo devOpen and pin one tab
agent-browser --session docs-session open \
'http://127.0.0.1:3050/?_genie=live-plain-final'
export GENIE_BRIDGE_URL=ws://127.0.0.1:4390/__genie/ws
npx @genie-react/cli status --sessions-only
export GENIE_SESSION=live-plain-final
npx @genie-react/cli call devtools_wait '{"condition":"ready"}'
agent-browser --session docs-session reload
npx @genie-react/cli call devtools_wait '{"condition":"ready"}'
npx @genie-react/cli call react_find_components \
'{"query":"App","exact":true}' --json \
| jq -e '.matches | length == 1' >/dev/null
agent-browser --session docs-session get text body \
| rg -F 'Genie Plain Demo Lab'Identity summary from the recorded run, shown here as a comparison rather than CLI output:
before reload: physical be045bce… · logical afd9a346… · generation 1
after reload: physical df005e35… · logical afd9a346… · generation 2The same alias reconnected, found the one mounted App, and reached the expected visible page after
reload.
Duplicate markers fail safely
Open a second browser session with the same marker:
agent-browser --session docs-session-copy open \
'http://127.0.0.1:3050/?_genie=live-plain-final'
npx @genie-react/cli status --session live-plain-finalThe status command must fail with a JSON error instead of choosing a tab. Recover by listing all sessions without the ambiguous selector, then use a returned physical or logical ID:
( unset GENIE_SESSION; npx @genie-react/cli status --sessions-only )Read the error's reason, message, and userActionRequired. Its next.argv, when present,
contains a recovery command as arguments. See CLI output for the
error contract. A physical ID selects one current connection; the logical ID survives reloads.
Outcome
A unique alias follows one logical document through reload. Reused aliases fail selection so the agent can resolve the duplicate before clearing measurements or changing state.
Close the duplicate tab. Keep only the owned tab while the job runs:
agent-browser --session docs-session-copy close
agent-browser --session docs-session close
unset GENIE_BRIDGE_URL GENIE_SESSION