Skip to content

fix: follow app privacy setting on serve dashboard - #2960

Closed
urda wants to merge 1 commit into
steipete:mainfrom
urda:urda/serve-hide-personal-info
Closed

fix: follow app privacy setting on serve dashboard#2960
urda wants to merge 1 commit into
steipete:mainfrom
urda:urda/serve-hide-personal-info

Conversation

@urda

@urda urda commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The codexbar serve web dashboard ignored the app's "Hide personal information" setting. It always showed full account emails unless the operator passed --identity redacted at startup.

This change makes the serve dashboard follow that setting.

  • When --identity is absent, each request reads the app's hidePersonalInfo preference. The toggle on redacts email local parts. The toggle off keeps full emails.
  • The setting is read per request, so a change applies without a serve restart. Serve already reads resetTimesShowAbsolute and weeklyProgressWorkDays from the same defaults domain.
  • An explicit --identity redacted or --identity full still wins, so a scripted client keeps the mode that it asked for.
  • The resolved mode joins the response cache key. A body that the cache stored before a toggle cannot be replayed after it.
  • codexbar dashboard keeps its full identity default. A one-shot JSON command must not change its output because of a GUI toggle.

serveDashboardSnapshotRoute moved out of handleServeRequest. The new lines pushed that function past the 150-line SwiftLint limit, so the route got its own function instead of a lint suppression.

Commands run

  • swift build
  • make check (SwiftFormat and SwiftLint strict): 0 violations
  • make test: 864 selections in 72 groups, 0 failures, 0 retries

Tests

Tests/CodexBarTests/CLIServeDashboardIdentityTests.swift covers:

  • An absent flag follows the privacy setting in both directions.
  • An explicit flag overrides the privacy setting in both directions.
  • Flag presence separates an explicit full from an absent flag.
  • The operation key differs between identity modes.

These tests run no live provider probe and open no Keychain prompt.

Notes

The raw /usage and /cost routes still return full emails. Only the dashboard snapshot follows the setting, and the web UI reads that snapshot. This preserves the documented shape of the JSON API routes.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 027aefadf9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +712 to +714
let dashboardIdentityMode = Self.dashboardIdentityFlagPresent(in: values)
? decodedIdentityMode
: nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update serve help for the new identity default

When --identity is omitted, these lines now make serve follow the app preference, but both the option help near ServeOptions.identity and CLIHelp.serveHelp still tell users that identity defaults to full account emails. Consequently, someone consulting codexbar serve --help can miss that a GUI toggle changes the HTTP response and can break clients that depend on full email identities; document the preference-following default and the explicit full/redacted overrides in the executable help.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 15, 2026, 11:43 PM ET / August 16, 2026, 03:43 UTC.

ClawSweeper review

What this changes

The PR makes codexbar serve dashboard snapshots follow the app’s Hide personal information setting when --identity is omitted, while retaining explicit full and redacted overrides.

Merge readiness

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

Keep open: this changes the shipped no-flag dashboard identity contract into one mutable by a GUI preference, so it needs an explicit product decision and proof before merge. Likely related people: steipete (medium confidence).

Priority: P2
Reviewed head: d55a1b7fc4c51ead1bdeeaba13fbc55f8f7a0228
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation has useful focused tests, but compatibility blockers, stale documentation, and missing real-server proof prevent merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR reports build, lint, and unit-test results but provides no after-fix live serve request/response transcript showing the preference toggle and explicit overrides. 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 🦐 gold shrimp (3/6) 4 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports build, lint, and unit-test results but provides no after-fix live serve request/response transcript showing the preference toggle and explicit overrides. 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 6 items Current shipped contract: Current main initializes the serve runtime with a full identity default and passes it unchanged to dashboard snapshots when no flag is supplied.
Proposed compatibility change: The PR records an omitted identity flag as nil, causing every snapshot request to resolve identity from the GUI privacy preference.
Privacy setting storage: The app writes Hide personal information to the shared defaults key that the PR reads per request.
Findings 4 actionable findings [P1] Preserve the stable no-flag identity contract
[P2] Update serve’s executable help
[P2] Correct Claude-swap snapshot documentation
Security None None.

