Repository navigation
feat(models): show the Muse permission notice once and finish sign-in with a chat action - #172610
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR remembers Muse permissions during sign-in, shows real progress, reuses verification hosts, and offers a session-scoped new-chat action. Example: Connect Muse Code while the agent defaults to another provider.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides useful sign-in improvements absent from current main, and no blocking defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe provider plugin handles browser sign-in, Gateway setup verifies and commits agent-scoped configuration, and the shared Control UI wizard presents progress and creates an optional chat session. flowchart LR
A[Models dialog] --> B[Gateway sign-in wizard]
B --> C[Meta provider login]
C --> D[Muse browser approval]
B --> E[Muse catalog verification]
E --> F[Agent configuration commit]
F --> G[Completion dialog]
G --> H[New chat session]
Technical reviewBest possible solution: Land the shared sign-in improvement through the normal required-check gates while preserving agent defaults and the existing live-authority owners. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the missing setup-consent integration, per-read verification process, and previous completion behavior; supplied real Gateway evidence demonstrates the changed flow. Is this the best way to solve the issue? The implementation uses the existing provider, configuration, catalog, and session owners, preserves default-model selection, and removes the replaced verification path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c55e12351818. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +392, Tests +485, Docs +25. Total +902 across 36 files. Added test files: 3. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 14, 2026, 9:30 PM ET / October 15, 2026, 01:30 UTC (Revision 5). |
8d99eb4 to
c07c0dd
Compare
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
c07c0dd to
3f1e46f
Compare
|
@clawsweeper review |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Landed in 527d11d. Muse Code sign-in now explains native permissions once, shows a loader and the real setup phase while waiting, reuses the verified Muse host, and finishes with "Start a new chat with Muse Spark 1.3" (session-only model). Proof: live sign-in to a chat reply with no permission prompt, upgrade cell, green CI. |
…72773) ## Problem Each host-native runtime handled the "native permissions" consent its own way. Muse Code had a provider-specific prompt inside `extensions/meta/muse-login.ts` plus SDK fields (`ProviderAuthResult.nativeRuntimeConsent`, `ProviderAuthContext.agentId`) to send consent back to core. Every other native runtime would need the same copy, or the user is asked in chat instead of at setup. ## Solution - New core owner `src/agents/harness/setup-consent.ts`. Provider setup activation (Provider Access and AI Setup, including access-only `selectModel:false`) calls it once the auth result has identified the runtime, before verification and activation. - Eligibility comes from the selected harness's capability (`executionEnvironment === "host-only"`), not from provider names. Codex and direct Copilot declare exact tool-policy enforcement and are not prompted. - If the target agent has not already remembered the harness, setup shows one step: "Use <runtime>'s native permissions?". It uses the same boundary text as the chat prompt and says the choice is remembered for this agent. Cancelling activates nothing and remembers nothing. - Continue stages `rememberNativeRuntimeConsent` in the same setup commit, through the existing activation writer. Pre-commit authority revalidation and the shared harness/registry cache are unchanged. - Clean cutover: Muse's own prompt, `ProviderAuthResult.nativeRuntimeConsent` and `ProviderAuthContext.agentId` are deleted. These were added in #172610 and never released. - The chat prompt stays as the fallback for runtimes that never went through setup (for example config-edited routes). Mandatory sandbox and workspace restrictions are still enforced. Follow-ups, already implemented on a separate branch: enabling an installed ACP agent (OpenCode, Qwen Code, Pi, Kilo Code, ACP Copilot) through one core setup operation, and the CLI/onboarding paths. ## Evidence Live run on an isolated Gateway (real `muse` 1.3.0, real Meta approval, `tools.deny=["browser"]` so consent is required): 1. Provider Access → Meta → Muse Code: one setup warning ("Use Muse Code's native permissions?") → Continue → "Muse Code is connected". 2. "Start a new chat with Muse Spark 1.3" → reply `NRC_FINAL_OK` with no chat prompt. The primary model is unchanged. The session has `full` / sandbox `off` and no per-chat consent, so the remembered agent consent was used.    Tests: `setup-consent.test.ts` (host-only prompts once; already remembered skips; non-host-only skips; cancel persists nothing; authority recheck after the answer), activation and credential-lifecycle suites (consent committed with activation; `selectModel:false` keeps the model; failed verification persists no consent), and the Meta login suite without the provider-specific prompt. ### Authority proof for the post-login consent step Live, same isolated Gateway (real Muse login; Muse binary wrapped to record each invocation): ```text Real Muse login succeeded; post-login native-permissions consent appeared. 03:38:16.171Z wizard.next => running, native-permissions select step. 03:38:24.177Z Browser operator device token revoked while consent waited. 03:38:24.488Z WebSocket closed: 4001 "device removed"; consent dialog dismissed, Continue unavailable. Replay of the recorded Continue answer: INVALID_REQUEST / WIZARD_NOT_FOUND / "wizard not found" Final config byte-identical (SHA256 03e07d5c…2240): nativeRuntimeConsent absent; plugins.entries.muse absent; agentRuntime absent Muse invocation recorder: "login" invocations only; zero "serve" (no verification process or model/list). ``` Tests: "rejects consent when authority is revoked while the prompt is open"; and "sets up the Muse route for main (… authority)", which checks rejection after Continue, unchanged config and no verification call. ## Update behavior No migration. The removed SDK fields shipped in no release. Agents already listed in `nativeRuntimeConsent` are not asked again. Co-authored-by: Ayaan Zaidi <[email protected]>
… with a chat action (openclaw#172610) Builds on openclaw#172607 (merged). ## Problem Muse Code sign-in from Models had several problems: - The waiting step had no loader, so it looked stuck. - The dialog stayed open for many seconds after the browser approval. - It ended with "Account connected. Choose a model when you want to test a reply." and only a Close button. - Every new chat then asked about native permissions. ## Solution - **Ask once, at setup.** Before the device code, Muse Code shows the native-permissions explanation (Continue / Cancel). Continue records `muse` in the agent's `nativeRuntimeConsent` (via openclaw#172607's helper), in the same setup commit that enables the runtime and routes the model. Later chats do not ask again. Two optional fields on existing SDK types carry this: `ProviderAuthContext.agentId` and `ProviderAuthResult.nativeRuntimeConsent`. - **Visible progress.** The existing spinner sits next to "Waiting for approval in your browser…". Once the CLI reports success, the server's own wizard progress label ("Testing your AI connection…") is shown under the same code, using an optional `progressLabel` on the wizard step. No timed or simulated steps. - **Faster finish.** Setup verification reuses the credential-bound, read-only Muse host for the pre-commit `model/list`, so there is no second Muse process. The finish action no longer waits for config reconciliation and a full catalog refresh; it uses the verified starter model from the completion receipt. - **Useful completion.** A centered success state: "Muse Code is connected", "Muse Spark 1.3 is ready for your agent.", primary **Start a new chat with Muse Spark 1.3**, secondary Close. The model comes from the hosted recommendation ranking when available, otherwise the provider's verified starter model. The new chat is created with that model for the session only; the agent's default model does not change. This applies to any provider login that has an available model. - The dialog keeps a stable size between states, focuses the primary action, and respects reduced motion. ## Evidence Live run on a fresh isolated Gateway built from the integrated branch (default `openai/gpt-5.6-luna`, real `muse` 1.3.0, real Meta approval): | Step | Time | |---|---| | Approval → "Testing your AI connection…" | about 2 s after `muse login` exits | | Approval → completion with **Start a new chat with Muse Spark 1.3** | about 6 s (before: about 28 s on the reporter's Gateway, about 17 s isolated) | | Start chat → first reply | 6.5 s, no permissions prompt; default model unchanged | | Second new chat with Muse Spark 1.3 | reply, no prompt | About 12 s of the approval-to-finish time is spent inside the opaque `muse login` CLI, which polls Meta; it exposes no polling option. Before:  After:     Tests: Meta login (consent prompt before spawn, cancel with no effects, one approval), Muse harness verification host reuse, setup credential lifecycle (consent written in the same commit), Models login completion (starter offered before catalog refresh, hosted ranking first, session-only model), and the wizard view/progress label suites. ### Review follow-up (`c07c0dd0a06`, rebased on openclaw#172607 `79e67a17ffa`) - **Cancellation during catalog-host startup** (`0ed298e21fa`). The setup signal now reaches pool acquisition. A cancelled startup closes the initializing Muse host instead of leaving it in the idle pool. Regression: "closes a catalog host cancelled during initialization" uses a real fake-Muse child held at `initialize`. Before the fix the child was still alive; after, it is gone before verification returns. - Fixed existing sign-in test type errors. Live, final head, real Muse 1.3.0: ```text Models → Provider Access → Meta → Muse Code Consent shown once: "Muse Code runs on the Gateway host under its own permissions." → Continue Device code with spinner: Waiting for approval in your browser… Meta approval: APPROVED 00:23:57.499Z Testing your AI connection… 00:23:59.678Z Muse Code is connected / Muse Spark 1.3 is ready for your agent. Start a new chat with Muse Spark 1.3 → session model=meta/muse-spark-1.3 permissionMode=full sandboxMode=off User: Reply with exactly S610_SIGNIN_OK. Do not use tools. Assistant: S610_SIGNIN_OK status=done hasActiveRun=false; no permission prompt; agent default stayed openai/gpt-5.6-luna ``` Upgrade cell: state written by the previous main build `6a32c179c0`, with Muse routing, plugin and credential. After main's own agent-database migration (v26→v27 via `doctor --fix`, not part of this PR), the default model, Muse routing, Muse plugin config and credential bytes were unchanged, and the Muse catalog was available. The consent entry stayed absent until a new sign-in added `["muse"]`. Non-admin, other-agent and revocation proofs: see openclaw#172607. ### Rebase onto main (`34095abf2ed`) Replayed onto main after openclaw#172607 and openclaw#172608 landed. Kept openclaw#172608's refresh by credential owner and its deferred reconcile. The UI no longer imports the Meta extension manifest: `modelActivation.modelName` now comes from the Gateway's captured provider catalog. Test assertions are updated for the new waiting copy ("Waiting for approval in your browser…") and the explicit success-dialog dismissal. **Upgrade / stored data:** no schema or stored-row change. The consent entry is written only by a new sign-in through openclaw#172607's config helper. The upgrade cell above shows a previous-main state loading with its default model, Muse routing, plugin config and credential bytes unchanged. ## Update behavior No migration. The new SDK and wizard fields are optional. Existing Muse users keep their routing; the consent is written only by a new sign-in. Co-authored-by: Ayaan Zaidi <[email protected]>
…enclaw#172773) ## Problem Each host-native runtime handled the "native permissions" consent its own way. Muse Code had a provider-specific prompt inside `extensions/meta/muse-login.ts` plus SDK fields (`ProviderAuthResult.nativeRuntimeConsent`, `ProviderAuthContext.agentId`) to send consent back to core. Every other native runtime would need the same copy, or the user is asked in chat instead of at setup. ## Solution - New core owner `src/agents/harness/setup-consent.ts`. Provider setup activation (Provider Access and AI Setup, including access-only `selectModel:false`) calls it once the auth result has identified the runtime, before verification and activation. - Eligibility comes from the selected harness's capability (`executionEnvironment === "host-only"`), not from provider names. Codex and direct Copilot declare exact tool-policy enforcement and are not prompted. - If the target agent has not already remembered the harness, setup shows one step: "Use <runtime>'s native permissions?". It uses the same boundary text as the chat prompt and says the choice is remembered for this agent. Cancelling activates nothing and remembers nothing. - Continue stages `rememberNativeRuntimeConsent` in the same setup commit, through the existing activation writer. Pre-commit authority revalidation and the shared harness/registry cache are unchanged. - Clean cutover: Muse's own prompt, `ProviderAuthResult.nativeRuntimeConsent` and `ProviderAuthContext.agentId` are deleted. These were added in openclaw#172610 and never released. - The chat prompt stays as the fallback for runtimes that never went through setup (for example config-edited routes). Mandatory sandbox and workspace restrictions are still enforced. Follow-ups, already implemented on a separate branch: enabling an installed ACP agent (OpenCode, Qwen Code, Pi, Kilo Code, ACP Copilot) through one core setup operation, and the CLI/onboarding paths. ## Evidence Live run on an isolated Gateway (real `muse` 1.3.0, real Meta approval, `tools.deny=["browser"]` so consent is required): 1. Provider Access → Meta → Muse Code: one setup warning ("Use Muse Code's native permissions?") → Continue → "Muse Code is connected". 2. "Start a new chat with Muse Spark 1.3" → reply `NRC_FINAL_OK` with no chat prompt. The primary model is unchanged. The session has `full` / sandbox `off` and no per-chat consent, so the remembered agent consent was used.    Tests: `setup-consent.test.ts` (host-only prompts once; already remembered skips; non-host-only skips; cancel persists nothing; authority recheck after the answer), activation and credential-lifecycle suites (consent committed with activation; `selectModel:false` keeps the model; failed verification persists no consent), and the Meta login suite without the provider-specific prompt. ### Authority proof for the post-login consent step Live, same isolated Gateway (real Muse login; Muse binary wrapped to record each invocation): ```text Real Muse login succeeded; post-login native-permissions consent appeared. 03:38:16.171Z wizard.next => running, native-permissions select step. 03:38:24.177Z Browser operator device token revoked while consent waited. 03:38:24.488Z WebSocket closed: 4001 "device removed"; consent dialog dismissed, Continue unavailable. Replay of the recorded Continue answer: INVALID_REQUEST / WIZARD_NOT_FOUND / "wizard not found" Final config byte-identical (SHA256 03e07d5c…2240): nativeRuntimeConsent absent; plugins.entries.muse absent; agentRuntime absent Muse invocation recorder: "login" invocations only; zero "serve" (no verification process or model/list). ``` Tests: "rejects consent when authority is revoked while the prompt is open"; and "sets up the Muse route for main (… authority)", which checks rejection after Continue, unchanged config and no verification call. ## Update behavior No migration. The removed SDK fields shipped in no release. Agents already listed in `nativeRuntimeConsent` are not asked again. Co-authored-by: Ayaan Zaidi <[email protected]>
Builds on #172607 (merged).
Problem
Muse Code sign-in from Models had several problems:
Solution
musein the agent'snativeRuntimeConsent(via feat(agents): remember native runtime consent per agent #172607's helper), in the same setup commit that enables the runtime and routes the model. Later chats do not ask again. Two optional fields on existing SDK types carry this:ProviderAuthContext.agentIdandProviderAuthResult.nativeRuntimeConsent.progressLabelon the wizard step. No timed or simulated steps.model/list, so there is no second Muse process. The finish action no longer waits for config reconciliation and a full catalog refresh; it uses the verified starter model from the completion receipt.Evidence
Live run on a fresh isolated Gateway built from the integrated branch (default
openai/gpt-5.6-luna, realmuse1.3.0, real Meta approval):muse loginexitsAbout 12 s of the approval-to-finish time is spent inside the opaque
muse loginCLI, which polls Meta; it exposes no polling option.Before:

