Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Refresh pending social claims from the check status action
Barack Sokullu25f8115edb4f
diff --git a/docs/compass-quota-rollout.md b/docs/compass-quota-rollout.mdindex 35c58e891..f47e2aaa6 100644--- a/docs/compass-quota-rollout.md+++ b/docs/compass-quota-rollout.md@@ -13,6 +13,8 @@ Local configuration inspected on 2026-10-05: neither the process environment norThe backend now uses a stable **`USAGE_PATH.lock`** and atomically replaces the usage JSON. For the first upgrade from the old in-place writer, stop and drain **all** old web workers and review/report CLI processes before starting the new version; do not mix the two lock protocols. Confirm the store owner can create the lock and temporary files and replace the JSON on the same filesystem. Never remove the lock file while any worker is running. Keep the `0.75` override throughout this backend migration and the extension release.+Production storage must support POSIX directory `fsync`: verify file and parent-directory syncing on the actual usage-store filesystem. Windows PHP cannot sync directory handles; its local validation covers process interruptions, while the Linux durability test exercises directory-sync failures and idempotent retries. Client telemetry is best-effort and globally capped at 10,000 retained device/day observations; excess events return `recorded: false`. Actual metered consumption and lifetime awards are independent of that telemetry cap.+## Manual reviewRun as the usage-store owner on the backend host:diff --git a/docs/compass-quota-validation.md b/docs/compass-quota-validation.mdindex e48dd28cb..9f0f17e00 100644--- a/docs/compass-quota-validation.md+++ b/docs/compass-quota-validation.md@@ -11,7 +11,7 @@ Both repositories were clean before implementation. No applicable `AGENTS.md` wa| Cloud Plus, portal subscription recovery, renewal notices | Passed || Cloud PHP syntax | Passed for service, promotion trait, routes, and both new CLI scripts || Extension `npm run test:compass-quota` | 19 tests passed across Chrome and Firefox |-| Extension `npm run test:compass-quota:ui` | 404 assertions passed in Chromium and Firefox, all 23 supported locales |+| Extension `npm run test:compass-quota:ui` | 406 assertions passed in Chromium and Firefox, all 23 supported locales || Extension billing/payment notice | Passed in both builds || Extension runtime lifecycle suite | 218 tests and 14 UI/content lifecycle checks passed || Extension provider limits | Passed |@@ -39,10 +39,12 @@ Ordinary quota reads now use a shared read lock without creating lifetime claimsBoth browsers emit one recovery signal on response-only quota failure. Provider switching checks connection results, exceptions, and stale tests before reporting readiness. The rendered fixture server selects locales from a fixed allowlist, with malicious locale query regressions. The PDF browser test captures its Chrome tab ID at creation instead of rediscovering it by URL. GitHub CodeQL confirmed the fixture injection alert was fixed, and PDF/WebMCP CI passed after the first review fixes.-The full **npm test** passed, including **2,426 legacy tests** and **60 security checks**. Focused quota tests passed 19 cases, and the browser fixture passed 404 assertions across both engines and 23 locales. Both extension builds, payment notices, and real Chrome PDF/WebMCP tests passed; English and Arabic narrow-panel screenshots were inspected again.+The full **npm test** passed, including **2,426 legacy tests** and **60 security checks**. Focused quota tests passed 19 cases, and the browser fixture passed 406 assertions across both engines and 23 locales. Both extension builds, payment notices, and real Chrome PDF/WebMCP tests passed; English and Arabic narrow-panel screenshots were inspected again.The full cloud **composer check** and the real HTTP/review-CLI suite passed after the latest cloud fixes. Earlier validation blockers were resolved: shell fixtures use LF line endings, the default-model test uses an isolated root without a developer .env, the PII CLI recognizes absolute Windows lock paths, and stale provider/structured-error source assertions match the current behavior. The actual .env was untouched. Expected fault-case diagnostics remain in passing test logs.+Further review regressions verify that the pending claim button fetches status in both browsers, concurrent rotating device headers cannot exceed the global telemetry cap, dropped events do not rewrite the ledger, and exact checkout timestamps outside 30 days cannot convert. Linux PHP durability tests verify file-then-directory sync and safe approval retry after an injected directory-sync failure. The Linux social test could not run because that PHP installation lacks PDO SQLite; the complete cloud check and social/concurrency suite passed with Windows PHP. Windows PHP cannot sync directory handles, so production power-loss durability requires a POSIX filesystem with directory fsync.+Fresh Codex reviews and GitHub checks are recorded on each PR.## Local artifacts and rolloutdiff --git a/src/chrome/src/ui/compass-quota.js b/src/chrome/src/ui/compass-quota.jsindex f00df6c12..0cd6986ad 100644--- a/src/chrome/src/ui/compass-quota.js+++ b/src/chrome/src/ui/compass-quota.js@@ -43,8 +43,9 @@ export function createQuotaController({ t, locale, request, openUrl, providers,status.setAttribute('role', 'status'); status.setAttribute('aria-live', 'polite');const share = button(t('quota.get'), async () => {host.dataset.claimOpen = 'true';- operations.version++;try {+ if (social?.status === 'pending') { await inflight; await refresh(); return; }+ operations.version++;if (!social?.share_url) social = await request('/promotions/social');if (cards.get(host)?.refresh !== refresh) return;renderState(); showClaim();diff --git a/src/firefox/src/ui/compass-quota.js b/src/firefox/src/ui/compass-quota.jsindex f00df6c12..0cd6986ad 100644--- a/src/firefox/src/ui/compass-quota.js+++ b/src/firefox/src/ui/compass-quota.js@@ -43,8 +43,9 @@ export function createQuotaController({ t, locale, request, openUrl, providers,status.setAttribute('role', 'status'); status.setAttribute('aria-live', 'polite');const share = button(t('quota.get'), async () => {host.dataset.claimOpen = 'true';- operations.version++;try {+ if (social?.status === 'pending') { await inflight; await refresh(); return; }+ operations.version++;if (!social?.share_url) social = await request('/promotions/social');if (cards.get(host)?.refresh !== refresh) return;renderState(); showClaim();diff --git a/test/compass-quota-ui.mjs b/test/compass-quota-ui.mjsindex caea9c778..b520a9817 100644--- a/test/compass-quota-ui.mjs+++ b/test/compass-quota-ui.mjs@@ -154,8 +154,13 @@ try {assert.equal(await page.locator('.quota-claim form button[type=submit]').isDisabled(), false);assert.equal(await page.evaluate(() => continuations.length), 0); checks += 2;await page.evaluate(() => { window.rejectSubmission = false; });+ await page.locator('.quota-claim form button[type=submit]').click();+ await page.waitForFunction(() => !document.querySelector('.quota-claim form'));await page.evaluate(() => { claim.status = 'approved'; claim.eligible = false; claim.remaining_credit_usd = 0.5; });- await page.evaluate(() => controller.refreshAll());+ const usageReadsBeforeCheck = await page.evaluate(() => requests.filter(r => r.path === '/usage').length);+ await page.getByRole('button', { name: 'Check claim status', exact: true }).click();+ await page.waitForFunction(() => document.querySelector('.quota-share')?.hidden);+ assert.equal(await page.evaluate(() => requests.filter(r => r.path === '/usage').length), usageReadsBeforeCheck + 1); checks++;assert.equal(await page.locator('.quota-share:visible').count(), 0);assert.match(await page.locator('.quota-balance').textContent(), /\$0\.50/);assert.equal(await page.evaluate(() => continuations.length), 0); checks += 3;