Skip to content

feat: cut over Synthetic, Poe, xAI, and z.ai to JavaScript on all platforms - #2758

Merged
steipete merged 7 commits into
mainfrom
steipete/js-cutover-wave2
Aug 8, 2026
Merged

feat: cut over Synthetic, Poe, xAI, and z.ai to JavaScript on all platforms#2758
steipete merged 7 commits into
mainfrom
steipete/js-cutover-wave2

Conversation

@steipete

@steipete steipete commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Cut over Synthetic, Poe, xAI, and z.ai to their bundled JavaScript providers on both Apple and Linux platforms; the prototype flag no longer controls these four providers.
  • Delete 2,752 lines of production Swift fetch/parser twins: Synthetic 750, Poe 565, xAI 429, and z.ai 1,008.
  • Retain z.ai's native regional/validated endpoint router and dashboard routing at the settings boundary while JavaScript owns HTTP fetching, parsing, quota projection, model totals, and token charts.
  • Raise the conversion totals to 10 providers cut over on all platforms and 5 providers still converted but flag-gated.

Deliberate cookie-provider stops

OpenAI remains flag-gated, as do the four cookie providers whose JavaScript projections are proven but whose native orchestration still owns named behavior gaps:

  • Manus: multi-session invalid-token fallback and cache repair.
  • Perplexity: session-cookie-name rotation plus multi-session invalid-token retry.
  • T3 Chat: manual cURL capture parsing and forwarding of provider-specific browser headers.
  • Qoder: site-scoped global/China cookie routing, retry exhaustion, and source-aware dashboard routing.

Verification

  • make check and make build
  • Golden/parity/gatekeeper suites green
  • Provider plugin engine A/B goldens: 60/60 on JavaScriptCore and 60/60 on QuickJS
  • Full macOS suite: 820/820 selections
  • Linux Docker suite: 408 tests, 0 failures
  • Structured Codex autoreview: clean, no accepted/actionable findings

🤖 Generated with Claude Code

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. labels Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codex review: needs changes before merge. Reviewed August 8, 2026, 1:16 AM ET / 05:16 UTC.

ClawSweeper review

What this changes

The PR makes Synthetic, Poe, xAI, and z.ai use bundled JavaScript usage providers on Apple and Linux, removing their duplicate Swift fetchers.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this owner-authored PR open, but it still has the previously reported P2 clock defect: Poe remains on host wall time despite the new injected plugin clock. Likely related person: steipete (high confidence from the portable-plugin and current cutover history).

Priority: P2
Reviewed head: 624f1f46c59a5b4ef42b235b753e7f1cb734d450

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The migration has substantial stated validation, but the unresolved deterministic Poe history defect blocks merge readiness.
Proof confidence 🌊 off-meta tidepool Not applicable: This owner-authored provider migration reports broad fixture and platform validation; the remaining blocker is a source-proven deterministic-clock defect rather than missing external-contributor proof.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This owner-authored provider migration reports broad fixture and platform validation; the remaining blocker is a source-proven deterministic-clock defect rather than missing external-contributor proof.
Evidence reviewed 3 items Poe still uses the wall clock: Poe’s JavaScript provider computes its 30-day history cutoff with Date.now() and its Today bucket with a second Date.now() call.
The affected Poe script is unchanged on the PR head: The same Poe script blob appears on current main and the PR head, so the prior finding remains applicable after the force-push.
Plugin-engine provenance: The portable JavaScript provider engine and Poe plugin history on main trace to the QuickJS portability work.
Findings 1 actionable finding [P2] Use the injected clock in Poe history windows
Security None None.

How this fits together

Provider descriptors turn saved credentials and settings into normalized usage snapshots for CodexBar’s menu-bar cards and dashboards. This PR changes the execution layer that fetches and projects data for four API-token providers.

flowchart LR
A[Provider credentials and settings] --> B[Provider descriptor]
B --> C[Bundled JavaScript provider]
C --> D[Normalized usage snapshot]
D --> E[Menu bar cards]
D --> F[Provider dashboard links]
Loading

Before merge

  • Use the injected clock in Poe history windows (P2) - poe.js is unchanged on this head and still uses Date.now() here and for the Today bucket at line 122. The new ctx.date.now() support therefore never affects Poe: a fixed fetchUsage(now:) can filter the 30-day window and classify Today from the host wall clock instead of the supplied refresh time. Replace both reads and add a fixed past-clock history fixture.
  • Resolve merge risk (P1) - Merging before Poe uses the injected refresh clock leaves fixed-time fetches with non-deterministic 30-day and Today calculations, so valid historical entries can be omitted or assigned to the wrong day in controlled refreshes.
  • Complete next step (P2) - A narrow, source-proven repair remains: wire Poe’s two time-window reads to the already-injected refresh clock and cover it with a fixed-clock fixture.

