GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(meta-exporter): re-home exporter + helium-cdp wedge readiness probe (#5487) by dezren39 · Pull Request #6333 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: adbd6efdd6
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (recovery.result === "restarted") { | ||
| const secondProbe = await probe(cdpBase); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Refresh the target list after restarting the browser
When a dev.meta.ai tab exists before recovery, targets contains its pre-restart debugger URL. After a successful restart and second readiness probe, the code still selects that old target and passes its obsolete URL to connectWs, causing the recovered tick to fail instead of exporting quotas. Re-fetch /json/list after successful recovery before selecting or creating the console page.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1fcac56 (task 10564, lane code-y): run() now re-fetches /json/list after a successful bounded restart and second readiness probe, before selecting or creating the console page; a failed re-fetch fails as cdp-unavailable with the recovery record attached.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| try { | ||
| await doRestart(); | ||
| } catch (e) { | ||
| return { action: "restart", unit: HELIUM_UNIT, at, result: "restart-failed", detail: e.message }; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Persist the cooldown before attempting the restart
If the restart rejects or times out, this return bypasses the cooldown-state write, so subsequent exporter invocations can immediately attempt another restart. This is reachable through the existing Meta session keeper, which invokes the exporter again when its latest document is unsuccessful, independently of the exporter timer. Persist the attempt timestamp before calling doRestart() so failed attempts also obey the promised once-per-15-minute bound.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1fcac56 (task 10564, lane code-y): attemptBoundedRestart now persists the attempt timestamp to .helium-restart.json BEFORE calling the restart, so failed/timed-out attempts obey the 15-minute bound. New regression test 'attemptBoundedRestart: a failed restart still persists the cooldown bound' passes (suite 11/11 on the laptop).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Description=Run the Meta quota exporter every 15 minutes — code#1301 Phase 1 | ||
|
|
||
| [Timer] | ||
| OnCalendar=*:0/15 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Register the Meta exporter timer in the fleet inventory
This change adds the repository-owned 15-minute timer and an installer that enables it, but a search of doc/fleet-schedule-registry.md finds no meta-quota-export.timer entry in the laptop systemd inventory. Root AGENTS.md requires schedule changes to update that registry in the same pass; without the entry, this recurring exporter remains invisible to the fleet placement audit. Add its Surface 2b record alongside the timer.
AGENTS.md reference: AGENTS.md:L53-L58
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1fcac56 (task 10564, lane code-y): doc/fleet-schedule-registry.md Surface 2b now carries a meta-quota-export.timer row with the effective spec verified live on the laptop (systemctl --user show: OnCalendar=--* *:00/15:00, activating meta-quota-export.service).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (!frame?.webSocketDebuggerUrl) return null; | ||
| const client = await connectWs(frame.webSocketDebuggerUrl); | ||
| try { | ||
| const text = await evaluate(client, "document.body ? document.body.innerText : ''"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Bound the optional billing-frame read
When the optional billing iframe accepts CDP but never answers Runtime.evaluate, this await never settles, and the catch cannot handle an unresolved promise. The quota and credit payloads have already been successfully parsed before run() calls this helper, but the best-effort PAYG read then prevents any output document from being written before the service's 120-second timeout kills the process. Timeout the iframe read and return null so an unavailable optional balance cannot discard otherwise valid quota measurements.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1fcac56 (task 10564, lane code-y): the billing-frame read in fetchPaygBalance is now raced with withTimeout(..., 10000); a frame that never answers Runtime.evaluate resolves null, which parsePaygBalance maps to an absent (null) PAYG balance, so the export document is still written.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…gets after restart, persist restart cooldown before attempt, bound billing-frame read, register meta-quota-export.timer in fleet schedule registry (#5487)
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fcac56075
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return { ok: false, detail: `probe: ${e.message}` }; | ||
| } finally { | ||
| try { client?.close(); } catch { /* best effort */ } | ||
| if (target?.id) await close(cdpBase, target.id); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Bound the readiness probe's target cleanup
When CDP accepts target creation but leaves /json/close/<id> unanswered, this cleanup blocks indefinitely because closeTarget() calls fetch() without a timeout. Even if Page.navigate has already timed out, the probe cannot return its failure result, so run() never reaches the bounded restart or writes a failure document. The checked meta-quota-export.service instead kills the invocation after 120 seconds, leaving the previous measurement in place. Bound the cleanup request independently so it cannot prevent the readiness probe from completing.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const frame = targets.find( | ||
| (t) => t.type === "iframe" && typeof t.url === "string" && t.url.includes("billing.dev.meta.ai"), | ||
| ); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Associate the PAYG iframe with the selected team
When Helium has console and billing tabs for different Meta teams, this browser-wide lookup can select a billing iframe belonging to a different team than the quota page. run() derives the quota team's ID from the selected page's team_id, but passes only cdpBase to this helper, so a successful document can combine one team's quota and free credits with another team's PAYG balance. The consumer in pm-stack/aggregator/src/quota-gather-map.ts then displays that balance as an ok window. Associate the billing frame with the selected page/team, or report null when that association cannot be established.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
helium-cdp can wedge with CDP answering but every page load hanging; nothing detects or repairs it
There was an error while loading. Please reload this page.