[codex] Reduce OpenAI dashboard scrape payload#1034
Closed
jb510 wants to merge 1 commit into
Closed
Conversation
Owner
|
Thanks @jb510, landed this on main as I could not update the contributor branch directly, so I rebased and landed the reviewed patch from a maintainer branch while preserving the original commit author. Local proof before landing:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
document.documentElement.outerHTMLduring normal OpenAI dashboard polling.debugDumpHTMLis enabled for diagnostic failure paths.bodyHTML.Closes #1033.
Why
Sampling a high-CPU CodexBar refresh showed the OpenAI web path spending time serializing/parsing full dashboard HTML and reparsing embedded bootstrap JSON in Swift. The normal refresh path only needs a few structured values from that HTML, so returning the full DOM on every poll is avoidable work.
Testing
swift test --filter OpenAIDashboardScrapeScriptTestsswift test --filter OpenAIDashboardFetcherCreditsWaitTestsswift test --filter OpenAIDashboardParserTestsmake checkCODEXBAR_SIGNING=adhoc CODEXBAR_WIDGET_METADATA_MODE=skip ./Scripts/package_app.sh releaseFull Suite Note
swift testwas run and reached 2722 tests, but reported 2 failures outside this change area:MistralUsageParserTests.swift:115: expected month11, observed10ProviderStorageFootprintTests.swift:401: expected generation41, observed42The OpenAI web-focused tests passed after the scrape-payload change.
Local Test Status
Built and installed locally for manual validation from branch
perf/openai-web-scrape-payload.