Findings

  • [P2] Use the injected clock in Poe history windows — Sources/CodexBarCore/Resources/Plugins/poe.js:69
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Provider migration scope 4 providers; 41 files; +927/-5,859 lines The cutover replaces several credentialed provider implementations, making compatibility validation material before merge.

Merge-risk options

Maintainer options:

  1. Repair deterministic Poe history (recommended)
    Replace Poe’s two wall-clock reads with the injected plugin clock and add a fixed past-clock history fixture before merging.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Replace Poe history-window and Today clock reads with ctx.date.now(), add a fixed-clock regression fixture, then run the focused Poe plugin test and make check.

Technical review

Best possible solution:

Use ctx.date.now() for Poe’s cutoff and Today calculation, then prove a fixed historical snapshot remains stable when the host wall clock differs.

Do we have a high-confidence way to reproduce the issue?

Yes, by calling Poe’s plugin runtime with a fixed now far from the host clock: the source uses Date.now() for both the history cutoff and Today bucket rather than the supplied refresh time.

Is this the best way to solve the issue?

No: the PR introduces ctx.date.now() but Poe does not consume it; replacing both Poe wall-clock reads and adding a fixed-clock fixture is the narrow maintainable repair.

Full review comments:

  • [P2] Use the injected clock in Poe history windows — Sources/CodexBarCore/Resources/Plugins/poe.js:69
    poe.js is unchanged on this head and still uses Date.now() here and for the Today bucket at line 122. The new ctx.date.now() support therefore never affects Poe: a fixed fetchUsage(now:) can filter the 30-day window and classify Today from the host wall clock instead of the supplied refresh time. Replace both reads and add a fixed past-clock history fixture.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2161b06500d7.

Labels

Label justifications:

  • P2: The remaining deterministic-history defect is a bounded provider correctness issue without evidence of an urgent outage.
  • merge-risk: 🚨 compatibility: The PR removes native provider implementations and makes existing API-token users depend on JavaScript-only paths.
  • merge-risk: 🚨 auth-provider: The migration changes credential and endpoint handling for xAI and z.ai alongside the other provider cutovers.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This owner-authored provider migration reports broad fixture and platform validation; the remaining blocker is a source-proven deterministic-clock defect rather than missing external-contributor proof.

Evidence

Acceptance criteria:

  • [P1] swift test --filter PoePluginGoldenTests.
  • [P1] make check.

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the main-branch portable QuickJS provider work that introduced the affected Poe JavaScript surface and is also carrying this cutover. (role: portable-provider engine contributor and current PR owner; confidence: high; commits: cee0fd074073, 624f1f46c59a; files: Sources/CodexBarCore/Resources/Plugins/poe.js, Sources/CodexBarCore/Plugins/ProviderPluginRuntime.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Switch both Poe wall-clock reads to ctx.date.now() and add a fixed historical-window regression fixture.
  • Run the focused Poe plugin test and make check after the repair.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-08T04:20:37.703Z sha 5302cf6 :: needs changes before merge. :: [P2] Honor the injected clock before making Poe JS the only strategy
  • reviewed 2026-08-08T04:32:13.562Z sha fe27afa :: needs changes before merge. :: [P2] Use the injected clock in Poe's date-window calculations
  • reviewed 2026-08-08T04:54:42.280Z sha 02041bb :: needs changes before merge. :: [P2] Use the injected clock for Poe history windows
  • reviewed 2026-08-08T04:59:25.029Z sha ab7b966 :: found issues before merge. :: [P2] Use the injected clock for Poe history windows
  • reviewed 2026-08-08T05:02:09.247Z sha ab7b966 :: needs changes before merge. :: [P2] Use the injected clock for Poe history windows

The 0.15s interrupt must fire promptly, not wait out the hang; the 1s
elapsed bound flaked at 1.66s on a loaded ARM64 runner. 5s still proves
prompt termination against an unbounded loop.
The 0.3s stop signal must beat the 10s interval; the 2s elapsed bound
flaked at 2.02s on a loaded x64 runner. 5s still proves prompt
interruption.
@steipete
steipete force-pushed the steipete/js-cutover-wave2 branch from ab7b966 to 624f1f4 Compare August 8, 2026 05:12
@steipete
steipete merged commit 8fc67d7 into main Aug 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant