Skip to content

fix(extension): detect stalled background worker#498

Open
huyua9 wants to merge 1 commit into
alibaba:mainfrom
huyua9:fix/extension-sw-health-huyua9
Open

fix(extension): detect stalled background worker#498
huyua9 wants to merge 1 commit into
alibaba:mainfrom
huyua9:fix/extension-sw-health-huyua9

Conversation

@huyua9
Copy link
Copy Markdown

@huyua9 huyua9 commented May 9, 2026

Summary

  • add a lightweight EXT_HEALTH_CHECK message handled by the extension background service worker
  • make TabsController verify the background worker before task startup
  • wrap background sendMessage calls with a short timeout and raise an actionable recovery error instead of returning null

Why

Issue #452 reports the side panel becoming unresponsive when Chrome MV3 leaves the extension service worker in a stuck/inactive state. The current tab-control path logs chrome.runtime.sendMessage failures and returns null, which can turn the real service-worker problem into a less helpful null dereference during task startup.

This keeps the service worker stateless/restartable, but gives the side panel a deterministic health probe and a clear failure message that points to the maintainer-provided recovery steps from #452.

This is intentionally scoped to the background/TabsController path and does not touch the sidepanel UI copy, so it complements the existing startup-guidance PR without overlapping its file scope.

Validation

  • npm ci --ignore-scripts --no-audit --no-fund (npm 10.9.4 reports the repo's npm ^11.6.3 engine warning)
  • npm run postinstall --workspace=@page-agent/ext
  • npm run typecheck
  • npx eslint packages/extension/src/agent/TabsController.ts packages/extension/src/entrypoints/background.ts
  • git diff --check
  • npm run build

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 9, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants