Skip to content

Fix Finder-launched auth environment - #1

Open
dr-baker wants to merge 1 commit into
zenbu-labs:mainfrom
dr-baker:fix/finder-auth-env
Open

dr-baker wants to merge 1 commit into
zenbu-labs:mainfrom
dr-baker:fix/finder-auth-env

Conversation

@dr-baker

@dr-baker dr-baker commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Hydrate the main-process environment from the user's login shell on macOS before publishing auth/model status.

When Zenbu is launched from Finder/Dock, macOS provides a reduced environment. In that state the model list appears, but selecting a model does not persist and sending messages fails silently. Launching the same app from Terminal works because it inherits the shell environment.

This uses the existing shell-env dependency and runs once during AuthService.evaluate() before the Pi auth storage/model registry publishes provider status.

Repro

  1. Start from a fresh Zenbu install, or clear any previously selected chat model.
  2. Configure auth in a way that works from the user's shell environment.
  3. Launch Zenbu from Finder/Dock.
  4. Open a chat.
  5. Try selecting a model from the model picker.
  6. Send a message.

Expected: the model selection persists and the message starts an agent turn.

Actual: the model list appears, but selecting a model does not stick, and sending a message clears/fails without an agent response.

Then launch the same app from Terminal:

/Applications/Zenbu.app/Contents/MacOS/Zenbu

The model picker and message sending work.

Testing

  • Typechecked the patched installed copy:

    cd ~/.zenbu/apps/zenbu-env-test
    ./node_modules/.bin/tsc --noEmit
  • Verified with a Finder-launched wrapper app pointed at an isolated patched source copy:

    • Model selection persists.
    • Sending a message starts the agent instead of failing silently.

- hydrate the main process env from the login shell before publishing auth/model status
- keep this best-effort so auth still initializes if shell env loading fails
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