GeezerVison is showing github.com — LLM cleanup (#5462) · JerryCai/opencode@fed4776
File treeExpand 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/opencode.jsonc +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | "options": {}, | 11 | 11 | }, | 12 | 12 | }, | | 13 | + "mcp": {}, | 13 | 14 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/desktop/src/context/local.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -78,7 +78,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ | 78 | 78 | }) | 79 | 79 |
| 80 | 80 | const agent = (() => { | 81 | | - const list = createMemo(() => sync.data.agent.filter((x) => x.mode !== "subagent")) | | 81 | + const list = createMemo(() => sync.data.agent.filter((x) => x.mode !== "subagent" && !x.hidden)) | 82 | 82 | const [store, setStore] = createStore<{ | 83 | 83 | current: string | 84 | 84 | }>({ | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/agent/agent.ts +47-27Lines changed: 47 additions & 27 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,18 +2,24 @@ import { Config } from "../config/config" | 2 | 2 | import z from "zod" | 3 | 3 | import { Provider } from "../provider/provider" | 4 | 4 | import { generateObject, type ModelMessage } from "ai" | 5 | | -import PROMPT_GENERATE from "./generate.txt" | 6 | 5 | import { SystemPrompt } from "../session/system" | 7 | 6 | import { Instance } from "../project/instance" | 8 | 7 | import { mergeDeep } from "remeda" | 9 | 8 |
| | 9 | +import PROMPT_GENERATE from "./generate.txt" | | 10 | +import PROMPT_COMPACTION from "./prompt/compaction.txt" | | 11 | +import PROMPT_EXPLORE from "./prompt/explore.txt" | | 12 | +import PROMPT_SUMMARY from "./prompt/summary.txt" | | 13 | +import PROMPT_TITLE from "./prompt/title.txt" | | 14 | + | 10 | 15 | export namespace Agent { | 11 | 16 | export const Info = z | 12 | 17 | .object({ | 13 | 18 | name: z.string(), | 14 | 19 | description: z.string().optional(), | 15 | 20 | mode: z.enum(["subagent", "primary", "all"]), | 16 | | - builtIn: z.boolean(), | | 21 | + native: z.boolean().optional(), | | 22 | + hidden: z.boolean().optional(), | 17 | 23 | topP: z.number().optional(), | 18 | 24 | temperature: z.number().optional(), | 19 | 25 | color: z.string().optional(), | @@ -112,7 +118,8 @@ export namespace Agent { | 112 | 118 | options: {}, | 113 | 119 | permission: agentPermission, | 114 | 120 | mode: "subagent", | 115 | | - builtIn: true, | | 121 | + native: true, | | 122 | + hidden: true, | 116 | 123 | }, | 117 | 124 | explore: { | 118 | 125 | name: "explore", | @@ -124,38 +131,51 @@ export namespace Agent { | 124 | 131 | ...defaultTools, | 125 | 132 | }, | 126 | 133 | description: `Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.`, | 127 | | - prompt: [ | 128 | | - `You are a file search specialist. You excel at thoroughly navigating and exploring codebases.`, | 129 | | - ``, | 130 | | - `Your strengths:`, | 131 | | - `- Rapidly finding files using glob patterns`, | 132 | | - `- Searching code and text with powerful regex patterns`, | 133 | | - `- Reading and analyzing file contents`, | 134 | | - ``, | 135 | | - `Guidelines:`, | 136 | | - `- Use Glob for broad file pattern matching`, | 137 | | - `- Use Grep for searching file contents with regex`, | 138 | | - `- Use Read when you know the specific file path you need to read`, | 139 | | - `- Use Bash for file operations like copying, moving, or listing directory contents`, | 140 | | - `- Adapt your search approach based on the thoroughness level specified by the caller`, | 141 | | - `- Return file paths as absolute paths in your final response`, | 142 | | - `- For clear communication, avoid using emojis`, | 143 | | - `- Do not create any files, or run bash commands that modify the user's system state in any way`, | 144 | | - ``, | 145 | | - `Complete the user's search request efficiently and report your findings clearly.`, | 146 | | - ].join("\n"), | | 134 | + prompt: PROMPT_EXPLORE, | 147 | 135 | options: {}, | 148 | 136 | permission: agentPermission, | 149 | 137 | mode: "subagent", | 150 | | - builtIn: true, | | 138 | + native: true, | | 139 | + }, | | 140 | + compaction: { | | 141 | + name: "compaction", | | 142 | + mode: "primary", | | 143 | + native: true, | | 144 | + hidden: true, | | 145 | + prompt: PROMPT_COMPACTION, | | 146 | + tools: { | | 147 | + "*": false, | | 148 | + }, | | 149 | + options: {}, | | 150 | + permission: agentPermission, | 151 | 151 | }, | 152 | 152 | build: { | 153 | 153 | name: "build", | 154 | 154 | tools: { ...defaultTools }, | 155 | 155 | options: {}, | 156 | 156 | permission: agentPermission, | 157 | 157 | mode: "primary", | 158 | | - builtIn: true, | | 158 | + native: true, | | 159 | + }, | | 160 | + title: { | | 161 | + name: "title", | | 162 | + mode: "primary", | | 163 | + options: {}, | | 164 | + native: true, | | 165 | + hidden: true, | | 166 | + permission: agentPermission, | | 167 | + prompt: PROMPT_TITLE, | | 168 | + tools: {}, | | 169 | + }, | | 170 | + summary: { | | 171 | + name: "summary", | | 172 | + mode: "primary", | | 173 | + options: {}, | | 174 | + native: true, | | 175 | + hidden: true, | | 176 | + permission: agentPermission, | | 177 | + prompt: PROMPT_SUMMARY, | | 178 | + tools: {}, | 159 | 179 | }, | 160 | 180 | plan: { | 161 | 181 | name: "plan", | @@ -165,7 +185,7 @@ export namespace Agent { | 165 | 185 | ...defaultTools, | 166 | 186 | }, | 167 | 187 | mode: "primary", | 168 | | - builtIn: true, | | 188 | + native: true, | 169 | 189 | }, | 170 | 190 | } | 171 | 191 | for (const [key, value] of Object.entries(cfg.agent ?? {})) { | @@ -181,7 +201,7 @@ export namespace Agent { | 181 | 201 | permission: agentPermission, | 182 | 202 | options: {}, | 183 | 203 | tools: {}, | 184 | | - builtIn: false, | | 204 | + native: false, | 185 | 205 | } | 186 | 206 | const { | 187 | 207 | name, | |
Collapse file Copy file name to clipboard File renamed without changes. Collapse file Copy file name to clipboard +18Lines changed: 18 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +You are a file search specialist. You excel at thoroughly navigating and exploring codebases. | | 2 | + | | 3 | +Your strengths: | | 4 | +- Rapidly finding files using glob patterns | | 5 | +- Searching code and text with powerful regex patterns | | 6 | +- Reading and analyzing file contents | | 7 | + | | 8 | +Guidelines: | | 9 | +- Use Glob for broad file pattern matching | | 10 | +- Use Grep for searching file contents with regex | | 11 | +- Use Read when you know the specific file path you need to read | | 12 | +- Use Bash for file operations like copying, moving, or listing directory contents | | 13 | +- Adapt your search approach based on the thoroughness level specified by the caller | | 14 | +- Return file paths as absolute paths in your final response | | 15 | +- For clear communication, avoid using emojis | | 16 | +- Do not create any files, or run bash commands that modify the user's system state in any way | | 17 | + | | 18 | +Complete the user's search request efficiently and report your findings clearly. |
Collapse file Copy file name to clipboard File renamed without changes. Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/agent/prompt/title.txt +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,8 +22,8 @@ Your output must be: | 22 | 22 | - The title should NEVER include "summarizing" or "generating" when generating a title | 23 | 23 | - DO NOT SAY YOU CANNOT GENERATE A TITLE OR COMPLAIN ABOUT THE INPUT | 24 | 24 | - Always output something meaningful, even if the input is minimal. | 25 | | -- If the user message is short or conversational (e.g. “hello”, “lol”, “whats up”, “hey”): | 26 | | - → create a title that reflects the user’s tone or intent (such as Greeting, Quick check-in, Light chat, Intro message, etc.) | | 25 | +- If the user message is short or conversational (e.g. "hello", "lol", "whats up", "hey"): | | 26 | + → create a title that reflects the user's tone or intent (such as Greeting, Quick check-in, Light chat, Intro message, etc.) | 27 | 27 | </rules> | 28 | 28 |
| 29 | 29 | <examples> | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/agent.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -227,8 +227,8 @@ const AgentListCommand = cmd({ | 227 | 227 | async fn() { | 228 | 228 | const agents = await Agent.list() | 229 | 229 | const sortedAgents = agents.sort((a, b) => { | 230 | | - if (a.builtIn !== b.builtIn) { | 231 | | - return a.builtIn ? -1 : 1 | | 230 | + if (a.native !== b.native) { | | 231 | + return a.native ? -1 : 1 | 232 | 232 | } | 233 | 233 | return a.name.localeCompare(b.name) | 234 | 234 | }) | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,7 @@ export function DialogAgent() { | 12 | 12 | return { | 13 | 13 | value: item.name, | 14 | 14 | title: item.name, | 15 | | - description: item.builtIn ? "native" : item.description, | | 15 | + description: item.native ? "native" : item.description, | 16 | 16 | } | 17 | 17 | }), | 18 | 18 | ) | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -184,7 +184,7 @@ export function Autocomplete(props: { | 184 | 184 | const agents = createMemo(() => { | 185 | 185 | const agents = sync.data.agent | 186 | 186 | return agents | 187 | | - .filter((agent) => !agent.builtIn && agent.mode !== "primary") | | 187 | + .filter((agent) => !agent.hidden && agent.mode !== "primary") | 188 | 188 | .map( | 189 | 189 | (agent): AutocompleteOption => ({ | 190 | 190 | display: "@" + agent.name, | |
|