Skip to content

Commit 1a6461e

Browse files
authored
fix: ensure ask question tool isn't included when using acp (anomalyco#11379)
1 parent e834a2e commit 1a6461e

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

packages/opencode/src/cli/cmd/acp.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const AcpCommand = cmd({
2020
})
2121
},
2222
handler: async (args) => {
23+
process.env.OPENCODE_CLIENT = "acp"
2324
await bootstrap(process.cwd(), async () => {
2425
const opts = await resolveNetworkOptions(args)
2526
const server = Server.listen(opts)

packages/opencode/src/flag/flag.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export namespace Flag {
2525
OPENCODE_DISABLE_CLAUDE_CODE || truthy("OPENCODE_DISABLE_CLAUDE_CODE_SKILLS")
2626
export declare const OPENCODE_DISABLE_PROJECT_CONFIG: boolean
2727
export const OPENCODE_FAKE_VCS = process.env["OPENCODE_FAKE_VCS"]
28-
export const OPENCODE_CLIENT = process.env["OPENCODE_CLIENT"] ?? "cli"
28+
export declare const OPENCODE_CLIENT: string
2929
export const OPENCODE_SERVER_PASSWORD = process.env["OPENCODE_SERVER_PASSWORD"]
3030
export const OPENCODE_SERVER_USERNAME = process.env["OPENCODE_SERVER_USERNAME"]
3131

@@ -77,3 +77,14 @@ Object.defineProperty(Flag, "OPENCODE_CONFIG_DIR", {
7777
enumerable: true,
7878
configurable: false,
7979
})
80+
81+
// Dynamic getter for OPENCODE_CLIENT
82+
// This must be evaluated at access time, not module load time,
83+
// because some commands override the client at runtime
84+
Object.defineProperty(Flag, "OPENCODE_CLIENT", {
85+
get() {
86+
return process.env["OPENCODE_CLIENT"] ?? "cli"
87+
},
88+
enumerable: true,
89+
configurable: false,
90+
})

0 commit comments

Comments
 (0)