Skip to content

Firefox: persist per-tab conversations in browser.storage.session (parity with Chrome) #224

Description

@Ayush7614

Problem

Chrome persists agent conversations and side-panel chat HTML across service worker restarts via chrome.storage.session (agentConv:<tabId>, tabChat:<tabId>). Firefox does not — conversations and scratchpad-related UI state live only in memory on the background page.

From src/firefox/ARCHITECTURE.md:

Firefox does not — conversations live only in memory on the background page and are lost when the sidebar closes or the background page unloads.

This is also listed in TODOs.md §2 as an explicit parity gap.

User impact (especially with Firefox AMO listing):

  • Close sidebar → lose chat
  • Background page reload → lose in-progress context
  • Scratchpad / multi-step Act runs feel fragile compared to Chrome
  • Bad first impression for new Firefox users

Proposed solution

Mirror Chrome’s persistence model on Firefox using browser.storage.session (available in Firefox 115+):

Layer Chrome (today) Firefox (target)
Agent message array agent.jsstorage.session key agentConv:<tabId> Same key shape + hydrate on processMessage
Side panel HTML sidepanel.jstabChat:<tabId> Same
Clear on /reset Removes session keys Same
Tab close background.js removes tabChat:<tabId> Same

Notes:

  • agent.js already has a no-op _persist stub on Firefox — replace with real browser.storage.session writes (debounced like Chrome).
  • Keep in-memory cache for hot path; session is backup + sidebar restore.
  • Document any Firefox version floor in README if needed.

Verification

  • Start Act run on Firefox, reload background page (or restart Firefox with persistent background), reopen sidebar → conversation restored
  • /reset clears session + memory
  • Tab close removes tabChat:<tabId>; agent conv policy matches Chrome
  • npm test — unit tests for persist/hydrate helpers if extracted
  • No regression on Chrome

Scope estimate

~150–250 lines across src/firefox/src/agent/agent.js, src/firefox/src/ui/sidepanel.js, src/firefox/src/background.js, docs. No new manifest permissions (storage already granted).

Labels: help wanted, good first issue (if scoped to persistence only)


Happy to implement if assigned — natural follow-up after Chrome/Firefox parity work on planner + history tools.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions