revert: roll back Slice K3 — launchd-spawned daemon can't access keychain#91
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
K3's research probe was wrong. Reverting #90 to restore the working K1+K1.5+K2 OAuth path.
What broke
K3 deleted MC's OAuth refresher +
~/.mc/credentials.jsonworkaround on the assumption that the SDK's bundledclaudebinary could resolve auth from the keychain on its own. The probe ran from a terminal session — where the SDK subprocess inherits the terminal's "responsible parent" attribute and can read the keychain.The actual production daemon is launchd-spawned, which has a different responsible parent and cannot access the user's keychain. After K3 deployed, every agent run failed with:
…coming from the bundled
claudesubprocess itself. The original~/.mc/credentials.jsonworkaround was specifically designed for this constraint — terminal-spawnedmc auth bootstrapreads the keychain (where it works), writes to file 0600, daemon reads file (no keychain at runtime). The README I rewrote even called this out explicitly. I deleted the workaround anyway.What this PR does
git revert d8c666f— restores everything K3 deleted:packages/core/src/auth/(refresher, credential-store, all readers)packages/cli/src/commands/auth.ts(mc auth bootstrap)packages/daemon/src/bin/auth-alert.ts(K1.5 Discord DM)packages/daemon/src/claude-code-refresh.smoke.test.tsmc auth bootstrapreferencesK2's chat-lane fail-fast (
AuthRequiredError→CHAT_AUTH_REQUIRED_REPLY) and K1.5's Discord alerts come back automatically since they're tied to the refresher.Test plan
pnpm typecheckcleanpnpm buildcleanbiome check .cleanpnpm test1463/1463 (back to pre-K3 count)tasks/lessons.mdWhy I'm not trying a hybrid first
The hybrid options (long-lived
claude setup-tokentoken in launchd plistEnvironmentVariables, or a one-shot script that bridges keychain → env) all require the user to manually rotate every few weeks/months. The K1+K1.5 design was explicitly built to solve auto-rotation under launchd. Revert is the cleaner restore-of-known-good.If we want to revisit cabinet-style migration later, the redo would need a probe from inside a launchd-spawned mcd, not from a terminal — that's the lesson worth capturing.