GeezerVison is showing github.com — feat(acp): add opt-in flag for question tool (#13562) · masegraye/opencode@9d3c81a
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .opencode/agent/translator.md +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -599,6 +599,7 @@ OPENCODE_EXPERIMENTAL_MARKDOWN |
599 | 599 | OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX |
600 | 600 | OPENCODE_EXPERIMENTAL_OXFMT |
601 | 601 | OPENCODE_EXPERIMENTAL_PLAN_MODE |
| 602 | +OPENCODE_ENABLE_QUESTION_TOOL |
602 | 603 | OPENCODE_FAKE_VCS |
603 | 604 | OPENCODE_GIT_BASH_PATH |
604 | 605 | OPENCODE_MODEL |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/acp/README.md +10Lines changed: 10 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -44,6 +44,16 @@ opencode acp |
44 | 44 | opencode acp --cwd /path/to/project |
45 | 45 | ``` |
46 | 46 |
|
| 47 | +### Question Tool Opt-In |
| 48 | + |
| 49 | +ACP excludes `QuestionTool` by default. |
| 50 | + |
| 51 | +```bash |
| 52 | +OPENCODE_ENABLE_QUESTION_TOOL=1 opencode acp |
| 53 | +``` |
| 54 | + |
| 55 | +Enable this only for ACP clients that support interactive question prompts. |
| 56 | + |
47 | 57 | ### Programmatic |
48 | 58 |
|
49 | 59 | ```typescript |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/flag/flag.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,6 +30,7 @@ export namespace Flag { |
30 | 30 | export declare const OPENCODE_CLIENT: string |
31 | 31 | export const OPENCODE_SERVER_PASSWORD = process.env["OPENCODE_SERVER_PASSWORD"] |
32 | 32 | export const OPENCODE_SERVER_USERNAME = process.env["OPENCODE_SERVER_USERNAME"] |
| 33 | + export const OPENCODE_ENABLE_QUESTION_TOOL = truthy("OPENCODE_ENABLE_QUESTION_TOOL") |
33 | 34 |
|
34 | 35 | // Experimental |
35 | 36 | export const OPENCODE_EXPERIMENTAL = truthy("OPENCODE_EXPERIMENTAL") |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/tool/registry.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -94,10 +94,11 @@ export namespace ToolRegistry { |
94 | 94 | async function all(): Promise<Tool.Info[]> { |
95 | 95 | const custom = await state().then((x) => x.custom) |
96 | 96 | const config = await Config.get() |
| 97 | + const question = ["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) || Flag.OPENCODE_ENABLE_QUESTION_TOOL |
97 | 98 |
|
98 | 99 | return [ |
99 | 100 | InvalidTool, |
100 | | - ...(["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) ? [QuestionTool] : []), |
| 101 | + ...(question ? [QuestionTool] : []), |
101 | 102 | BashTool, |
102 | 103 | ReadTool, |
103 | 104 | GlobTool, |
|