Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
648c6be
Merge pull request #1 from ivalsaraj/feat/plugin-system
ivalsaraj Feb 23, 2026
1ff5618
docs: add plugin system documentation to README
ivalsaraj Feb 23, 2026
43f7d55
chore: update package version to 1.0.9 and adjust repository URL format
ivalsaraj Feb 23, 2026
6ea5ce7
docs: add comprehensive documentation for BrowserForce plugin system
ivalsaraj Feb 23, 2026
5880702
feat: plugin system — drop-in helpers for the execute tool
ivalsaraj Feb 23, 2026
33b0684
docs: add comprehensive guide for building BrowserForce plugins
ivalsaraj Feb 23, 2026
8a1b7a5
fix(plugins): correct registry URL to point at ivalsaraj/browserforce
ivalsaraj Feb 23, 2026
40efa36
feat: add non-blocking update notifier to CLI
ivalsaraj Feb 23, 2026
8685fd8
feat: agent-visible update notices via MCP + browserforce update command
ivalsaraj Feb 23, 2026
5b7cdd1
fix: correct path handling, update-check errors, and plugin docs
ivalsaraj Feb 23, 2026
67baea3
fix: include extension/ in npm package files
ivalsaraj Feb 23, 2026
b7a116f
feat: add install-extension command with VERSION sentinel
ivalsaraj Feb 23, 2026
2109e00
feat: auto-sync extension after browserforce update
ivalsaraj Feb 23, 2026
08985dd
feat: warn in serve when installed extension is outdated
ivalsaraj Feb 23, 2026
67ddaad
docs: update setup instructions for npm install-extension flow
ivalsaraj Feb 23, 2026
5b7cca9
chore: bump version to 1.0.12
ivalsaraj Feb 23, 2026
93ccfef
fix: review findings — stale-file purge, src guard, test port isolati…
ivalsaraj Feb 23, 2026
bef3093
feat: implement extension reload functionality via HTTP endpoint
ivalsaraj Feb 24, 2026
5884b6d
docs: align tool references with execute-only helper model
ivalsaraj Feb 24, 2026
477f8e3
feat(mcp): consolidate screenshot and content helpers into execute
ivalsaraj Feb 24, 2026
4cd33aa
Merge pull request #2 from ivalsaraj/codex/execute-consolidation
ivalsaraj Feb 24, 2026
aa4e391
docs(readme): consolidate MCP client setup and add antigravity
ivalsaraj Feb 24, 2026
73e0769
docs(guide): add codex and cursor MCP config + handshake troubleshooting
ivalsaraj Feb 24, 2026
55e3c00
chore: update .gitignore and README for installation instructions
ivalsaraj Feb 24, 2026
f6b5bad
docs: add design for diffing parity and cdp logging
ivalsaraj Feb 24, 2026
090dd93
test(mcp): add failing tests for diff-aware helper wiring
ivalsaraj Feb 24, 2026
16585e9
feat(mcp): add playwriter-style diff mode to snapshot and content hel…
ivalsaraj Feb 24, 2026
8031301
fix(mcp): preserve pageMarkdown search semantics with diff mode
ivalsaraj Feb 24, 2026
9edf832
test(mcp): add prompt regression guards for tactical guidance
ivalsaraj Feb 24, 2026
8d31393
test(relay): add failing coverage for cdp jsonl traffic logging
ivalsaraj Feb 24, 2026
409ab6b
feat(mcp): expand execute prompt with tactical web automation playbooks
ivalsaraj Feb 24, 2026
0cb0585
test(relay): stabilize failing cdp logging tests
ivalsaraj Feb 24, 2026
dfafc62
feat(mcp): expose refToLocator helper in execute context
ivalsaraj Feb 24, 2026
96aff08
feat(mcp): add getCDPSession helper for relay-safe raw CDP access
ivalsaraj Feb 24, 2026
e81d78d
feat(mcp): add snapshot diff mode with showDiffSinceLastCall toggle
ivalsaraj Feb 24, 2026
1f50d61
fix(mcp): diff snapshot only for full-page views
ivalsaraj Feb 24, 2026
eb37c44
feat(relay): add jsonl cdp traffic logging with playwriter-style dire…
ivalsaraj Feb 24, 2026
8b34054
fix(mcp): align execute schema helpers and add helper exposure test
ivalsaraj Feb 24, 2026
4d15beb
fix(relay): harden cdp logger startup and file permissions
ivalsaraj Feb 24, 2026
84ee6c8
test(mcp): add prompt regression guards for tactical guidance
ivalsaraj Feb 24, 2026
5db8d39
feat(mcp): expand execute prompt with tactical web automation playbooks
ivalsaraj Feb 24, 2026
cba8c89
feat(mcp): expose refToLocator helper in execute context
ivalsaraj Feb 24, 2026
8eb92a8
feat(mcp): add getCDPSession helper for relay-safe raw CDP access
ivalsaraj Feb 24, 2026
16c7cd9
feat(mcp): add snapshot diff mode with showDiffSinceLastCall toggle
ivalsaraj Feb 24, 2026
032a2da
fix(mcp): diff snapshot only for full-page views
ivalsaraj Feb 24, 2026
cd12e57
fix(mcp): align execute schema helpers and add helper exposure test
ivalsaraj Feb 24, 2026
7a76e86
docs: document diff-aware helpers and cdp jsonl logging
ivalsaraj Feb 24, 2026
0d356d0
merge: integrate playwriter-features into main
ivalsaraj Feb 24, 2026
74fbcaa
fix(extension): resync attached tab group naming on group changes
ivalsaraj Feb 24, 2026
29fa157
fix(extension): resync attached tab group naming on group changes
ivalsaraj Feb 24, 2026
91d901d
docs: expand controlled-tab guidance and persona use cases
ivalsaraj Feb 24, 2026
5dd7022
docs: expand controlled-tab guidance and persona use cases
ivalsaraj Feb 24, 2026
3040db1
docs: update positioning to parallel ai agents in your chrome
ivalsaraj Feb 24, 2026
4620f76
merge: update BrowserForce positioning tagline
ivalsaraj Feb 24, 2026
f2cd8da
feat(relay): add client arbitration config defaults
ivalsaraj Feb 24, 2026
b6fce07
feat(relay): enforce single active cdp client mode
ivalsaraj Feb 24, 2026
b7b5093
test(relay): make single-active contention test deterministic
ivalsaraj Feb 24, 2026
5ab3d52
feat(relay): release active slot on disconnect and expose slot status
ivalsaraj Feb 24, 2026
a9cd31e
feat(relay): preserve multi-client fallback mode
ivalsaraj Feb 24, 2026
d179349
docs(mcp): add parallel-first tab swarm policy and real-world examples
ivalsaraj Feb 24, 2026
1915a00
docs(readme): collapse advanced MCP setup into details block
ivalsaraj Feb 24, 2026
edf2bb0
feat(mcp): retry when relay slot is busy instead of failing immediately
ivalsaraj Feb 24, 2026
c2d8011
test(mcp): cover busy retry path for CDP connection
ivalsaraj Feb 24, 2026
1d90a98
Revert "docs(readme): collapse advanced MCP setup into details block"
ivalsaraj Feb 24, 2026
7d902cf
docs(readme): make advanced MCP providers individually collapsible
ivalsaraj Feb 24, 2026
00652e2
docs: add single-active arbitration mode and fallback behavior
ivalsaraj Feb 24, 2026
11da90c
docs: dedupe non-goals and point README to AGENTS
ivalsaraj Feb 24, 2026
983801e
Merge remote-tracking branch 'origin/main' into playwriter-features
ivalsaraj Feb 24, 2026
a87579d
docs(guide): revise user guide to focus on advanced workflows and con…
ivalsaraj Feb 24, 2026
2c01d8d
feat(relay): add extension-gated logs APIs and client labeling
ivalsaraj Feb 25, 2026
6152fa5
feat(extension): add dedicated options-page log viewer
ivalsaraj Feb 25, 2026
a461f6a
docs: document full logs viewer and logs endpoints
ivalsaraj Feb 25, 2026
773b4b3
docs: add troubleshooting section for MCP errors in README
ivalsaraj Feb 25, 2026
1657a51
feat(mcp): make startup non-blocking with standby reconnect loop
ivalsaraj Feb 25, 2026
93c045e
feat(relay): enhance origin parsing to support extension referers
ivalsaraj Feb 25, 2026
0e58f96
chore: bump version to 1.0.13 in package.json
ivalsaraj Feb 25, 2026
ffd2bce
docs: update README to clarify BrowserForce features and add deep div…
ivalsaraj Feb 25, 2026
222cb3c
feat(relay): default client arbitration to multi-client
ivalsaraj Feb 25, 2026
3351ab3
docs: make single-active an opt-in mode with guidance
ivalsaraj Feb 25, 2026
e65f15e
chore: bump version to 1.0.14 in package.json
ivalsaraj Feb 25, 2026
6bea311
feat(extension): add execution and parallel visibility settings in popup
ivalsaraj Feb 25, 2026
f5a27ff
feat(extension): enforce visible parallel modes for agent-created tabs
ivalsaraj Feb 25, 2026
47d8375
feat(relay): add agent-preferences endpoint backed by extension settings
ivalsaraj Feb 25, 2026
ba1a4b0
feat(mcp): cache agent execution preferences per session and expose i…
ivalsaraj Feb 25, 2026
2c73052
docs: document execution mode and visible parallel tab settings
ivalsaraj Feb 25, 2026
a26ddb9
Merge pull request #3 from ivalsaraj/feature/visible-parallel-executi…
ivalsaraj Feb 25, 2026
9ed9547
chore: bump version to 1.0.15 in package.json
ivalsaraj Feb 25, 2026
abe8abf
extension: show MCP client count and auto-mode border
ivalsaraj Feb 26, 2026
e137a90
relay: include client count in client-slot status
ivalsaraj Feb 26, 2026
c4eb347
feat: add openclaw setup primitives and autostart installers
ivalsaraj Feb 26, 2026
3aa0ccb
feat: add setup openclaw CLI command
ivalsaraj Feb 26, 2026
288b0bb
feat: add opt-in postinstall openclaw setup hook
ivalsaraj Feb 26, 2026
a694270
docs: add openclaw setup and autostart guidance
ivalsaraj Feb 26, 2026
985f2f6
fix(connection): prefer relay port/json-version and preflight extensi…
ivalsaraj Feb 26, 2026
118a09a
test(exec-engine): cover relay-port default resolution and extension …
ivalsaraj Feb 26, 2026
5adb4c2
docs(readme): add simple port-conflict and port-switch guide
ivalsaraj Feb 26, 2026
1cf0265
mcp: trim execute prompt and refine reset guidance
ivalsaraj Feb 26, 2026
cfbc401
Merge pull request #4 from ivalsaraj/codex/openclaw-autostart-setup
ivalsaraj Feb 26, 2026
3cf3983
Merge pull request #5 from ivalsaraj/codex/relay-port-default-19222
ivalsaraj Feb 26, 2026
b8afe45
fix(mcp): restore missing exec-engine exports for startup
ivalsaraj Feb 26, 2026
d123a08
chore: bump version to 1.0.16 in package.json
ivalsaraj Feb 26, 2026
0fdf7d1
feat(mcp): introduce browserforceRestrictions to exec context and ses…
ivalsaraj Feb 27, 2026
e3f6956
feat(openclaw): auto-install scoped policy plugin in setup
ivalsaraj Mar 1, 2026
1ce6b87
chore: bump version to 1.0.17
ivalsaraj Mar 1, 2026
d338775
feat(plugins): add google-sheets helpers for safe formatting
ivalsaraj Mar 1, 2026
10f1dd5
docs: add google sheets automation issue log
ivalsaraj Mar 1, 2026
81d0419
fix(agent): fail fast on corrupt session index and write index atomic…
ivalsaraj Mar 2, 2026
282e8df
fix(agent): use unique temp index files for concurrent atomic writes
ivalsaraj Mar 2, 2026
2e86b6d
fix(chatd): clean up failed run starts to avoid leaked run state
ivalsaraj Mar 2, 2026
3027c79
fix(sidepanel): preserve draft and fail fast on send/bootstrap errors
ivalsaraj Mar 2, 2026
cf63486
fix(auth): require strict localhost origin matching
ivalsaraj Mar 2, 2026
890a965
fix(chatd): honor BF_CHATD_URL_PATH in daemon path resolution
ivalsaraj Mar 2, 2026
306c492
fix(extension): rollback relay URL when reconnect attempt fails
ivalsaraj Mar 2, 2026
911326e
test(agent): avoid fixed-port collisions in port resolver fallback test
ivalsaraj Mar 2, 2026
d0b9b59
fix(chatd): keep runs alive across transient codex transport errors
ivalsaraj Mar 2, 2026
7a30164
fix(sidepanel): load codex model presets and reduce noisy duplicate s…
ivalsaraj Mar 2, 2026
c00e26f
feat(chatd): source sidepanel models from live codex app-server catalog
ivalsaraj Mar 3, 2026
72f1e02
feat(sidepanel): add claude-style transcript layout and expandable ru…
ivalsaraj Mar 3, 2026
7844b21
feat(sidepanel): render step icons for reasoning and tool call timeline
ivalsaraj Mar 3, 2026
20d977d
agent: auto-attach active tab and include tab context in runs
ivalsaraj Mar 3, 2026
525bfce
relay: add chatd-url endpoint with extension-id auth fallback
ivalsaraj Mar 3, 2026
c722fff
cli(agent): add daemon start/status/stop with lockfile and port fallback
ivalsaraj Mar 3, 2026
222a347
extension: wire sidepanel entry and popup agent launcher UX
ivalsaraj Mar 3, 2026
dac4c3e
test(sidepanel): cover session selection and message hydration reducers
ivalsaraj Mar 3, 2026
0bad045
chore: include agent package artifacts and document sidepanel daemon …
ivalsaraj Mar 3, 2026
33aa805
fix(sidepanel): avoid premature finalization and submit on Enter
ivalsaraj Mar 3, 2026
53370b6
style(extension): apply warm neutral palette across panel and popup
ivalsaraj Mar 3, 2026
174e1f7
Merge pull request #6 from ivalsaraj/codex/agent-sidepanel-20260301
ivalsaraj Mar 3, 2026
585d879
Update extension background and styles
ivalsaraj Mar 3, 2026
f0fb547
Simplify AGENTS local include setup
ivalsaraj Mar 3, 2026
0b65596
feat(sidepanel): show tab attach banner and auto-refresh on tab switch
ivalsaraj Mar 3, 2026
820ae31
Redesign agent sidepanel UI to new style system
ivalsaraj Mar 3, 2026
d7fc71b
Improve sidepanel session UX and prevent message overflow
ivalsaraj Mar 3, 2026
e999834
Persist run steps for session transcript rehydration
ivalsaraj Mar 3, 2026
4a27ec0
test(agent): add codex exec/resume fixtures and contracts
ivalsaraj Mar 3, 2026
d322853
feat(agent): persist codex provider session and usage metadata
ivalsaraj Mar 3, 2026
b45be43
feat(agent): support codex resume args and usage event normalization
ivalsaraj Mar 3, 2026
4d6f5f0
feat(agent): resume codex sessions with usage persistence and metadat…
ivalsaraj Mar 3, 2026
58d7843
feat(sidepanel): render codex context usage telemetry with session hy…
ivalsaraj Mar 3, 2026
2c1417d
docs(agent): document codex session continuity and context telemetry
ivalsaraj Mar 3, 2026
6d142f6
sidepanel: render run timeline inline with ordered tool/text events
ivalsaraj Mar 3, 2026
cfc8dae
agent: persist ordered run timeline with chat/tool events
ivalsaraj Mar 3, 2026
764f7ad
fix(sidepanel): show context usage only when available below composer
ivalsaraj Mar 3, 2026
e49e899
docs(dev): add contributor guide for relay ports and streaming debug …
ivalsaraj Mar 3, 2026
6b0cd93
fix(sidepanel): open panel first and attach tab asynchronously
ivalsaraj Mar 3, 2026
755d85f
fix(sidepanel): defer first tab attach until after initial paint
ivalsaraj Mar 3, 2026
ae4196b
fix(sidepanel): delay initial tab attach by 2s
ivalsaraj Mar 3, 2026
e147203
fix(sidepanel): preserve partial assistant output when run is stopped
ivalsaraj Mar 3, 2026
4dc0dd5
fix(chatd): persist partial assistant output when run is aborted
ivalsaraj Mar 3, 2026
7d69d82
feat(sidepanel): collapse tool-call steps with expandable details
ivalsaraj Mar 3, 2026
807f806
sidepanel: restyle composer shell and simplify controls
ivalsaraj Mar 3, 2026
63a64ba
sidepanel: toggle multiline state and swap send/stop visibility
ivalsaraj Mar 3, 2026
c508580
sidepanel: prevent empty input from triggering multiline composer
ivalsaraj Mar 3, 2026
82fff68
sidepanel: shrink composer and switch to light blue style
ivalsaraj Mar 3, 2026
1ecc42f
sidepanel: reconcile stale run state to hide stop when stream ends
ivalsaraj Mar 3, 2026
92916bf
sidepanel: align composer section with brand light palette
ivalsaraj Mar 3, 2026
c420a81
chore(release): bump versions to 1.0.18
ivalsaraj Mar 3, 2026
23ed580
fix(sidepanel): refresh tab-attach banner after async auto-attach
ivalsaraj Mar 4, 2026
9e3f43c
fix(sidepanel): use light-theme tokens for tab-attach banner
ivalsaraj Mar 4, 2026
a75a592
fix(agent): tighten MCP failure guidance and hidden composer button s…
ivalsaraj Mar 4, 2026
29ec6c0
Fix logs viewer relay auth in extension options page
ivalsaraj Mar 4, 2026
eb7ce1f
agent-panel: collapse tool lifecycle rows and parse modern codex events
ivalsaraj Mar 4, 2026
351db29
agent: fix phase-less final text loss and legacy tool collapse
ivalsaraj Mar 4, 2026
da880cf
agent-panel: restore execute step details for collapsible tool rows
ivalsaraj Mar 4, 2026
2706f0b
feat(agent): summarize codex stderr as collapsible timeline step
ivalsaraj Mar 4, 2026
4aecb35
agent-panel: clean tool command labels and keep execute details
ivalsaraj Mar 4, 2026
1cae155
agent-panel: set composer textarea font size to 12px
ivalsaraj Mar 4, 2026
493d26d
popup: close on open-agent click and replace auto-mode border with bo…
ivalsaraj Mar 4, 2026
a600dee
popup: make auto-mode note single-line with NOTE prefix and full-widt…
ivalsaraj Mar 4, 2026
a935a80
popup: constrain auto-mode note text width with inner ellipsis
ivalsaraj Mar 4, 2026
9a1a3a5
popup: fit auto-mode note text to one line without ellipsis
ivalsaraj Mar 4, 2026
d2f2b13
agent: label BrowserForce execute/reset tool steps
ivalsaraj Mar 4, 2026
8924417
google-sheets: add summary-first helper and workflow guidance
ivalsaraj Mar 4, 2026
a223e0d
agent-panel: animate active reasoning titles with shimmer and enter t…
ivalsaraj Mar 4, 2026
7dde1fa
test: cover sheets cache invalidation helpers
ivalsaraj Mar 4, 2026
99935a3
agent-panel: show explicit relay/agent startup failure states
ivalsaraj Mar 4, 2026
5a3aea4
agent-panel: add collapsed execute helper tree preview
ivalsaraj Mar 4, 2026
c637698
agent-panel: prioritize top attach-progress state during auto-connect
ivalsaraj Mar 4, 2026
7671b3a
docs(plugins): document internal/private plugin workflow
ivalsaraj Mar 4, 2026
20bd890
agent: add per-session reasoning effort support
ivalsaraj Mar 4, 2026
5ad5718
panel: add thinking selector to model popup
ivalsaraj Mar 4, 2026
e18c590
agent-panel: add startup retry and refresh-connection actions
ivalsaraj Mar 4, 2026
4deb317
feat(plugins): metadata-first skill loading and v1 plugin API
ivalsaraj Mar 4, 2026
81d51ba
agent-panel: start fresh session when opened from popup
ivalsaraj Mar 4, 2026
3f0529e
agent-panel: render full markdown in assistant chat
ivalsaraj Mar 4, 2026
c845eb1
agent-panel: render local screenshot images via authenticated chatd e…
ivalsaraj Mar 4, 2026
6c7aa52
fix(agent): treat zero context window as unavailable
ivalsaraj Mar 4, 2026
aea3e94
Use branded animated SVG for completed tool-call icons
ivalsaraj Mar 4, 2026
9fd2d5c
docs(agent): add dedicated BrowserForce Agent documentation
ivalsaraj Mar 4, 2026
8019697
Fix composer textarea bottom clipping
ivalsaraj Mar 4, 2026
a84ebe3
fix(mcp): stabilize labeled screenshots via sequential snapshot+scree…
ivalsaraj Mar 4, 2026
913fdc7
Restore run activity headings and improve thinking affordances
ivalsaraj Mar 4, 2026
15a066b
Merge pull request #8 from ivalsaraj/codex/screenshot-debug
ivalsaraj Mar 5, 2026
3e6d2e3
Render commentary headings from historical text timeline entries
ivalsaraj Mar 5, 2026
751d9d3
Add paced incremental rendering for streamed chat deltas
ivalsaraj Mar 5, 2026
c89b9d7
agent: isolate codex runs and manage BrowserForce AGENTS prompt
ivalsaraj Mar 5, 2026
b675348
docs(agent): document managed AGENTS sync for BF_CHATD_CODEX_CWD
ivalsaraj Mar 5, 2026
c256ee7
agent: minimize resume prompt overhead for AGENTS instructions
ivalsaraj Mar 5, 2026
214a0a1
agent: allow codex runs outside git worktrees
ivalsaraj Mar 5, 2026
0506239
agent-panel: surface run failures in transcript and status
ivalsaraj Mar 5, 2026
709bc35
feat(agent): add provider runtime with codex+claude adapters
ivalsaraj Mar 5, 2026
9581e02
feat(agent-panel): add provider selector and provider-scoped hydration
ivalsaraj Mar 5, 2026
4523c32
docs(agent): document multi-provider session and run behavior
ivalsaraj Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ node_modules/
.npm
pnpm-debug.log*
.worktrees/
docs/plans/*
docs/plans/*
.superset
AGENTS.local.md
49 changes: 42 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# BrowserForce — Agent Guidelines

## Playwriter Reference
## Local Private Overrides

**Before writing any new code, always check how [playwriter](../playwriter) solves the same problem.** Playwriter is the reference implementation for a browser extension + CDP relay + MCP server stack. It lives at `~/Documents/projects/playwriter`.

Rules:
- **Don't reinvent what playwriter already solved.** Read the relevant playwriter source file first.
- **Only add code for new requirements or problems playwriter hasn't already solved.**
- Reference files: `playwriter/src/cdp-relay.ts`, `playwriter/src/executor.ts`, `playwriter/src/mcp.ts`, `playwriter/src/relay-client.ts`
@AGENTS.local.md

## Project Overview

Expand Down Expand Up @@ -157,6 +152,38 @@ When a user clicks "Cancel" on Chrome's automation infobar, Chrome detaches the

`RelayServer.start()` accepts `{ writeCdpUrl: false }` to prevent test instances from clobbering `~/.browserforce/cdp-url`. **All test `relay.start()` calls must pass `{ writeCdpUrl: false }`** or the production cdp-url file gets overwritten with random test ports.

### Client Arbitration: BF_CLIENT_MODE

`BF_CLIENT_MODE` controls agent-side CDP arbitration:
- `multi-client` (default): allows concurrent `/cdp` clients.
- `single-active`: opt-in mode that allows only one active `/cdp` client connection at a time.

In `single-active`, contention returns HTTP `409 Conflict` for additional `/cdp` connects while the slot is busy. Slot state is exposed at `GET /client-slot` (`mode`, `busy`, `activeClientId`, `connectedAt`).

### MCP Standby Polling

MCP handles `409`/busy connect errors by entering standby and polling `GET /client-slot` with short jittered intervals (~200-400ms), then reconnecting when `busy: false` (up to a 30s connect timeout).

### BrowserForce Agent Session Identity (No Fixed ID)

For side-panel chat UX, **never hardcode or assume a fixed `sessionId`**.

- Sessions are user-selectable conversation threads (ChatGPT/Atlas style).
- The UI must list prior sessions and let the user resume any session.
- New chats must create a new generated session ID (UUID/ULID), then persist metadata + transcript.
- Streaming channels (`/events`) must be scoped by explicit selected `sessionId`.
- Do not infer continuity from "current Codex turn/session" alone; BrowserForce Agent keeps its own session store.

### Codex Provider Session Continuity + Usage Telemetry

For side-panel chat continuity, BrowserForce session metadata stores Codex provider state:

- Persist Codex thread identity at `providerState.codex.sessionId`.
- On each new run, pass that mapping as `resumeSessionId` so runner can invoke `codex exec resume <id> --json`.
- Persist latest context/token telemetry at `providerState.codex.latestUsage`.
- Emit and consume `run.usage` and `run.provider_session` events.
- Side-panel hydrates usage from `GET /v1/sessions/:sessionId` and shows `Context: unavailable` when telemetry is missing.

## Security Rules

- Relay binds to `127.0.0.1` ONLY. Never `0.0.0.0`.
Expand All @@ -165,6 +192,12 @@ When a user clicks "Cancel" on Chrome's automation infobar, Chrome detaches the
- Token file permissions: `0o600` (owner read/write only).
- Single extension slot. Second extension connection gets HTTP 409.

## Operational Non-Goals

- No new dependencies for client arbitration or standby behavior.
- No per-tab ownership model; arbitration is one relay-level client slot.
- No extension protocol changes for this feature area.

## Development Workflow

### Commands
Expand Down Expand Up @@ -229,3 +262,5 @@ Run with: `node --test relay/test/relay-server.test.js` and `node --test mcp/tes
5. **Relay port collision**: Default port 19222. If tests fail with EADDRINUSE, kill stale processes: `lsof -ti:19222 | xargs kill -9`.

6. **Test writeCdpUrl**: Never call `relay.start()` in tests without `{ writeCdpUrl: false }` — it overwrites the production cdp-url file.

7. **No fixed chat session IDs**: BrowserForce Agent chat must always use explicit user-selected/generated session IDs and persisted session history. Never bind side-panel chat to a single hardcoded ID.
Loading