fix: add a Default agent permission choice and stop forwarding cookies to OpenCode (OM-179)

Each agent permission select now offers Default, shown when the agent has no wildcard rule for the action. Choosing Allow, Ask or Deny writes an agent rule even when it matches the inherited effect; choosing Default removes the agent's wildcard rules so the global permission applies.

The local OpenCode proxy drops the browser's Cookie header, as the linked-server proxy already does.
This commit is contained in:
Chris Scott committed 2026-11-05 15:58:53 -05:00
1 parent 38d618be9b
commit 670c66f85b
4 files changed
+64 -24

No files matched your search

+3 -1
View File
@@ -6,6 +6,8 @@ import { forwardProxyRequest } from '../../utils/proxy-forward'
import { getOpenCodeBasicAuthHeader, type OpenCodePasswordResolver } from './auth'
import { getOpenCodeUpstreamBaseUrl, withDefaultOpenCodeDirectory } from './upstream'
const FORWARD_EXCLUDED_HEADERS: ReadonlySet<string> = new Set(['cookie'])
export interface OpenCodeClient {
readonly api: OpenCodeApi
forwardRaw(request: Request): Promise<Response>
@@ -65,7 +67,7 @@ export class FetchOpenCodeClient implements OpenCodeClient {
async forwardRaw(request: Request): Promise<Response> {
const url = new URL(request.url)
const path = url.pathname.replace(/^\/api\/opencode/, '') + url.search
const headers = this.withDirectoryHeader(filterProxyHeaders(request.headers))
const headers = this.withDirectoryHeader(filterProxyHeaders(request.headers, FORWARD_EXCLUDED_HEADERS))
const basicAuth = await this.getBasicAuth()
if (basicAuth) {