From 5f0329053451aa1120ac005abe98e3176b8ebfdc Mon Sep 17 00:00:00 2001 From: Rohan Godha Date: Thu, 18 Dec 2025 19:17:34 -0500 Subject: [PATCH 01/30] feat(tui): click on subagents to open them (#5761) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> --- .../tui/routes/session/dialog-subagent.tsx | 26 ++++++++++++++++++ .../src/cli/cmd/tui/routes/session/index.tsx | 27 ++++++++++++++++--- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 packages/opencode/src/cli/cmd/tui/routes/session/dialog-subagent.tsx diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/dialog-subagent.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-subagent.tsx new file mode 100644 index 000000000000..a9446b20d95c --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-subagent.tsx @@ -0,0 +1,26 @@ +import { DialogSelect } from "@tui/ui/dialog-select" +import { useRoute } from "@tui/context/route" + +export function DialogSubagent(props: { sessionID: string }) { + const route = useRoute() + + return ( + { + route.navigate({ + type: "session", + sessionID: props.sessionID, + }) + dialog.clear() + }, + }, + ]} + /> + ) +} diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index 2d6f60cc0a63..2e72f482ddec 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -66,6 +66,7 @@ import stripAnsi from "strip-ansi" import { Footer } from "./footer.tsx" import { usePromptRef } from "../../context/prompt" import { Filesystem } from "@/util/filesystem" +import { DialogSubagent } from "./dialog-subagent.tsx" addDefaultParsers(parsers.parsers) @@ -1528,13 +1529,33 @@ ToolRegistry.register({ ToolRegistry.register({ name: "task", - container: "block", + container: "inline", render(props) { const { theme } = useTheme() const keybind = useKeybind() + const dialog = useDialog() + const renderer = useRenderer() + const [hover, setHover] = createSignal(false) return ( - <> + setHover(true)} + onMouseOut={() => setHover(false)} + onMouseUp={() => { + const id = props.metadata.sessionId + if (renderer.getSelection()?.getSelectedText() || !id) return + dialog.replace(() => ) + }} + > {Locale.titlecase(props.input.subagent_type ?? "unknown")} Task "{props.input.description}" @@ -1557,7 +1578,7 @@ ToolRegistry.register({ {keybind.print("session_child_cycle")}, {keybind.print("session_child_cycle_reverse")} to navigate between subagent sessions - + ) }, }) From 2f41d0beddacc378e00cfff710cd233f4d2dc33b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 19 Dec 2025 00:18:07 +0000 Subject: [PATCH 02/30] chore: generate --- packages/plugin/package.json | 2 +- packages/sdk/js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin/package.json b/packages/plugin/package.json index aad2a6ef5273..a5a4d38b464b 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -24,4 +24,4 @@ "typescript": "catalog:", "@typescript/native-preview": "catalog:" } -} \ No newline at end of file +} diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index f1de8914a731..aaa3a7af3f4f 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -29,4 +29,4 @@ "publishConfig": { "directory": "dist" } -} \ No newline at end of file +} From 4fd576f3af7730214ccae70cf95b5ddf8501d496 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 18 Dec 2025 18:46:25 -0600 Subject: [PATCH 03/30] fix: better api call error msgs in some cases --- packages/opencode/src/session/message-v2.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/session/message-v2.ts b/packages/opencode/src/session/message-v2.ts index 4781b0c47b1c..14542669ee9d 100644 --- a/packages/opencode/src/session/message-v2.ts +++ b/packages/opencode/src/session/message-v2.ts @@ -612,6 +612,14 @@ export namespace MessageV2 { case APICallError.isInstance(e): const message = iife(() => { let msg = e.message + if (msg === "") { + if (e.responseBody) return e.responseBody + if (e.statusCode) { + const err = STATUS_CODES[e.statusCode] + if (err) return err + } + return "Unknown error" + } const transformed = ProviderTransform.error(ctx.providerID, e) if (transformed !== msg) { return transformed @@ -630,7 +638,7 @@ export namespace MessageV2 { } catch {} return `${msg}: ${e.responseBody}` - }) + }).trim() return new MessageV2.APIError( { From b99afdad919215774024807ef8a3773925267e3c Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Fri, 19 Dec 2025 10:49:37 +1000 Subject: [PATCH 04/30] tweak: better release notes (grouped changelog) (#5768) --- script/publish.ts | 196 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 137 insertions(+), 59 deletions(-) diff --git a/script/publish.ts b/script/publish.ts index 7b5256312837..ad1c9d31c34e 100755 --- a/script/publish.ts +++ b/script/publish.ts @@ -6,6 +6,34 @@ import { Script } from "@opencode-ai/script" const notes = [] as string[] +const team = [ + "actions-user", + "opencode", + "rekram1-node", + "thdxr", + "kommander", + "jayair", + "fwang", + "adamdotdevin", + "iamdavidhill", + "opencode-agent[bot]", +] + +function getAreaFromPath(file: string): string { + if (file.startsWith("packages/")) { + const parts = file.replace("packages/", "").split("/") + if (parts[0] === "extensions" && parts[1]) return `extensions/${parts[1]}` + return parts[0] || "other" + } + if (file.startsWith("sdks/")) { + const name = file.replace("sdks/", "").split("/")[0] || "other" + return `extensions/${name}` + } + const rootDir = file.split("/")[0] + if (rootDir && !rootDir.includes(".")) return rootDir + return "other" +} + console.log("=== publishing ===\n") if (!Script.preview) { @@ -16,13 +44,59 @@ if (!Script.preview) { }) .then((data: any) => data.version) - const log = - await $`git log v${previous}..HEAD --oneline --format="%h %s" -- packages/opencode packages/sdk packages/plugin packages/tauri packages/desktop`.text() + // Fetch commit authors from GitHub API (hash -> login) + const compare = + await $`gh api "/repos/sst/opencode/compare/v${previous}...HEAD" --jq '.commits[] | {sha: .sha, login: .author.login, message: .commit.message}'`.text() + const authorByHash = new Map() + const contributors = new Map() - const commits = log - .split("\n") - .filter((line) => line && !line.match(/^\w+ (ignore:|test:|chore:|ci:)/i)) - .join("\n") + for (const line of compare.split("\n").filter(Boolean)) { + const { sha, login, message } = JSON.parse(line) as { sha: string; login: string | null; message: string } + const shortHash = sha.slice(0, 7) + if (login) authorByHash.set(shortHash, login) + + const title = message.split("\n")[0] || "" + if (title.match(/^(ignore:|test:|chore:|ci:|release:)/i)) continue + if (login && !team.includes(login)) { + if (!contributors.has(login)) contributors.set(login, []) + contributors.get(login)?.push(title) + } + } + + // Batch-fetch files for all commits (hash -> areas) + const diffLog = await $`git log v${previous}..HEAD --name-only --format="%h"`.text() + const areasByHash = new Map>() + let currentHash: string | null = null + + for (const rawLine of diffLog.split("\n")) { + const line = rawLine.trim() + if (!line) continue + if (/^[0-9a-f]{7}$/i.test(line)) { + currentHash = line + if (!areasByHash.has(currentHash)) areasByHash.set(currentHash, new Set()) + continue + } + if (currentHash) { + areasByHash.get(currentHash)!.add(getAreaFromPath(line)) + } + } + + // Build commit lines with author and areas + const log = await $`git log v${previous}..HEAD --oneline --format="%h %s"`.text() + const commitLines = log.split("\n").filter((line) => line && !line.match(/^\w+ (ignore:|test:|chore:|ci:|release:)/i)) + + const commitsWithMeta = commitLines + .map((line) => { + const hash = line.split(" ")[0] + if (!hash) return null + const author = authorByHash.get(hash) + const authorStr = author ? ` [author: ${author}]` : "" + const areas = areasByHash.get(hash) + const areaStr = areas && areas.size > 0 ? ` [areas: ${[...areas].join(", ")}]` : " [areas: other]" + return `${line}${authorStr}${areaStr}` + }) + .filter(Boolean) as string[] + const commits = commitsWithMeta.join("\n") const opencode = await createOpencode() const session = await opencode.client.session.create() @@ -35,37 +109,72 @@ if (!Script.preview) { body: { model: { providerID: "opencode", - modelID: "claude-haiku-4-5", + modelID: "gemini-3-flash", }, parts: [ { type: "text", text: ` - Analyze these commits and generate a changelog of all notable user facing changes. - - Commits between ${previous} and HEAD: - ${commits} - - - Do NOT make general statements about "improvements", be very specific about what was changed. - - Do NOT include any information about code changes if they do not affect the user facing changes. - - For commits that are already well-written and descriptive, avoid rewording them. Simply capitalize the first letter, fix any misspellings, and ensure proper English grammar. - - DO NOT read any other commits than the ones listed above (THIS IS IMPORTANT TO AVOID DUPLICATING THINGS IN OUR CHANGELOG) - - If a commit was made and then reverted do not include it in the changelog. If the commits only include a revert but not the original commit, then include the revert in the changelog. - - IMPORTANT: ONLY return a bulleted list of changes, do not include any other information. Do not include a preamble like "Based on my analysis..." - - - - Added ability to @ mention agents - - Fixed a bug where the TUI would render improperly on some terminals - - `, +Analyze these commits and generate a changelog of all notable user facing changes, grouped by area. + +Each commit below includes: +- [author: username] showing the GitHub username of the commit author +- [areas: ...] showing which areas of the codebase were modified + +Commits between ${previous} and HEAD: +${commits} + +Group the changes into these categories based on the [areas: ...] tags (omit any category with no changes): +- **TUI**: Changes to "opencode" area (the terminal/CLI interface) +- **Desktop**: Changes to "desktop" or "tauri" areas (the desktop application) +- **SDK**: Changes to "sdk" or "plugin" areas (the SDK and plugin system) +- **Extensions**: Changes to "extensions/zed", "extensions/vscode", or "github" areas (editor extensions and GitHub Action) +- **Other**: Any user-facing changes that don't fit the above categories + +Excluded areas (omit these entirely unless they contain user-facing changes like refactors that may affect behavior): +- "nix", "infra", "script" - CI/build infrastructure +- "ui", "docs", "web", "console", "enterprise", "function", "util", "identity", "slack" - internal packages + +Rules: +- Use the [areas: ...] tags to determine the correct category. If a commit touches multiple areas, put it in the most relevant user-facing category. +- ONLY include commits that have user-facing impact. Omit purely internal changes (CI, build scripts, internal tooling). +- However, DO include refactors that touch user-facing code - refactors can introduce bugs or change behavior. +- Do NOT make general statements about "improvements", be very specific about what was changed. +- For commits that are already well-written and descriptive, avoid rewording them. Simply capitalize the first letter, fix any misspellings, and ensure proper English grammar. +- DO NOT read any other commits than the ones listed above (THIS IS IMPORTANT TO AVOID DUPLICATING THINGS IN OUR CHANGELOG). +- If a commit was made and then reverted do not include it in the changelog. If the commits only include a revert but not the original commit, then include the revert in the changelog. +- Omit categories that have no changes. +- For community contributors: if the [author: username] is NOT in the team list, add (@username) at the end of the changelog entry. This is REQUIRED for all non-team contributors. +- The team members are: ${team.join(", ")}. Do NOT add @ mentions for team members. + +IMPORTANT: ONLY return the grouped changelog, do not include any other information. Do not include a preamble like "Based on my analysis..." or "Here is the changelog..." + + +## TUI +- Added experimental support for the Ty language server (@OpeOginni) +- Added /fork slash command for keyboard-friendly session forking (@ariane-emory) +- Increased retry attempts for failed requests +- Fixed model validation before executing slash commands (@devxoul) + +## Desktop +- Added shell mode support +- Fixed prompt history navigation and optimistic prompt duplication +- Disabled pinch-to-zoom on Linux (@Brendonovich) + +## Extensions +- Added OIDC_BASE_URL support for custom GitHub App installations (@elithrar) + +`, }, ], }, }) .then((x) => x.data?.parts?.find((y) => y.type === "text")?.text) for (const line of raw?.split("\n") ?? []) { - if (line.startsWith("- ")) { + if (line.startsWith("## ")) { + if (notes.length > 0) notes.push("") + notes.push(line) + } else if (line.startsWith("- ")) { notes.push(line) } } @@ -74,42 +183,11 @@ if (!Script.preview) { console.log("-----------------------------") opencode.server.close() - // Get contributors - const team = [ - "actions-user", - "opencode", - "rekram1-node", - "thdxr", - "kommander", - "jayair", - "fwang", - "adamdotdevin", - "iamdavidhill", - "opencode-agent[bot]", - ] - const compare = - await $`gh api "/repos/sst/opencode/compare/v${previous}...HEAD" --jq '.commits[] | {login: .author.login, message: .commit.message}'`.text() - const contributors = new Map() - - for (const line of compare.split("\n").filter(Boolean)) { - const { login, message } = JSON.parse(line) as { login: string | null; message: string } - const title = message.split("\n")[0] ?? "" - if (title.match(/^(ignore:|test:|chore:|ci:|release:)/i)) continue - - if (login && !team.includes(login)) { - if (!contributors.has(login)) contributors.set(login, []) - contributors.get(login)?.push(title) - } - } - if (contributors.size > 0) { notes.push("") notes.push(`**Thank you to ${contributors.size} community contributor${contributors.size > 1 ? "s" : ""}:**`) - for (const [username, userCommits] of contributors) { - notes.push(`- @${username}:`) - for (const commit of userCommits) { - notes.push(` - ${commit}`) - } + for (const username of contributors.keys()) { + notes.push(`- @${username}`) } } } From 87171467fa94041483d491952416987df4c43671 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 18 Dec 2025 19:03:11 -0600 Subject: [PATCH 05/30] ci: better err msg for generate workflow --- .github/workflows/generate.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 66a38c3766f2..f9713a198296 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -30,7 +30,6 @@ jobs: run: ./script/generate.ts - name: Commit and push - id: push run: | if [ -z "$(git status --porcelain)" ]; then echo "No changes to commit" @@ -40,16 +39,15 @@ jobs: git config --local user.name "GitHub Action" git add -A git commit -m "chore: generate" - git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }} --no-verify - - - name: Comment on failure - if: failure() - run: | - MESSAGE=$'Failed to push generated code. Please run locally and push:\n```\n./script/generate.ts\ngit add -A && git commit -m "chore: generate" && git push\n```' - if [ -n "${{ github.event.pull_request.number }}" ]; then - gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$MESSAGE" - else - gh api repos/${{ github.repository }}/commits/${{ github.sha }}/comments -f body="$MESSAGE" + if ! git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }} --no-verify; then + echo "" + echo "============================================" + echo "Failed to push generated code." + echo "Please run locally and push:" + echo "" + echo " ./script/generate.ts" + echo " git add -A && git commit -m \"chore: generate\" && git push" + echo "" + echo "============================================" + exit 1 fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0dd716a75e87b12c07a73813878ac533f3740fa6 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Thu, 18 Dec 2025 19:53:38 -0600 Subject: [PATCH 06/30] fix(desktop): extra reqs --- packages/desktop/src/components/header.tsx | 200 ++++++++++--------- packages/desktop/src/context/global-sync.tsx | 2 + 2 files changed, 107 insertions(+), 95 deletions(-) diff --git a/packages/desktop/src/components/header.tsx b/packages/desktop/src/components/header.tsx index d70bfee248d3..fd4b2c439611 100644 --- a/packages/desktop/src/components/header.tsx +++ b/packages/desktop/src/components/header.tsx @@ -24,11 +24,6 @@ export function Header(props: { const globalSDK = useGlobalSDK() const layout = useLayout() const params = useParams() - const currentDirectory = createMemo(() => base64Decode(params.dir ?? "")) - const store = createMemo(() => globalSync.child(currentDirectory())[0]) - const sessions = createMemo(() => store().session ?? []) - const currentSession = createMemo(() => sessions().find((s) => s.id === params.id)) - const shareEnabled = createMemo(() => store().config.share !== "disabled") return (
@@ -45,101 +40,116 @@ export function Header(props: {
- 0}> -
-
- project.worktree)} + current={currentDirectory()} + label={(x) => getFilename(x)} + onSelect={(x) => (x ? props.navigateToProject(x) : undefined)} + class="text-14-regular text-text-base" + variant="ghost" + > + {/* @ts-ignore */} + {(i) => ( +
+ +
{getFilename(i)}
+
+ )} + +
/
+ -
/
-