Title: [feat] Consider using `muse serve` / `@muse-code/sdk` instead of extracting subscription credentials · Issue #12 · TheStreamCode/opencode-muse-auth · GitHub
Open Graph Title: [feat] Consider using `muse serve` / `@muse-code/sdk` instead of extracting subscription credentials · Issue #12 · TheStreamCode/opencode-muse-auth
X Title: [feat] Consider using `muse serve` / `@muse-code/sdk` instead of extracting subscription credentials · Issue #12 · TheStreamCode/opencode-muse-auth
Description: Summary The current authentication and inference flow in opencode-muse-auth appears to conflict with the Muse Code subscription terms. The plugin obtains a subscription-linked inference credential and uses it to make inference requests d...
Open Graph Description: Summary The current authentication and inference flow in opencode-muse-auth appears to conflict with the Muse Code subscription terms. The plugin obtains a subscription-linked inference credential ...
X Description: Summary The current authentication and inference flow in opencode-muse-auth appears to conflict with the Muse Code subscription terms. The plugin obtains a subscription-linked inference credential ...
Opengraph URL: https://github.com/TheStreamCode/opencode-muse-auth/issues/12
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[feat] Consider using `muse serve` / `@muse-code/sdk` instead of extracting subscription credentials","articleBody":"# Summary\n\nThe current authentication and inference flow in `opencode-muse-auth` appears to conflict with the Muse Code subscription terms. The plugin obtains a subscription-linked inference credential and uses it to make inference requests directly through OpenCode's `meta` provider, outside the Muse Code CLI's own agent execution path.\n\nCould we investigate replacing this approach with the official `muse serve` session interface, using [`@muse-code/sdk`](https://github.com/meta-models/muse-code-sdk)?\n\nThis would allow OpenCode to integrate with Muse Code while leaving subscription authentication and inference handling within the official CLI, rather than reusing its subscription credential in a different client.\n\nThe proposed approach is inspired by [Paseo's Muse Code integration](https://paseo.sh/docs/muse-code), which uses `muse serve` and the Muse Session Protocol (MSP).\n\n# Current implementation\n\nBased on the project's documentation and implementation, the current flow appears to be:\n\n1. The plugin completes Meta's device-code authentication flow.\n2. It obtains an account-bound inference key through the Meta Model API.\n3. It caches the key locally in `~/.config/opencode/muse-code-sub.json`.\n4. Its authentication loader injects the cached key into OpenCode's built-in `meta` provider.\n5. OpenCode then sends inference requests directly to Meta using that credential, outside the Muse Code CLI's own agent execution path.\n\nRelevant code is available in [`src/`](https://github.com/TheStreamCode/opencode-muse-auth/tree/main/src).\n\nThe concern is not whether the credential works technically or whether it is stored securely. The concern is whether a subscription-linked credential obtained through Muse Code authentication may be used by a different coding client to access the inference API directly.\n\n# Why this raises a subscription-terms concern\n\nMeta's official [Muse Code subscription documentation](https://dev.meta.ai/docs/muse-code/subscriptions) describes the subscription and its associated credentials.\n\nThe [Meta Model API Terms of Service, Section 3.2](https://dev.meta.ai/legal/terms-of-service#subscriptions-and-keys) restricts the subscription-linked key or credential to use with the coding harness under the applicable subscription and prohibits using it to access the services outside that harness or circumvent subscription limits or billing.\n\nThe current implementation appears inconsistent with that restriction because it extracts the subscription-linked credential and uses it directly from OpenCode's provider implementation.\n\nThis is a technical and contractual concern, not a legal determination. Meta may provide additional documentation or specific authorization for third-party integrations that changes this assessment. If such authorization exists, documenting it would help users understand the supported usage.\n\nIn the absence of that clarification, I think the current approach presents an avoidable compliance risk for users.\n\n# Proposed alternative: use `muse serve`\n\nMeta provides an official TypeScript SDK and session protocol for programmatically driving Muse Code:\n\n- Official SDK repository: `meta-models/muse-code-sdk` [https://github.com/meta-models/muse-code-sdk](https://github.com/meta-models/muse-code-sdk)\n- NPM package: `https://www.npmjs.com/package/@muse-code/sdk` [@muse-code/sdk](https://www.npmjs.com/package/@muse-code/sdk)\n- SDK quickstart: [https://github.com/meta-models/muse-code-sdk/blob/main/clients/sdk-quickstart/README.md](https://github.com/meta-models/muse-code-sdk/blob/main/clients/sdk-quickstart/README.md)\n\nThe SDK communicates with a `muse serve` process over the Muse Session Protocol (MSP). This provides a potential integration boundary in which the Muse Code CLI remains responsible for its own authentication and model interactions.\n\nA possible implementation would be:\n\n1. OpenCode launches or connects to a local `muse serve` process for the user's workspace.\n2. The plugin communicates with the process using `@muse-code/sdk` and MSP.\n3. OpenCode sessions and turns are mapped to the corresponding Muse sessions and turns.\n4. The Muse Code process handles inference using its own authenticated session.\n5. The plugin streams responses and events back into OpenCode and handles cancellation, session state and tool approvals according to the supported protocol.\n\nThis approach would avoid extracting, caching or injecting the subscription-linked inference key into OpenCode.\n\n**Important:** the availability of an official SDK and session protocol does not, by itself, establish that third-party clients are authorized to use a Muse Code subscription. The proposed integration should be checked against the current terms or explicitly confirmed with Meta before being presented as a compliant solution.\n\n# Reference implementation: Paseo\n\n[Paseo's Muse Code integration](https://paseo.sh/docs/muse-code) provides a useful technical reference for this architecture.\n\nPaseo's documentation describes launching `muse serve` and communicating with it over MSP. Its integration uses the official [`@muse-code/sdk`](https://github.com/meta-models/muse-code-sdk).\n\nRelevant references:\n\n- [Paseo Muse Code integration documentation](https://paseo.sh/docs/muse-code)\n- [Paseo source repository](https://github.com/getpaseo/paseo)\n- [Official Muse Code SDK](https://github.com/meta-models/muse-code-sdk)\n\nPaseo is not a drop-in replacement for this OpenCode plugin, but it demonstrates an alternative integration pattern worth investigating.\n\nI am citing Paseo as a technical reference, not as proof that its usage or any other third-party integration is contractually authorized. That question should still be confirmed against Meta's applicable terms or directly with Meta.\n\n# Questions\n\n1. Is the current credential-extraction and direct-inference approach explicitly authorized by Meta for use with a Muse Code subscription?\n2. If not, would you consider implementing the integration through `muse serve` and `@muse-code/sdk`, after confirming that this third-party client use is permitted?\n3. Are there any limitations in the current MSP protocol that would prevent OpenCode from supporting the required interactive coding-agent workflow?\n4. If this integration is not supported, could the README document the relevant limitation and direct users to an officially supported integration path?\n\n# Acceptance criteria\n\n- [ ] The authentication and inference flow is documented, including the applicable subscription authorization.\n- [ ] If the current approach is not explicitly authorized, the plugin no longer extracts or injects subscription-linked inference credentials into OpenCode.\n- [ ] An alternative based on the documented Muse Code session interface is investigated, subject to confirmation that the intended use is permitted.\n- [ ] Session lifecycle, streaming, cancellation and tool-approval behavior are tested or documented as limitations.\n- [ ] Users receive accurate information about the authentication path and the subscription terms relevant to it.\n\nThanks for maintaining this project. The goal is to preserve the useful OpenCode integration while reducing the risk that users rely on a technically functional but unsupported subscription-authentication path.","author":{"url":"https://github.com/pgarciaq","@type":"Person","name":"pgarciaq"},"datePublished":"2026-10-20T12:17:34Z","url":"https://github.com/TheStreamCode/opencode-muse-auth/issues/12"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:59a10f76-bfad-0b4d-9fa8-446d835d56c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF3A:3DAD59:762BF3:9923C7:6AFFCEEC |
| html-safe-nonce | ae02cebab10237e2c33c78d85dff43433e0036509d29933bc1037727ac40fd88 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjNBOjNEQUQ1OTo3NjJCRjM6OTkyM0M3OjZBRkZDRUVDIiwidmlzaXRvcl9pZCI6IjgyNzU5NDkzNTYwNTg2NjA1ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d4b31234a2e72252154d9efe129e574626982dca105f4a2a75c40adcc914335c |
| hovercard-subject-tag | issue:5941477405 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TheStreamCode/opencode-muse-auth/12/issue_layout |
| twitter:image | https://opengraph.githubassets.com/709757eaa64090a6ba3f7c599b9a5459e4a2ba6de64bb2f6f0d3177698813301/TheStreamCode/opencode-muse-auth/issues/12 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/709757eaa64090a6ba3f7c599b9a5459e4a2ba6de64bb2f6f0d3177698813301/TheStreamCode/opencode-muse-auth/issues/12 |
| og:image:alt | Summary The current authentication and inference flow in opencode-muse-auth appears to conflict with the Muse Code subscription terms. The plugin obtains a subscription-linked inference credential ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pgarciaq |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/TheStreamCode/opencode-muse-auth git https://github.com/TheStreamCode/opencode-muse-auth.git |
| octolytics-dimension-user_id | 163041857 |
| octolytics-dimension-user_login | TheStreamCode |
| octolytics-dimension-repository_id | 1373560427 |
| octolytics-dimension-repository_nwo | TheStreamCode/opencode-muse-auth |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1373560427 |
| octolytics-dimension-repository_network_root_nwo | TheStreamCode/opencode-muse-auth |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width