How this fits together

The serve command produces authenticated dashboard snapshots for the built-in web UI. Identity selection controls whether account emails in those snapshots are full or redacted, and the selected mode participates in response caching.

flowchart LR
A[Serve command options] --> C[Identity mode decision]
B[App privacy preference] --> C
C --> D[Dashboard snapshot route]
D --> E[Response cache]
E --> F[Built-in web dashboard]
Loading

Decision needed

Question Recommendation
Should codexbar serve without --identity retain its shipped full-email contract, or intentionally become mutable based on the app’s Hide personal information setting? Retain the stable default: Keep omitted --identity as full and require an explicit mode for privacy-sensitive server output.

Why: The current docs, executable help, and runtime all establish a full default, while the proposed behavior can alter machine-facing output during an unrelated GUI action.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports build, lint, and unit-test results but provides no after-fix live serve request/response transcript showing the preference toggle and explicit overrides. 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.
  • Preserve the stable no-flag identity contract (P1) - When --identity is omitted, this now makes a previously full machine-facing response change whenever a user flips a GUI preference. Current main, executable help, and shipped docs establish full as the default; retain that behavior or add an explicitly approved opt-in mode before merging.
  • Update serve’s executable help (P2) - codexbar serve --help still says snapshot identity defaults to full emails, and the option help says full (default). Update both to describe the preference-following behavior and explicit overrides if that contract is approved.
  • Correct Claude-swap snapshot documentation (P2) - The Claude guide still says GET /dashboard/v1/snapshot has full identity by default or uses redaction only with an explicit flag. That is false for an omitted flag after this change, including nested account identities.
  • Correct multi-account identity documentation (P2) - The dashboard API guide still states that Claude-swap account labels and identities are full by default or redacted only with --identity redacted. Document the omitted-flag privacy-setting mode there as well.
  • Resolve merge risk (P1) - Existing unattended codexbar serve clients without --identity can start receiving redacted identifiers after an unrelated GUI preference change.
  • Resolve merge risk (P1) - The executable help and Claude multi-account documentation still describe the old full-default behavior.
  • Resolve merge risk (P1) - The PR has no after-fix live server request/response evidence; reported unit tests do not prove the defaults-domain and HTTP path together.
  • Complete next step (P2) - A maintainer must choose the public no-flag API contract; the contributor must then provide real server evidence before merge.

Findings

  • [P1] Preserve the stable no-flag identity contract — Sources/CodexBarCLI/CLIServeCommand.swift:712-714
  • [P2] Update serve’s executable help — Sources/CodexBarCLI/CLIHelp.swift:218-219
  • [P2] Correct Claude-swap snapshot documentation — docs/claude.md:152-154
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 7 files; 203 added, 65 removed The patch spans runtime behavior, cache keys, tests, release notes, and CLI/API documentation.
Runtime vs tests runtime +74 net (135 added, 61 removed); tests +61 Most production growth is the route refactor and defaults integration, so the final decision needs route-level validation.

Merge-risk options

Maintainer options:

  1. Keep no-flag output stable (recommended)
    Retain full identity when --identity is absent and require an explicit mode before server response shape can follow a GUI preference.
  2. Accept the dynamic output contract
    Explicitly approve the change only after all affected help and provider documentation, regression coverage, and live-server proof are supplied.
  3. Pause for API direction
    Pause this PR if maintainers do not want the menu preference to control a machine-facing HTTP response.

Technical review

Best possible solution:

Preserve the stable omitted-flag full-identity contract unless a maintainer explicitly approves application-setting control; then align every help and provider-specific document, add route-level coverage, and show a redacted live-server transcript.

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

Yes, source-reproducible: current main defaults serve snapshots to full identity, while the PR changes the omitted-flag path to resolve from the defaults-backed privacy setting per request.

Is this the best way to solve the issue?

No: the implementation is mechanically coherent, but changing a documented machine-facing default based on a GUI preference is not the safest solution without explicit owner approval or an opt-in mode.

Full review comments:

  • [P1] Preserve the stable no-flag identity contract — Sources/CodexBarCLI/CLIServeCommand.swift:712-714
    When --identity is omitted, this now makes a previously full machine-facing response change whenever a user flips a GUI preference. Current main, executable help, and shipped docs establish full as the default; retain that behavior or add an explicitly approved opt-in mode before merging.
    Confidence: 0.96
  • [P2] Update serve’s executable help — Sources/CodexBarCLI/CLIHelp.swift:218-219
    codexbar serve --help still says snapshot identity defaults to full emails, and the option help says full (default). Update both to describe the preference-following behavior and explicit overrides if that contract is approved.
    Confidence: 0.99
  • [P2] Correct Claude-swap snapshot documentation — docs/claude.md:152-154
    The Claude guide still says GET /dashboard/v1/snapshot has full identity by default or uses redaction only with an explicit flag. That is false for an omitted flag after this change, including nested account identities.
    Confidence: 0.98
  • [P2] Correct multi-account identity documentation — docs/dashboard-api.md:201-203
    The dashboard API guide still states that Claude-swap account labels and identities are full by default or redacted only with --identity redacted. Document the omitted-flag privacy-setting mode there as well.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded dashboard/API compatibility decision with limited but real impact on scripted clients.
  • merge-risk: 🚨 compatibility: An existing no-flag server invocation can change its identity payload after a GUI preference toggle.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports build, lint, and unit-test results but provides no after-fix live serve request/response transcript showing the preference toggle and explicit overrides. 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:

Likely related people:

  • steipete: Current-main blame attributes the serve help and app privacy-setting implementation to this release-history author. (role: current CLI identity-contract owner; confidence: medium; commits: 0e453c4a5b2a; files: Sources/CodexBarCLI/CLIHelp.swift, Sources/CodexBar/SettingsStore+Defaults.swift, Sources/CodexBarCLI/CLIServeCommand.swift)

Rank-up moves

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

  • Obtain maintainer direction on the omitted-flag contract.
  • Resolve the compatibility and documentation findings.
  • Attach a redacted live-server transcript showing both preference states and explicit full/redacted overrides, then update the PR body for re-review.

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 (2 earlier review cycles)
  • reviewed 2026-08-15T23:36:04.578Z sha 027aefa :: needs real behavior proof before merge. :: [P1] Confirm the omitted-flag compatibility change | [P2] Update CLI help for the new identity default | [P2] Correct Claude-swap identity documentation | [P2] Correct multi-account identity documentation
  • reviewed 2026-08-16T03:02:39.837Z sha f6f08c1 :: needs real behavior proof before merge. :: [P1] Preserve the documented no-flag identity contract | [P2] Update executable help for the changed identity behavior | [P2] Correct Claude-swap identity documentation | [P2] Correct multi-account identity documentation

@urda
urda force-pushed the urda/serve-hide-personal-info branch from 027aefa to f6f08c1 Compare August 16, 2026 02:58
The serve dashboard ignored the app's "Hide personal information"
toggle and always served full account emails unless --identity was
passed. Resolve the identity mode per request when the flag is
absent, so the toggle applies without a serve restart, and fold the
resolved mode into the response cache key so a body cached before a
toggle cannot be replayed after it. An explicit --identity still
wins. codexbar dashboard keeps its full default.
@steipete

Copy link
Copy Markdown
Owner

Thanks @urda! Your branch went CONFLICTING against main after today's merge train and the fork isn't maintainer-editable, so I carried this forward as #2967 with your commits and a changelog credit. Closing this one in favor of that refresh — the code is unchanged.

@steipete steipete closed this Aug 16, 2026
@urda
urda deleted the urda/serve-hide-personal-info branch August 16, 2026 04:38
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
* Port upstream 0.50.1: Cursor rename + Ollama cookie stripping (steipete#2951, steipete#2949)

* Port upstream 0.50.1: OpenCode Go session+weekly pace in CLI (steipete#2957)

* Port upstream 0.50.1: chart axis label centering (steipete#2974)

* Port upstream 0.50.1: Kiro re-authenticate via kiro-cli login (steipete#2340)

* Port upstream 0.50.1: serve identity follows app redaction per-request (steipete#2960)

* Port upstream 0.50.1: Codex routed pricing, auth.json read-only, known-zero history, Antigravity dashboard lanes, Claude OAuth revoked detection

steipete#2946 Codex routed models pricing — codex_routed_provider() + strip_route_prefix()
    in cost_pricing.rs; deepseek/, kimi/, opencode/ routes price against
    matching models.dev provider; unknown provider/ prefixes return None.
steipete#2944 Codex auth.json read-only during refresh — codex_external_oauth_sources_allowed
    setting (default OFF); is_external_oauth + last_refresh fields on
    CodexCredentials; enforce_external_oauth_gate (8-day staleness window).
steipete#2932 Codex known-zero history — known_zero field on CostSummary; set in both
    cache-debounce and full-scan paths (history_coverage_established &&
    sessions_count == 0); knownZero JSON field + CLI text update.
steipete#2963 Antigravity dashboard lanes — quota-bucket dedup in parse_user_status;
    models sharing the same (remaining_fraction, reset_time) collapse to one
    lane.
steipete#2516 Claude revoked vs missing OAuth — ProviderError::OAuthRevoked variant;
    revocation detection (401/403 with revoked/invalid_grant/token_revoked);
    15-min CLI result cache (LazyLock<Mutex<Option<CachedCliResult>>>);
    fetch_via_auto returns cached CLI result when OAuth revoked, and stale
    cache when all live sources fail.

* Port upstream 0.50.1: Mistral PAYG spend, cost-summary display style, per-provider accent color

Item 1 — Mistral PAYG current-month API spend (steipete#2821, steipete#2947):
- Add MonthlyPlan variant to MetricPreference enum
- Add currency_symbol field to CostSnapshot with with_currency_symbol builder
- Set currency_symbol from Mistral billing API response
- Add MonthlyPlan to bridge label/parse, tray selected_metric_percent (None = no bar)
- Show formatted cost amount in provider_status_label for MonthlyPlan
- Add format_cost_amount helper in bridge.rs
- Add Mistral monthly spend row in MenuCardDetails
- Add monthlyPlan option to MenuBarMetricSection for Mistral

Item 2 — Menu cost-summary display style per provider (steipete#2976):
- Add CostSummaryDisplayStyle enum (Compact/Detailed/Hidden) in types.rs
- Add cost_summary_display_style field to Settings + Default + RawSettings round-trip
- Add to SettingsSnapshot bridge + SettingsUpdate + apply in Tauri commands
- Add bridge label/parse functions
- Apply in MenuCardDetails: hidden hides cost section, compact shows used/limit only
- Update describeCard to filter hasCost for hidden style
- Add Select control in UsageSpendTab

Item 3 — Per-provider accent color override (steipete#2972):
- Add accent_color field to ProviderConfig
- Add brand_color(ProviderId) function in provider.rs (mirrors frontend registry)
- Add accent_color/set_accent_color/effective_accent_color accessors in Settings
- Add set/get/get_effective Tauri commands + normalize_hex_accent_color validator
- Add providerAccentColors map to SettingsSnapshot bridge
- Add setProviderAccentColor/getProviderAccentColor/getProviderEffectiveAccentColor to tauri.ts
- Create AccentColorSection component (hex input, color picker, reset button)
- Inject --provider-accent CSS variable on MenuCard article and ChartsSection
- Update menu-metric__bar-fill and chart colors to use --provider-accent fallback
- Update chartPalette providerCostColor/providerCreditsColor fallback chain
- Pass providerAccentColors through TrayPanel/PopOutPanel/ProvidersTab/ProviderDetailPane

Also:
- Add 11 new locale keys to all 7 .ftl files + keys.ts
- Add costSummaryDisplayStyle + providerAccentColors to all test mock SettingsSnapshot
- Update chartPalette tests for --provider-accent fallback

* Resolve merge conflicts and fix gate checks

* Thermo-nuclear: extract ollama cookies, codex pricing, simplify accent color

* fix: correct serde attribute placement on currency_symbol after rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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.

2 participants