After:




Tests: Meta login (consent prompt before spawn, cancel with no effects, one approval), Muse harness verification host reuse, setup credential lifecycle (consent written in the same commit), Models login completion (starter offered before catalog refresh, hosted ranking first, session-only model), and the wizard view/progress label suites.
Review follow-up (
c07c0dd0a06, rebased on #17260779e67a17ffa)0ed298e21fa). The setup signal now reaches pool acquisition. A cancelled startup closes the initializing Muse host instead of leaving it in the idle pool. Regression: "closes a catalog host cancelled during initialization" uses a real fake-Muse child held atinitialize. Before the fix the child was still alive; after, it is gone before verification returns.Live, final head, real Muse 1.3.0:
Upgrade cell: state written by the previous main build
962375d5ee, with Muse routing, plugin and credential. After main's own agent-database migration (v26→v27 viadoctor --fix, not part of this PR), the default model, Muse routing, Muse plugin config and credential bytes were unchanged, and the Muse catalog was available. The consent entry stayed absent until a new sign-in added["muse"].Non-admin, other-agent and revocation proofs: see #172607.
Rebase onto main (
34095abf2ed)Replayed onto main after #172607 and #172608 landed. Kept #172608's refresh by credential owner and its deferred reconcile. The UI no longer imports the Meta extension manifest:
modelActivation.modelNamenow comes from the Gateway's captured provider catalog. Test assertions are updated for the new waiting copy ("Waiting for approval in your browser…") and the explicit success-dialog dismissal.Upgrade / stored data: no schema or stored-row change. The consent entry is written only by a new sign-in through #172607's config helper. The upgrade cell above shows a previous-main state loading with its default model, Muse routing, plugin config and credential bytes unchanged.
Update behavior
No migration. The new SDK and wizard fields are optional. Existing Muse users keep their routing; the consent is written only by a new sign-in.