Skip to content

fix(core): restore Console policy precedence over MDM - #59641

Closed
vimtor wants to merge 1 commit into
devfrom
console-precedence
Closed

vimtor wants to merge 1 commit into
devfrom
console-precedence

Conversation

@vimtor

@vimtor vimtor commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Restore policy authority to Console → macOS managed preferences → system → user/project.
  • Keep the current integration-document pipeline: load integration documents before the managed policy documents.
  • Cover conflicting allows/denies, managed-policy fallback, and disconnect; update the precedence documentation.

This changes policy precedence. Ordinary settings continue to use their existing merge order.

Verification

  • 112 tests pass across config, policy, and Console-provider suites.
  • Full bun run check passes with pinned Bun 1.4.4 (existing lint warnings).
  • Website typecheck and production build pass.
  • Automated cross-model review unavailable: required reviewer CLI is not installed.

Before / after proof

Ran the same Config service integration request against base 115113931c in a separate checkout and this branch, using temporary configuration directories and the real config loader and policy evaluator.

Managed system file: deny shell:rm*, allow shell:ls, deny shell:git*.
Console integration document: allow shell:rm*, deny shell:ls.
Then remove the integration document and evaluate again. These are policy evaluations; no shell commands are executed.

Before:

{
  "connected": {
    "shell:rm -rf": "deny",
    "shell:ls": "allow",
    "shell:git push": "deny"
  },
  "disconnected": {
    "shell:rm -rf": "deny"
  }
}

After:

{
  "connected": {
    "shell:rm -rf": "allow",
    "shell:ls": "deny",
    "shell:git push": "deny"
  },
  "disconnected": {
    "shell:rm -rf": "deny"
  }
}

Test locally

From this branch:

cd packages/core
bun run script/test.ts test/config/config.test.ts --test-name-pattern 'ranks integration policies'

Expected: 1 pass, 0 fail. The test uses temporary files and an injected Console document, so no MDM profile or Console account changes are needed.

Visual

Real TUI recordings with the same prompt and policy conflict on both branches. A temporary managed-system config denies shell:echo console-policy-wins; an injected Console integration document allows it. Both go through the production config loader, policy evaluator, permission hook, and shell tool. The demo uses the managed-system path shared with MDM policy ordering; it does not deploy an MDM profile or change workspace policies.

Before — base 115113931c: managed policy wins and blocks the command.

before.mp4

After — 10786f5624: Console wins and the command prints console-policy-wins.

after.mp4
Final-state screenshots

Before: the shell tool reports “Blocked by configuration policy”.

Before: managed policy blocks the shell command

After: the shell tool executes and shows its output.

After: Console policy allows the shell command

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks sound. I ran the PR's updated ranks integration policies… test against the base, where it fails: managed shell:rm* deny and shell:ls allow beat the Console document. With this branch it passes, and so does the disconnect fallback. The config tests (50 pass) and Console provider tests (47 pass) also pass. I couldn't run typecheck here because the sandbox has Bun 1.4.2, which lacks bun check.

Ordinary settings merge exactly as before, because managedPolicies holds only policy documents. Only policy authority changes, and it goes back to the order the docs described before #57703.

Public API: no code, schema, CLI or SDK changes. The only external change is the documented policies precedence: a connected Console now outranks macOS managed preferences and the system opencode.json, so an organization allow can lift an MDM or system deny. That's intended and documented in policies.mdx.

No blocking concerns.

@vimtor vimtor closed this Oct 27, 2026
@vimtor
vimtor deleted the console-precedence branch October 27, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant