Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(gui): launch the agent helper via LaunchServices for a stable TCC identity#207

Open
davidbudnick wants to merge 1 commit into
AprilNEA:master from
davidbudnick:fix/agent-tcc-identity
Open

fix(gui): launch the agent helper via LaunchServices for a stable TCC identity #207
davidbudnick wants to merge 1 commit into
AprilNEA:master from
davidbudnick:fix/agent-tcc-identity

Conversation

@davidbudnick

@davidbudnick davidbudnick commented Jun 11, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Context

  • fixes [Bug]: Granted Accessibility permission, but not recognized #192 — Accessibility toggle shows ON but the gate never clears
  • the GUI exec'd the agent binary directly, so TCC attributed the agent's accessibility check to the GUI, while launchd starts attribute it to the agent itself — the grant silently depended on who launched the agent
  • the packaged helper now launches via open (LaunchServices) so the agent is always its own responsible process
  • the gate now names the "OpenLogi Agent" entry and explains removing a stale one

Testing

  • cargo test -p openlogi-gui passes (locale key parity + new helper_bundle test), clippy clean
  • reproduced live with the packaged bundle layout: direct exec made the agent's responsible process the launching terminal and it reported granted off the terminal's grant, with no agent entry in TCC at all
  • launched via open the agent is its own responsible process, prompts under its own "OpenLogi Agent" name
  • end to end: granted that entry once, relaunched via open, agent logs accessibility granted and installs the hook

greptile-apps[bot] reacted with thumbs up emoji

greptile-apps Bot commented Jun 11, 2026
edited
Loading

Copy link
Copy Markdown

Greptile Summary

This PR fixes the TCC identity mismatch (#192) by routing the packaged agent helper through LaunchServices (open -g -n) instead of direct exec, ensuring the agent registers under its own "OpenLogi Agent" entry in the Accessibility list. It also adds a UI hint across all 20 locale files instructing users to enable that specific entry (and how to remove a stale one).

  • ipc_client.rs: Introduces launch_agent + helper_bundle to detect the packaged .app layout and dispatch to open -g -n <bundle> on macOS, falling back to disclaim::Command for dev/non-macOS builds.
  • app.rs + locale files: Adds a new muted-text instructional block in the Accessibility permission dialog, directing users to the "OpenLogi Agent" entry rather than the app itself.

Confidence Score: 4/5

Safe to merge with awareness that the -n flag can spawn a duplicate agent instance in launchd-managed deployments.

The core TCC fix is correct and well-tested for the happy path. The -n flag (already flagged in prior review) creates a real race window in launchd-managed deployments where two agent instances race to bind the same Unix socket.

crates/openlogi-gui/src/ipc_client.rs — the open -n flag and ancestors().nth(3) bundle detection logic both have noted fragility worth addressing before ship.

Important Files Changed

Filename Overview
crates/openlogi-gui/src/ipc_client.rs Core launch path rewritten: new launch_agent dispatches to open -g -n <bundle> on packaged macOS builds and disclaim::Command elsewhere; helper_bundle counts 3 ancestors to detect the .app bundle root. Two concerns already flagged in prior review: -n can fire a duplicate instance on top of a launchd-managed agent, and nth(3) is fragile against non-canonical exe paths.
crates/openlogi-gui/src/app.rs Adds a new muted text block below the accessibility description, surfacing the "enable OpenLogi Agent" instruction using the new locale key. Change is additive and low-risk.
crates/openlogi-gui/locales/en.yml Adds the new locale key for the "Enable OpenLogi Agent" instruction; key exactly matches the tr!() call in app.rs. All 20 locale files follow the same pattern.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
 A[spawn_agent called] --> B[agent_binary_path]
 B -->|None| C[warn: binary not found]
 B -->|Some path| D[launch_agent]
 D -->|macOS| E[helper_bundle path]
 E -->|Some bundle| F["open -g -n bundle\nLaunchServices launch\nAgent gets own TCC identity"]
 E -->|None dev binary| G["disclaim::Command\ndirect exec with TCC disclaimer"]
 D -->|non-macOS| G
 F --> H[Agent registers as\nOpenLogi Agent in TCC]
 G --> I[Agent inherits or\ndisclaims GUI TCC identity]
Loading

Reviews (3): Last reviewed commit: "fix(gui): launch agent helper via Launch..." | Re-trigger Greptile

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Granted Accessibility permission, but not recognized

1 participant

AltStyle によって変換されたページ (->オリジナル) /