Skip to content

Respect hide personal info in CLI hook payloads - #911

Merged
Finesssee merged 2 commits into
mainfrom
fix/cli-hooks-hide-personal-info
Oct 18, 2026
Merged

Finesssee merged 2 commits into
mainfrom
fix/cli-hooks-hide-personal-info

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

codexbar hooks watch put the provider's account email into hook payloads even when Hide personal information was on. The desktop hook dispatchers already leave the account out in that case, so the CLI leaked what the app hides.

  • New helper hook_account_display_name in rust/src/cli/hooks.rs returns None when hide_personal_info is set, and otherwise the trimmed, non-empty account_email.
  • hooks_watch_observation uses the helper instead of copying account_email directly.
  • Account discriminators (used only to tell lanes apart) are unchanged and are never written to the payload.

Found while answering a CodeRabbit thread on #838 (docs for hook privacy).

Tests

  • New test hide_personal_info_omits_the_hook_account: with the setting off, the helper and every lane carry the email; with it on, both are None.
  • cargo test --manifest-path rust/Cargo.toml hooks: 7 hook tests pass.
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: clean.
  • cargo fmt --all: no changes.
  • No UI change, so no CUA proof needed.

Summary by CodeRabbit

  • Bug Fixes
    • Hook quota lanes now show the account email as the display name when personal information is visible, with surrounding whitespace removed. If personal information is hidden, the account name is omitted. This keeps the displayed account information consistent with the privacy setting and avoids showing blank or untrimmed email addresses.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: nesszer/Win-CodexBar/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 351b0090-d652-49af-9da0-412c9e8c2230
📥 Commits

Reviewing files that changed from the base of the PR and between 09bdf08 and c13c39f.

📒 Files selected for processing: 1
  • rust/src/cli/hooks.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Hook watch observations now use a helper to select account display names. The helper omits names when personal information is hidden and returns a trimmed, nonempty email otherwise. A test checks both cases.

Changes: Hook account display names

Layer / File(s) Summary
Display name selection and hook integration
rust/src/cli/hooks.rs
Hook observations use hook_account_display_name. The helper omits the name when personal information is hidden or the trimmed email is empty. A test checks visible and hidden cases.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to c13c3

Hook payloads omit the account email when Hide personal information is enabled. No issue identified here needs resolution before merge.

Pre-merge checks: Passed 8
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is a short imperative summary that accurately describes omitting personal information from CLI hook payloads.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Provider Data Stays Siloed Passed PASS. The change only replaces the CLI hook display account with hook_account_display_name. It derives the value from the same provider fetch result, returns None when hide_personal_info is enab…
Secrets Handled Safely Passed PASS. The pull request changes only account display handling. It reads usage.account_email, trims it, or omits it when hide_personal_info is enabled. It does not add token, cookie, API key, OAuth …
No Unapproved Dependencies Passed The pull request changes only rust/src/cli/hooks.rs. The authoritative diff contains no changes to Cargo.toml, package.json, npm/yarn lockfiles, or pnpm package manager settings. No dependency a…
Ui Changes Include Windows Proof Passed PASS: The pull request changes only rust/src/cli/hooks.rs. The diff updates CLI hook payload account fields and adds a unit test. It does not modify desktop UI, tray rendering, the float bar, settin…
Full details: Provider Data Stays Siloed

Explanation

PASS. The change only replaces the CLI hook display account with hook_account_display_name. It derives the value from the same provider fetch result, returns None when hide_personal_info is enabled, and trims empty email values. Hook events retain the observation provider, while the private account discriminator remains separate and is not serialized. No specific-ProviderId branching was added.

Full details: Secrets Handled Safely

Explanation

PASS. The pull request changes only account display handling. It reads usage.account_email, trims it, or omits it when hide_personal_info is enabled. It does not add token, cookie, API key, OAuth credential, or authorization-header handling to logging, errors, snapshots, or plain-text files. The existing ApiKeys::load() input and account discriminator path are unchanged, and the added test uses a non-secret example email.

Full details: No Unapproved Dependencies

Explanation

The pull request changes only rust/src/cli/hooks.rs. The authoritative diff contains no changes to Cargo.toml, package.json, npm/yarn lockfiles, or pnpm package manager settings. No dependency addition requires maintainer approval.

Full details: Ui Changes Include Windows Proof

Explanation

PASS: The pull request changes only rust/src/cli/hooks.rs. The diff updates CLI hook payload account fields and adds a unit test. It does not modify desktop UI, tray rendering, the float bar, settings, or window chrome. No Windows proof is required.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee
Finesssee merged commit 82a30b6 into main Oct 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant