Skip to content

feat(models): show the Muse permission notice once and finish sign-in with a chat action - #172610

Merged
obviyus merged 9 commits into
mainfrom
fix/muse-signin-finish-fast
Oct 15, 2026
Merged

obviyus merged 9 commits into
mainfrom
fix/muse-signin-finish-fast

Conversation

@obviyus

@obviyus obviyus commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #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 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.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:
before completion

After:
consent once
waiting with loader
completion
first chat

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 #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:

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 962375d5ee, 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 #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.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 #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.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: meta Extension: meta plugin: muse size: XL labels Oct 14, 2026
@obviyus

obviyus commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 14, 2026
@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Sign-in offers only Close, and subsequent Muse chats request native permissions again.
  • After: Accept permissions once, then start a new chat with Muse Spark 1.3 without changing the agent’s default model.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent implementation supported by real Muse behavior, inspected visual proof, focused regressions, and a verified no-migration path.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Inspected before/after screenshots and supplied real Gateway/Muse output cover consent, browser approval, progress, completion, and a session-only reply with the agent default retained; linked live traces cover unauthorized callers and revocation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Muse sign-in appears inactive, finishes without a useful next action, and leaves users accepting native permissions repeatedly.
Reason: The connected flow has clear user value, preserves defaults, and carries an owner decision through collaborator authorship and prior feature ownership.

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
Reviewed head: 34095abf2edda53d61d6aeceff7db5ea40dbd068

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Muse setup verification keeps the original intent (525a7cd: Verify authenticated Meta catalog access without running a tool-capable model turn, and repeat verification before commit.)
  • Provider completion changes intended behavior with a stated reason (ae1205d: Automatically close completed sign-in dialogs to avoid leaving users in pending input.)
  • Shared Solid wizard keeps the original intent (8127bab: Consolidate Models and setup rendering while retaining shared login ownership and stable controls.)
  • Credential-only provider access keeps the original intent (7725cb5: Enable native-runtime provider access without persisting a different primary model.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 525a7cd adds extensions/meta/muse-login.ts:111 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 525a7cd755d3; files: extensions/meta/muse-login.ts)

PR surface

Source +392, Tests +485, Docs +25. Total +902 across 36 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 21 488 96 +392
Tests 13 502 17 +485
Docs 2 28 3 +25
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 36 1018 116 +902

Review metrics

Metric Value Why it matters
Additive contract changes 2 optional SDK fields; 2 optional wizard fields; 0 new configuration keys The change extends existing contracts and reuses the consent setting already merged on main.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Improves provider sign-in progress, completion, and repeated permission friction without evidence of an urgent production outage.
  • merge-risk: 🚨 compatibility: Extends public provider-auth types and wizard responses; the optional additions are documented and the direction is approved by maintainer authorship.
  • merge-risk: 🚨 security-boundary: Sign-in now records permission consent used by later native turns; explicit consent, administrator admission, commit guards, and linked revocation proof support the accepted boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-14T22:57:15.071Z sha 8d99eb4 :: needs real behavior proof before merge. :: [P2] Propagate cancellation through catalog-host startup
  • reviewed 2026-10-15T00:30:59.480Z sha c07c0dd0a06c5954286fa6b25251fe47954c6647 :: blocked before merge. :: none
  • reviewed 2026-10-15T00:46:47.655Z sha 3f1e46fede55344db18ed4a49ce3aaddd008cc5d :: blocked before merge. :: none
  • reviewed 2026-10-15T01:07:21.065Z sha fbf64f574e04c72db0fc0caf06a9aec8ccfd32da :: blocked before merge. :: none

Reviewed October 14, 2026, 9:30 PM ET / October 15, 2026, 01:30 UTC (Revision 5).

@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 14, 2026
@obviyus
obviyus force-pushed the fix/muse-signin-finish-fast branch from 8d99eb4 to c07c0dd Compare October 15, 2026 00:26
@obviyus

obviyus commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: 34095abf2edda53d61d6aeceff7db5ea40dbd068

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 15, 2026
@obviyus
obviyus force-pushed the fix/muse-signin-finish-fast branch from c07c0dd to 3f1e46f Compare October 15, 2026 00:41
@obviyus

obviyus commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@obviyus

obviyus commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Oct 15, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 15, 2026
@obviyus
obviyus merged commit 527d11d into main Oct 15, 2026
151 of 152 checks passed
@obviyus
obviyus deleted the fix/muse-signin-finish-fast branch October 15, 2026 01:44
@obviyus

obviyus commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

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.

obviyus added a commit that referenced this pull request Oct 15, 2026
…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.

![setup consent](https://github.com/user-attachments/assets/7665c0f3-79e4-4be7-a31c-9e0eaf1aea39)
![connected](https://github.com/user-attachments/assets/1c4158d8-4a0e-4e2c-bd3f-eaeb19f04913)
![chat without prompt](https://github.com/user-attachments/assets/c5fd683f-80b3-4c18-a635-03cfcd6c8f04)

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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
… 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:
![before completion](https://github.com/user-attachments/assets/b88d608e-3e7c-4f94-820f-ff0882f143c0)

After:
![consent once](https://github.com/user-attachments/assets/3f238267-fc2f-411e-a7c2-1deaa2475fb5)
![waiting with loader](https://github.com/user-attachments/assets/dc637ee7-95f5-40f1-8a78-d1a21c990dcd)
![completion](https://github.com/user-attachments/assets/0173618e-7a1e-4bff-bc3f-f9fb6767f1eb)
![first chat](https://github.com/user-attachments/assets/7f67ce5d-c79a-4e47-8eb4-b912a2348260)

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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…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.

![setup consent](https://github.com/user-attachments/assets/7665c0f3-79e4-4be7-a31c-9e0eaf1aea39)
![connected](https://github.com/user-attachments/assets/1c4158d8-4a0e-4e2c-bd3f-eaeb19f04913)
![chat without prompt](https://github.com/user-attachments/assets/c5fd683f-80b3-4c18-a635-03cfcd6c8f04)

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation extensions: meta Extension: meta gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: muse proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant