Skip to content

Add global low power mode - #2518

Open
Carl723000 wants to merge 1 commit into
steipete:mainfrom
Carl723000:codex/global-low-power-mode
Open

Add global low power mode#2518
Carl723000 wants to merge 1 commit into
steipete:mainfrom
Carl723000:codex/global-low-power-mode

Conversation

@Carl723000

Copy link
Copy Markdown

Fixes #2508

Summary

  • add a default-off global Low Power Mode under General → Refreshing
  • clamp automatic provider refreshes, Adaptive refreshes, local usage scans, and storage scans to a minimum 30-minute interval
  • apply the existing OpenAI Web battery-saver policy while global Low Power Mode is enabled
  • preserve manual refreshes, saved refresh-frequency choices, statistics settings, and Agent Sessions behavior
  • distinguish the provider-specific OpenAI web battery saver from the global control
  • include an audited Simplified Chinese translation and Chinese design document

Behavior

Background channel Normal behavior Global Low Power Mode
Fixed / Adaptive provider refresh selected or adaptive cadence no more often than every 30 minutes
Reset-boundary provider refresh may run before the normal poll never earlier than the 30-minute minimum
Local token / cost scan follows refresh cadence, minimum 5 minutes minimum 30 minutes
Provider storage scan 5-minute automatic cooldown 30-minute automatic cooldown
OpenAI Web routine refresh provider-specific saver controls it treated as saver enabled
Explicit manual refresh immediate unchanged

Validation

  • 56 focused tests in 9 suites passed, covering policy, settings, fixed/Adaptive timers, reset-boundary refresh, local usage, storage, and OpenAI Web gates
  • the regular OpenAI Web regression test was mutation-checked: reverting the runtime to the provider-only saver makes it fail
  • SwiftFormat: 0/1660 files require formatting
  • app locale checker: 22 catalogs pass against 1307 English keys
  • plutil and git diff --check pass
  • release CodexBar product build passed locally with the repository's Command Line Tools compatibility flags
  • portable repository checks passed; local SwiftLint execution is unavailable because this Mac has Command Line Tools rather than the full Xcode SourceKit framework, so CI remains authoritative for SwiftLint

The local ad-hoc no-Widget packaging used for manual testing is not part of this PR.

🤖 Generated with OpenAI Codex

Clamp automatic provider, local usage, storage, and OpenAI Web work while preserving manual refreshes.

Co-authored-by: OpenAI Codex <215057067+openai-codex[bot]@users.noreply.github.com>
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 1:02 PM ET / 17:02 UTC.

ClawSweeper review

What this changes

Adds a default-off Global Low Power Mode setting that limits automatic provider, local-usage, storage, and OpenAI Web background refresh behavior to at least 30 minutes while leaving manual refresh available.

Merge readiness

Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open for maintainer product review and real after-fix behavior proof. The implementation is a coherent, default-off proposal, but it adds a new app-wide preference that changes several refresh policies and has no maintainer-confirmed direction or attached live proof yet.

Priority: P3
Reviewed head: 403cce77ed5dfd5b39b972d4573333dcbc81b7e9
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and well-covered by targeted tests, but missing real behavior proof remains a merge gate for this external feature PR.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR body reports tests and a local product build, but no attached live run, recording, terminal output, redacted runtime log, or artifact demonstrates the changed setting in a real CodexBar setup; add redacted evidence before merge. 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 real behavior proof before merge: The PR body reports tests and a local product build, but no attached live run, recording, terminal output, redacted runtime log, or artifact demonstrates the changed setting in a real CodexBar setup; add redacted evidence before merge. 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 4 items Scoped, default-off implementation: The branch adds a persisted backgroundWorkLowPowerModeEnabled setting with a default of false, observes it for menu updates, and routes automatic intervals through a shared 30-minute policy while retaining nil for manual mode.
Automatic scheduling coverage: The diff applies the policy to fixed and adaptive provider refreshes, reset-boundary scheduling, token/cost cadence, storage refresh cooldowns, and the effective OpenAI Web battery-saver gate.
Existing request is the canonical product context: The linked open issue describes the current OpenAI Web saver as provider-specific and asks maintainers to choose between a true global preset and clearer scope; this PR is a candidate implementation for that still-open direction.
Findings None None.
Security None None.

How this fits together

CodexBar’s settings store feeds refresh policy into provider polling, local token/cost scans, storage-footprint scans, and optional OpenAI Web enrichment. This PR adds one persisted preference and applies a shared interval policy at those automatic scheduling seams.

flowchart LR
    A[User settings] --> B[Global Low Power Mode]
    B --> C[Shared background power policy]
    C --> D[Provider refresh timers]
    C --> E[Local usage scans]
    C --> F[Storage scans]
    B --> G[OpenAI Web saver gate]
    D --> H[Updated menu data]
    E --> H
    F --> H
    G --> H
