Skip to content

Add DeepSeek and OpenRouter widgets - #3743

Merged
steipete merged 9 commits into
steipete:mainfrom
brzvsk:feat/deepseek-openrouter-widget-support
Sep 20, 2026
Merged

steipete merged 9 commits into
steipete:mainfrom
brzvsk:feat/deepseek-openrouter-widget-support

Conversation

@brzvsk

@brzvsk brzvsk commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

DeepSeek and OpenRouter are now selectable in configurable widgets. Their credit balances use the existing menu-bar formatting; DeepSeek has no invented quota bar, while OpenRouter retains a real configured key limit alongside its balance. The optional snapshot field keeps older widget snapshots readable.

Small widgets now show their update age consistently. The age uses WidgetKit's native relative-date text: installed testing found that formatting a string inside TimelineView(.everyMinute) could freeze between reloads, so that implementation was replaced.

Validation

  • make check and independent P0–P2 review passed.
  • make test: all 1,245 selections across 114 groups passed, with no failures, retries, or timeouts.
  • 79 focused provider, snapshot, architecture, and widget-layout tests passed, including capped/uncapped balances and older JSON snapshots.
  • Matching Developer ID signed app and WidgetKit extension built successfully; packaged CLI/resource/launch probes passed without access to the build checkout.
  • Installed WidgetKit proof exercised the provider picker, DeepSeek without a quota bar, OpenRouter with and without a cap, and small/medium/large layouts. The existing widget survived the upgrade with its identity intact.
  • Native age advanced from 11 min, 59 sec to 14 min, 12 sec over 133 seconds while the main app was stopped, the extension PID stayed unchanged, and snapshot bytes and modification time stayed unchanged.
  • CI run 35477115895 passed all checks on 3c9d9ea57f0b63200449cc1e53db19896652e469. A lint-tool download hit a connection reset before lint ran; rerunning the failed jobs passed.

All screenshots use synthetic data. The test widget was removed, original preferences/snapshot/registrations restored, and the installed app relaunched after verification.

Provider picker before and after

Shipped picker Updated picker
Shipped widget picker without DeepSeek or OpenRouter Updated picker includes DeepSeek and OpenRouter

Balance and quota states

Uncapped OpenRouter Capped OpenRouter
Uncapped OpenRouter shows a 60 dollar balance Capped OpenRouter shows 75 percent credits left and a separate 60 dollar balance

DeepSeek and elapsed-time proof

First observation 133 seconds later
DeepSeek balance with age 11 minutes 59 seconds Same DeepSeek balance with age 14 minutes 12 seconds

Thanks @brzvsk for the provider widget support.

@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed September 19, 2026, 7:52 PM ET / 23:52 UTC (Revision 9).

ClawSweeper review

What this changes

Adds DeepSeek and OpenRouter widget choices and balance displays, suppresses DeepSeek’s artificial quota bar, and keeps update ages visible on small widgets.

Merge readiness

Blocked before merge - 3 items remain

This remains useful work absent from main and the latest release. No blocking code defect was found, but the elapsed-time evidence predates the final freshness implementation and needs updating.

Priority: P2
Reviewed head: 3c9d9ea57f0b63200449cc1e53db19896652e469

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is focused and compatibility-aware, but the final freshness change outdates the attached runtime proof.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Inspected native screenshots support the balance displays and historical elapsed-time behavior on 12ae0e3. The final shared freshness view now uses native relative-date text instead of that build’s TimelineView; supplied evidence does not show its after-fix age progression. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Inspected native screenshots support the balance displays and historical elapsed-time behavior on 12ae0e3. The final shared freshness view now uses native relative-date text instead of that build’s TimelineView; supplied evidence does not show its after-fix age progression. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 8 items Scope and policy: Read the complete root AGENTS.md and checked changed subtrees for nested policies; none were found. No maintainer-notes directory exists. Applied provider isolation, helper reuse, snapshot compatibility, and native UI evidence guidance.
Still necessary: The introduced diff enables both providers and adds balance projection. Both provider descriptors remain widgetSelectable:false in fetched main and v0.62.0.
Balance pipeline and compatibility: The snapshot writer reuses the existing menu-bar formatter with the selected provider’s snapshot. The added optional field has round-trip and absent-field decoding tests; tests also cover capped and uncapped OpenRouter, DeepSeek bar suppression, and missing balances. Tests were inspected, not executed in this read-only review.
Findings None None.
Security None None.

How this fits together

CodexBar writes provider usage into a shared JSON snapshot that its macOS widgets read. This change carries existing balance values through that pipeline into widget choices and displays.

flowchart LR
  A[Provider usage] --> B[App snapshot projection]
  B --> C[Shared JSON snapshot]
  C --> D[Widget provider selection]
  D --> E[Quota or balance display]
  C --> F[Native update age]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Inspected native screenshots support the balance displays and historical elapsed-time behavior on 12ae0e3. The final shared freshness view now uses native relative-date text instead of that build’s TimelineView; supplied evidence does not show its after-fix age progression. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The final native freshness implementation lacks corresponding after-fix elapsed-time observations in the supplied evidence.
  • Complete next step (P2) - Add real elapsed-time evidence from the final native-date implementation and correct the outdated TimelineView description. Screenshots or video are preferred; runtime logs also count. Redact private details. Updating the PR body should trigger review automatically; otherwise ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production +56/-11 lines; tests +214/-26 lines Production growth carries two existing provider balances into widgets; test growth covers rendering and snapshot compatibility.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the additive balance projection and existing native date rendering, with legacy snapshots and existing widget selections preserved.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the additive balance projection and existing native date rendering, with legacy snapshots and existing widget selections preserved.

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

Not applicable to the provider-support feature; source confirms both providers are excluded from the existing picker. Final-head elapsed-time behavior was not executed during this read-only review.

Is this the best way to solve the issue?

Yes: reusing the existing balance formatter and adding an optional snapshot field is a bounded extension of the current widget pipeline.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fd2414d29576.

Labels

Label justifications:

  • P2: Adds bounded widget support for two existing providers without an urgent user-facing regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Inspected native screenshots support the balance displays and historical elapsed-time behavior on 12ae0e3. The final shared freshness view now uses native relative-date text instead of that build’s TimelineView; supplied evidence does not show its after-fix age progression. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected native screenshots support the balance displays and historical elapsed-time behavior on 12ae0e3. The final shared freshness view now uses native relative-date text instead of that build’s TimelineView; supplied evidence does not show its after-fix age progression.

Evidence

What I checked:

  • Scope and policy: Read the complete root AGENTS.md and checked changed subtrees for nested policies; none were found. No maintainer-notes directory exists. Applied provider isolation, helper reuse, snapshot compatibility, and native UI evidence guidance. (AGENTS.md:1, 3c9d9ea57f0b)
  • Still necessary: The introduced diff enables both providers and adds balance projection. Both provider descriptors remain widgetSelectable:false in fetched main and v0.62.0. (Sources/CodexBarCore/Providers/OpenRouter/OpenRouterProviderDescriptor.swift:64, 4b3ed1a2a49a)
  • Balance pipeline and compatibility: The snapshot writer reuses the existing menu-bar formatter with the selected provider’s snapshot. The added optional field has round-trip and absent-field decoding tests; tests also cover capped and uncapped OpenRouter, DeepSeek bar suppression, and missing balances. Tests were inspected, not executed in this read-only review. (Tests/CodexBarTests/ProviderWidgetAvailabilityTests.swift:95, 3c9d9ea57f0b)
  • Inspected native screenshots: All three prepared images were opened locally. They visibly show DeepSeek and OpenRouter balances and an age transition from <1 min to 6 min. The captured PR body identifies build 12ae0e3 and reports an unchanged widget PID and snapshot hash. This remains positive historical evidence, but covers the earlier custom timer implementation. (12ae0e35c638)
  • Latest change supersedes elapsed-time claim: The exact latest commit removes TimelineView and its minute formatter, restores native relative-date text, and reports that installed custom strings froze. Its supplied material does not show an observed after-fix elapsed-time result. The PR body still describes TimelineView and the removed formatter tests. Local prior-head comparison encountered an unavailable object; the exact GitHub commit patch supplied the comparison. (Sources/CodexBarWidget/WidgetDesignSystem.swift:427, 3c9d9ea57f0b)
  • Existing native-date behavior and routing: Main already uses native relative-date text in the shared freshness view. Source history associates the widget layout with iamenahs’s merged widget work; separate picker history records Peter Steinberger’s static AppIntents metadata repair. (Sources/CodexBarWidget/WidgetDesignSystem.swift:426, 1b6b99d117f6)

Likely related people:

  • iamenahs: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Attach elapsed-time evidence for the final native-date implementation and update the PR description to match it.

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 (8 earlier review cycles)
  • reviewed 2026-09-18T18:00:26.943Z sha 63f85d9 :: needs changes before merge. :: [P2] Preserve live widget ages between timeline reloads
  • reviewed 2026-09-18T18:12:49.804Z sha ebf44cc :: needs real behavior proof before merge. :: [P2] Preserve live ages across all widget families
  • reviewed 2026-09-18T18:39:26.673Z sha 6a6e47d :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-19T07:16:34.273Z sha 12ae0e3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-19T07:29:27.578Z sha 12ae0e3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T07:54:50.635Z sha 12ae0e3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T11:14:31.590Z sha d9d6b41 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T23:11:43.109Z sha 7703300 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 18, 2026
@brzvsk

brzvsk commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Sep 18, 2026
@brzvsk

brzvsk commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@Chipagosfinest

Copy link
Copy Markdown
Contributor

Cross-link: #3748 also makes OpenRouter widget-selectable, but for Activity spend (tokenUsage / Overview) rather than credit balance. Happy to stay out of the balance-text path if this lands first.

@brzvsk

brzvsk commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@brzvsk

brzvsk commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Elapsed-time native proof is now attached in the PR body: the installed widgets visibly advance from <1 min to 6 min while the CodexBar app process is stopped, the WidgetKit extension remains on PID 67298, and the shared snapshot keeps the same mtime, size, and SHA-256.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 19, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 19, 2026
@brzvsk

brzvsk commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Full local suite and GitHub CI are now green:

  • make test: 1219/1219 selections, 112/112 groups passed on the first run
  • 0 failures, retries, or timeouts
  • all GitHub checks pass, including both macOS shards

The PR description now includes these receipts alongside the native elapsed-time proof. @clawsweeper re-review

brzvsk and others added 3 commits September 19, 2026 14:09
Preserve account widget support, document balance-only behavior, and cover capped and uncapped OpenRouter rendering.
Installed WidgetKit proof showed custom TimelineView strings freezing while the app was stopped. Retain native relative date text and keep it visible on small widgets.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient Contributor real behavior proof is sufficient. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Add DeepSeek and OpenRouter widgets This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit e4fa9ca into steipete:main Sep 20, 2026
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants