Skip to content

Fix packaged-app launch crash, quit teardown, and broaden GitHub repo picker - #74

Open
duncsdownunder wants to merge 7 commits into
CameronCrow:mainfrom
duncsdownunder:local-combined
Open

duncsdownunder wants to merge 7 commits into
CameronCrow:mainfrom
duncsdownunder:local-combined

Conversation

@duncsdownunder

Copy link
Copy Markdown

Summary

Three changes bundled from my local branch:

  • fix(main): register local-db host hooks before any DB-importing module — the packaged .app crashed on launch with a fatal migration error. server-core modules import ./local-db relatively, bypassing the lib/local-db shim that was supposed to guarantee host-hook registration order, so migrations ran with no hooks and resolved the dev-only migrations path (which doesn't exist inside the bundle). The hook registration import is now the first import of the main entry file.
  • fix(main): run quit teardown deterministically on every quit path
  • feat(github-picker): include org and collaborator repos in the repo list

Test plan

  • Packaged the app with bun run build, launched the binary from the terminal: migrations resolve to Contents/Resources/resources/migrations and complete; app boots to a working window.
  • Verified the installed /Applications/Papyrus.app copy launches cleanly.

🤖 Generated with Claude Code

duncsdownunder and others added 7 commits August 5, 2026 10:34
before-quit is async but only called preventDefault() on the confirm-dialog
path, so on a normal quit Electron could exit before disposeTray() ran.
quitWithoutConfirmation() used app.exit(0), which skips before-quit entirely.
Now preventDefault runs unconditionally, both paths funnel through the same
teardown + app.exit(0) (guarded by isQuitting), and quitWithoutConfirmation
routes through app.quit() so teardown runs there too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gh repo list only returns repos the authenticated user owns, so the New
Agent modal's "Pick from GitHub" mode hid organization repos entirely.
List via the REST /user/repos endpoint instead, with
affiliation=owner,collaborator,organization_member (paginated, sorted by
updated). Falls back to the old owner-only gh repo list when gh api
--slurp is unavailable (gh too old), and keeps the existing
degrade-to-unauthenticated behavior on total failure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The packaged app crashed on launch: server-core modules import ./local-db
relatively, bypassing the lib/local-db shim that guaranteed hook
registration order. main/index.ts imported agent-memory-backfill before
the shim, so migrations ran with no hooks and resolved the dev-only
migrations path, which doesn't exist inside the .app bundle. Hoist the
register-host-hooks import to the top of the entry file so it always
evaluates first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DialogContent's auto grid column sized to its content, so long nowrap
text (e.g. repo descriptions in the New Agent GitHub picker) blew the
column past max-w and every w-full field stretched across the window.
Pin the column with grid-cols-[minmax(0,1fr)] so truncation works, and
cap NewAgentModal at 90vh with scroll so it fits short windows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the placeholder icon with the papyrus-scroll artwork, remapped
onto Apple's icon grid (824px tile, 185px radius, transparent 1024
canvas) and exported as icns/png/ico. Canary icons unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rktree

Agents own a standalone clone at <agent-home>/worktree, but the delete
flow still treated them as `git worktree`s of the Category's
mainRepoPath — canDelete ran `git worktree list` in a non-repo ("fatal:
not a git repository", Delete disabled) and delete would have failed the
same way, leaving files behind.

canDelete now checks the agent clone directly (uncommitted/unpushed
warnings work), delete removes the whole agent home (worktree + memory
+ .codex) via rename-then-background-rm, and the dialog states agent
delete semantics and hides the local-branch checkbox for agents.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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