Loading

Decision needed

Question Recommendation
Should CodexBar expose a default-off global Low Power Mode that intentionally overrides all automatic refresh channels to a 30-minute minimum while preserving each saved refresh preference? Approve the global preset: Accept the app-wide, default-off setting and require live proof that its automatic and manual refresh boundaries work as described.

Why: The implementation is technically bounded, but the linked canonical request is explicitly a product-choice issue: maintainers must decide whether an app-wide preset is preferable to a narrower clarification of the existing OpenAI Web-only saver.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports tests and a local product build, but no attached live run, recording, terminal output, redacted runtime log, or artifact demonstrates the changed setting in a real CodexBar setup; add redacted evidence before merge. 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 new opt-in setting deliberately changes several independent background-work paths, so maintainers should explicitly confirm that a 30-minute shared floor—not a narrower provider-only control—is the desired permanent product contract.
  • Resolve merge risk (P1) - The PR body reports tests and a local build but provides no attached real-app evidence that toggling the setting immediately changes automatic cadence while preserving manual refresh and persisted user choices.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change surface 25 files affected; 715 added, 19 removed One new preference reaches multiple timer and scan paths, so maintainers should review the intended app-wide policy boundary rather than only the settings toggle.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #2508
Summary: This PR is an implementation candidate for the open request to add a global low-power preset or clarify the scope of the existing OpenAI Web saver.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    If maintainers approve the global-control direction, retain the centralized policy and add redacted real-app proof showing enablement, a clamped automatic path, an immediate manual refresh, and persistence after relaunch.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

If maintainers approve the global-control direction, retain the centralized policy and add redacted real-app proof showing enablement, a clamped automatic path, an immediate manual refresh, and persistence after relaunch.

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

Not applicable: this PR proposes new opt-in behavior rather than repairing an established failing contract. Its automated coverage describes the intended scheduling rules, but no real-app proof is attached.

Is this the best way to solve the issue?

Unclear: centralizing the 30-minute floor in one pure policy is a maintainable implementation, but maintainers must first confirm that this app-wide preference is the preferred product direction over a narrower clarification of the existing OpenAI Web saver.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8ef86077e70a.

Labels

Label justifications:

  • P3: This is a default-off power-management feature proposal, not a current availability, data-loss, security, or message-delivery regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports tests and a local product build, but no attached live run, recording, terminal output, redacted runtime log, or artifact demonstrates the changed setting in a real CodexBar setup; add redacted evidence before merge. 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

What I checked:

  • Scoped, default-off implementation: The branch adds a persisted backgroundWorkLowPowerModeEnabled setting with a default of false, observes it for menu updates, and routes automatic intervals through a shared 30-minute policy while retaining nil for manual mode. (Sources/CodexBar/BackgroundWorkPowerPolicy.swift:1, 403cce77ed5d)
  • Automatic scheduling coverage: The diff applies the policy to fixed and adaptive provider refreshes, reset-boundary scheduling, token/cost cadence, storage refresh cooldowns, and the effective OpenAI Web battery-saver gate. (Sources/CodexBar/UsageStore.swift:379, 403cce77ed5d)
  • Existing request is the canonical product context: The linked open issue describes the current OpenAI Web saver as provider-specific and asks maintainers to choose between a true global preset and clearer scope; this PR is a candidate implementation for that still-open direction. (docs/codex.md:1, 8ef86077e70a)
  • Validation is test-oriented rather than attached live proof: The PR body reports focused tests, formatting, locale, and build checks, but it does not include a screenshot, recording, terminal capture, runtime log, or linked artifact demonstrating the enabled setting and its observed behavior in a real app run. (403cce77ed5d)

Likely related people:

  • steipete: The current default branch and release workflow center on the CodexBar settings and refresh surfaces affected by this proposal; final acceptance requires a repository-level product decision. (role: recent adjacent owner; confidence: low; commits: 8ef86077e70a; files: Sources/CodexBar/SettingsStore.swift, Sources/CodexBar/UsageStore.swift)
  • cbrane: The existing provider-specific OpenAI Web battery-saver behavior is the closest prior product surface, and this PR explicitly preserves it while broadening the scope through a separate setting. (role: adjacent feature contributor; confidence: low; files: Sources/CodexBar/UsageStore+OpenAIWeb.swift, Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift)

Rank-up moves

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

  • Attach redacted real-app evidence showing the setting enabled, an automatic path clamped to 30 minutes, and an unchanged immediate manual refresh.
  • Obtain maintainer confirmation that an app-wide low-power preset is the intended product direction.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

Add a global low-power preset or clarify OpenAI web battery saver scope

1 participant