Commit 46f8444
daemon+menubar: bundle claude binary, auth via keychain OAuth (drop system-claude resolution)
Switch from resolving the user's system claude to spawning the SDK's own
bundled per-platform binary (Desktop-style), validated end-to-end by spike
(env-token auth + re-signed SEA runs + notarized, dmg 178MB):
- run-query: omit pathToClaudeCodeExecutable (SDK require.resolve's its
platform package); inject CLAUDE_CODE_OAUTH_TOKEN + remote_mobile
entrypoint via spawn env. Token is one-shot per spawn — the binary treats
env tokens as inference-only and never self-refreshes; a loop alive past
token expiry 401s until respawn (known limitation, self-heal signposted).
- router: sendPrompt mints a fresh token (OAuthRefreshManager.ensureFresh —
the CCR bridge's keeper, shared) before ensureSessionLoop; missing/expired
login surfaces as turn_failed with actionable "claude /login" copy.
- index: drop claude-binary resolution + claudeStatus/recheckClaudeBinary
daemon API; thread ensureFreshToken into router deps + bridge inbound.
- menubar: drop the claude engine-health menu row and the shell-env
inheritance (PATH probing is moot — we ship the binary).
- electron-builder: bundle @anthropic-ai/claude-agent-sdk-* (asarUnpack;
executables can't spawn from asar).
- protocol: minClaudeVersion is now informational (bundled binary version
is pinned by the app release).
Prerequisite: a Claude Code login on the Mac (keychain credentials written
by `claude /login` or Claude Desktop) — sidecode reads and refreshes that
entry (rotation-safe writeback) but never initiates a login itself.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent dc59413 commit 46f8444
8 files changed
Lines changed: 128 additions & 300 deletions
File tree
- packages
- daemon/src
- runtime
- protocol/src
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 13 | | |
20 | 14 | | |
21 | 15 | | |
| |||
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 47 | | |
66 | 48 | | |
67 | 49 | | |
| |||
101 | 83 | | |
102 | 84 | | |
103 | 85 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
118 | 94 | | |
119 | 95 | | |
120 | 96 | | |
| |||
191 | 167 | | |
192 | 168 | | |
193 | 169 | | |
194 | | - | |
| 170 | + | |
195 | 171 | | |
196 | 172 | | |
197 | 173 | | |
| |||
210 | 186 | | |
211 | 187 | | |
212 | 188 | | |
213 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
214 | 194 | | |
215 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
216 | 200 | | |
217 | 201 | | |
218 | 202 | | |
| |||
342 | 326 | | |
343 | 327 | | |
344 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
345 | 332 | | |
346 | 333 | | |
347 | 334 | | |
| |||
417 | 404 | | |
418 | 405 | | |
419 | 406 | | |
420 | | - | |
421 | | - | |
422 | 407 | | |
423 | 408 | | |
424 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
108 | 119 | | |
109 | 120 | | |
110 | 121 | | |
| |||
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
179 | 207 | | |
180 | 208 | | |
181 | 209 | | |
| |||
723 | 751 | | |
724 | 752 | | |
725 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
726 | 775 | | |
727 | 776 | | |
728 | 777 | | |
| |||
735 | 784 | | |
736 | 785 | | |
737 | 786 | | |
| 787 | + | |
738 | 788 | | |
739 | 789 | | |
740 | 790 | | |
| |||
0 commit comments