# fix\(server\): revoke the MCP credential when agent browser access is withheld · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/324e3be3c0218dc4a6eb3198c8d931b0889d892a)

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

Visibility: public

Requested revision: 324e3be3c0218dc4a6eb3198c8d931b0889d892a

Requested commit: 324e3be3c0218dc4a6eb3198c8d931b0889d892a

Commit: 324e3be3c0218dc4a6eb3198c8d931b0889d892a

Tree: df7f3a425956fef1dc7978ee8730ffeb3e9dd83b

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): revoke the MCP credential when agent browser access is withheld

The deny path only cleared the in-memory provider-session map. Every other
prepare path reaches `issueActiveMcpCredential`, which revokes the thread
first, so skipping it left a previously issued bearer token valid against
`/mcp` for the rest of its liveness window — and `touchActiveMcpThread` on
later turns kept refreshing it.

Session restarts for runtime mode, cwd or model re-prepare without stopping,
so they relied on that revoke. An agent whose process outlived the toggle
could have kept driving the browser after the user withheld access, which is
the one outcome this feature exists to prevent.

Reported by the review bot on #7083.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

```

## Parents

- [9989fdf25bbabe2e3c77a5d56bf5792e4803ed53](https://git.cafe/pingdotgg/t3code/commit/9989fdf25bbabe2e3c77a5d56bf5792e4803ed53?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/324e3be3c0218dc4a6eb3198c8d931b0889d892a?format=markdown)
