-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(meta-muse): accept a pasted Muse Code key on Windows and Linux #3437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ebf0b41
fix(meta-muse): tell the truth about why import is unavailable
lidge-jun e169857
fix(meta-muse): stop pointing Windows users at a WSL2 import that als…
lidge-jun dfe23d4
feat(meta-muse): accept a pasted Muse Code key on Windows and Linux
lidge-jun 4581e3e
fix(meta-muse): correct the paste path's messaging, refresh label, an…
lidge-jun 77be8ae
fix(meta-muse): make the credential-leak guard fail when a case succeeds
lidge-jun 37a4c28
test(oauth): pin that a Muse Code key survives the manual-paste gate
lidge-jun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
96 changes: 96 additions & 0 deletions
96
devlog/_plan/260904_cross_platform_parity/010_wp1_muse_manual_key.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # 010 - wp1: meta-muse manual key entry off macOS | ||
|
|
||
| One PR. Base `dev`. Branch `codex/260904-muse-platform-refusals`. | ||
| Evidence: `002`. Revised after audit round 1 and implementation review rounds 1-3. | ||
|
|
||
| ## Scope change, and why | ||
|
|
||
| The first two drafts of this phase shipped REFUSALS: Windows and Linux would fail | ||
| with an accurate message instead of the old inaccurate one blaming the macOS | ||
| Keychain. Audit round 1 had already cut a Linux credential READER, because the | ||
| pointer interface declares no path or inline-key field and writing against | ||
| invented schema is what `meta-muse.ts` refuses to do everywhere else. | ||
|
|
||
| Then the repository owner pointed out the thing both drafts missed: **the Muse | ||
| Code API key is visible in Meta's own developer console.** A user on Windows is | ||
| not out of options, they are out of an IMPORT path. Refusing the whole platform | ||
| because our importer cannot read its store, while the vendor hands the same key | ||
| to the user in a browser, reports a limitation of the importer as a limitation of | ||
| the platform. | ||
|
|
||
| So this phase now ADDS a capability rather than only correcting prose. | ||
|
|
||
| ## The change | ||
|
|
||
| ### `src/oauth/meta-muse.ts` | ||
|
|
||
| **Manual entry off darwin.** `loginMetaMuse` calls `manualKeyCredential`, which | ||
| fires `ctrl.onAuth` so the GUI renders its paste field, then awaits | ||
| `ctrl.onManualCodeInput`. This is the shape `kiro.ts:405` already uses when no | ||
| local token exists; resolving the flow first is load-bearing, because otherwise | ||
| the await blocks and the dashboard never receives a response. | ||
|
|
||
| **Two reasons, not one.** Windows and Linux are unavailable for different | ||
| reasons, and the instructions say which: Meta ships no native Windows build, | ||
| while the Linux CLI exists and only its credential storage is unmeasured. | ||
| Implementation review round 3 caught the collapsed version telling a Linux user | ||
| something false about their own machine. | ||
|
|
||
| **One validator for both origins.** `validatedMetaMuseCredential` does the | ||
| `LLM|` grammar check and the live `GET` against the Model API for imported and | ||
| pasted keys alike. A pasted key that skipped either would be a weaker credential | ||
| wearing the same provider id, and the difference would surface only as a 401 | ||
| mid-session. | ||
|
|
||
| The macOS error strings are preserved VERBATIM. Extraction is a refactor, and a | ||
| refactor that quietly rewrites a user-facing error is a behavior change in | ||
| disguise (review round 3, blocker 3). | ||
|
|
||
| **A host with no paste surface still refuses**, naming `dev.meta.ai` and | ||
| `META_MODEL_API_KEY`. An empty paste refuses rather than storing a blank | ||
| credential. | ||
|
|
||
| **`refreshMetaMuseToken` preserves the origin.** `merged()` | ||
| (`src/oauth/index.ts:754`) keeps any source that is not `local-cli`, so returning | ||
| `local-cli` unconditionally would relabel a hand-pasted key as an imported one on | ||
| its first refresh. It now takes the existing credential and preserves `manual`. | ||
|
|
||
| ### `src/providers/registry.ts` and `docs-site` | ||
|
|
||
| The note, the decision record, and the providers guide all described the provider | ||
| as import-only and macOS-only. All three now describe macOS import plus | ||
| Windows/Linux paste, and the consent warning says "the key you import or paste". | ||
|
|
||
| ## What is deliberately NOT here | ||
|
|
||
| A Linux credential reader. `002` records that no Linux pointer has ever been | ||
| observed, and `050` records the four facts one would have to supply. Manual entry | ||
| makes that reader a convenience rather than a blocker, which is a better place | ||
| for it to sit. | ||
|
|
||
| A WSL2 bridge. Reaching into `\\wsl$\<distro>\...` needs distro enumeration and | ||
| a reachability probe, neither measured. | ||
|
|
||
| ## Tests - `tests/meta-muse-oauth.test.ts` | ||
|
|
||
| 1. Windows offers a paste field naming `dev.meta.ai`; the credential returns | ||
| `source: "manual"` with `access === refresh`. | ||
| 2. Linux offers the same field. | ||
| 3. A pasted key still faces the grammar check, and a 401 still fails the login. | ||
| 4. A host with no paste surface refuses with an actionable message. | ||
| 5. An empty paste refuses rather than storing a blank credential. | ||
| 6. The consent warning precedes every unsupported-platform path. | ||
| 7. Refresh preserves `manual` and still reports `local-cli` for an imported key. | ||
| 8. **No failure path echoes the credential**, across four cases: imported and | ||
| pasted, each with a rejected (401) and an unreachable (socket) upstream, | ||
| asserting absence from the error, the stack, `onProgress`, AND `onAuth`. The | ||
| old single-case version only ever exercised the macOS path, so its name | ||
| overclaimed once a second route existed (review round 3, blocker 4). | ||
|
|
||
| ## Acceptance | ||
|
|
||
| - `bun test tests/meta-muse-oauth.test.ts` green. | ||
| - `bun x tsc --noEmit` clean. | ||
| - macOS import path byte-identical in behavior, including error wording. | ||
| - No credential value reaches a log, an error, or a callback payload. | ||
| - CI green. |
103 changes: 0 additions & 103 deletions
103
devlog/_plan/260904_cross_platform_parity/010_wp1_muse_platform_refusals.md
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep the non-macOS documentation aligned with the refusal path.
The runtime prompts for a pasted key only when a paste surface exists. Otherwise it refuses with actionable guidance. Both changed descriptions present pasted-key login as universal on non-macOS hosts.
docs-site/src/content/docs/guides/providers.md#L466-L470: qualify “Elsewhere it asks you to paste the key” and document the no-paste fallback.src/providers/registry.ts#L1543-L1543: apply the same qualification to the provider note.📍 Affects 2 files
docs-site/src/content/docs/guides/providers.md#L466-L470(this comment)src/providers/registry.ts#L1543-L1543🤖 Prompt for AI Agents
Source: Path instructions