diff --git a/packages/server/src/server/agent/providers/opencode-agent.ts b/packages/server/src/server/agent/providers/opencode-agent.ts index bacf6487be..67c81ae570 100644 --- a/packages/server/src/server/agent/providers/opencode-agent.ts +++ b/packages/server/src/server/agent/providers/opencode-agent.ts @@ -238,11 +238,11 @@ function isOpenCodeAutoAcceptEnabled(config: AgentSessionConfig): boolean { } /** What opening changed in the options the caller gave: legacy `full-access` turns Auto Accept on. */ -function openCodeOpenOptionsPatch( - given: AgentSessionConfig, - opened: OpenCodeAgentConfig, -): Record { - return isOpenCodeAutoAcceptEnabled(opened) && !isOpenCodeAutoAcceptEnabled(given) +function openCodeOpenOptionsPatch(input: { + given: AgentSessionConfig; + opened: OpenCodeAgentConfig; +}): Record { + return isOpenCodeAutoAcceptEnabled(input.opened) && !isOpenCodeAutoAcceptEnabled(input.given) ? { [OPENCODE_AUTO_ACCEPT_FEATURE_ID]: true } : {}; } @@ -1504,7 +1504,7 @@ export class OpenCodeAgentClient implements AgentClient { false, unbindBridge, connectServer, - openCodeOpenOptionsPatch(config, openCodeConfig), + openCodeOpenOptionsPatch({ given: config, opened: openCodeConfig }), ); } catch (error) { await connection.release(); @@ -1560,7 +1560,7 @@ export class OpenCodeAgentClient implements AgentClient { registeredAcquisition !== null, unbindBridge, connectServer, - openCodeOpenOptionsPatch(config, openCodeConfig), + openCodeOpenOptionsPatch({ given: config, opened: openCodeConfig }), ); } catch (error) { await connection.release();