# \[Bug\]: Agents are denied preview when another project has an agent browser access override · Issue \#23085 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/issues/23085)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: backlog

Priority: 0

## Description

[Discussion and activity](https://git.cafe/pingdotgg/t3code/issues/23085)

---

> [!NOTE]
> Filed by Claude Code (Haiku 5.5) at the request of the reporter. The reproduction and root cause were checked with unit tests on `main`.

### Before submitting

- [x] I searched existing issues and did not find a duplicate. The closest is #17202, which quotes the same denial message but reports the opposite symptom (tools visible while access is off).
- [x] I included enough detail to reproduce or investigate the problem.

### Area

apps/server

### Steps to reproduce

1. Keep "Agent browser access" on globally (the default).
2. In Settings, turn "Agent browser access" on for one project, so that project has a per-project browser override. Leave a second project with no browser override.
3. Start a Claude Agent thread in the second project.
4. Ask the agent to call `preview_status` or `preview_open`.

### Expected behavior

The second project has no override, so it inherits the global setting (on). The preview tools work.

### Actual behavior

Every preview call fails at once:

```text
MCP credential does not grant the preview capability: browser preview tools are off for this thread. Do not retry them. To check a page, use a headless browser from the shell, such as Playwright, or curl. The user can turn on "Agent browser access" in Settings; it applies when the agent session next starts.
```

Suspected cause: `ProviderSessionManager.agentAccessSettings` (`apps/server/src/orchestration-v2/ProviderSessionManager.ts`) sees a browser override anywhere on the server, so it looks up the thread's project through `Effect.serviceOption(ProjectService)`. `layerProduction` in `apps/server/src/orchestration-v2/runtimeLayer.ts` does not supply `ProjectService` to the session manager, so the lookup returns `None` and the code takes the fail-closed branch. Every thread is denied, including threads that inherit the global "on".

Reproduced at `main` e78f580468 with a local, uncommitted unit test that builds `RuntimeLayer.layerProduction`:

```text
FAIL production MCP policy inherits enabled access with an unrelated project override
AssertionError: expected false to equal true
FAIL production MCP policy honors a project opt-in with an unrelated project override
AssertionError: expected false to equal true
```

A local change that provides `layerProjectService` to the whole production layer group makes all five policy cases pass. It has not been pushed or opened as a PR.

### Impact

Major degradation or frequent failure

### Version or commit

`main` @ e78f580468 for the test and root cause. The version of the desktop build the reporter runs is not known.

### Environment

Linux (Omarchy 4.0.6). Provider: Claude Agent. The agent reports the denial in several threads and projects.

### Logs or stack traces

The denial appears as the `tool_use_result` of every `mcp__t3-code__preview_*` call in the affected threads, starting 09:57 on 2026-10-21 and continuing through the day.

### Workaround

Remove the per-project "Agent browser access" override from every project that has one. Without any browser override left, the server uses the global setting. This follows from reading the code. It has not been confirmed in the Settings UI.

### Related

- #17202: same denial message and setting, opposite symptom.

