You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Respect hide personal info in CLI hook payloads - #911
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.
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.
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.
Hook payloads omit the account email when Hide personal information is enabled. No issue identified here needs resolution before merge.
Pre-merge checks: 8
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title is a short imperative summary that accurately describes omitting personal information from CLI hook payloads.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Provider Data Stays Siloed
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
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
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codexbar hooks watchput 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.hook_account_display_nameinrust/src/cli/hooks.rsreturnsNonewhenhide_personal_infois set, and otherwise the trimmed, non-emptyaccount_email.hooks_watch_observationuses the helper instead of copyingaccount_emaildirectly.Found while answering a CodeRabbit thread on #838 (docs for hook privacy).
Tests
hide_personal_info_omits_the_hook_account: with the setting off, the helper and every lane carry the email; with it on, both areNone.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.Summary by CodeRabbit