From 68a801e61e23d3d17d69d85aa44a7e980bf7ff17 Mon Sep 17 00:00:00 2001 From: Julian Coy Date: Tue, 13 Jan 2026 20:31:05 -0500 Subject: [PATCH 1/5] Expose question/ask server endpoint for client and SDK use --- packages/opencode/src/question/index.ts | 48 ++++--- packages/opencode/src/server/question.ts | 27 ++++ .../opencode/test/question/question.test.ts | 29 ++++ .../opencode/test/server/question.test.ts | 126 ++++++++++++++++++ packages/sdk/js/src/v2/gen/sdk.gen.ts | 38 ++++++ packages/sdk/js/src/v2/gen/types.gen.ts | 43 +++++- 6 files changed, 289 insertions(+), 22 deletions(-) create mode 100644 packages/opencode/test/server/question.test.ts diff --git a/packages/opencode/src/question/index.ts b/packages/opencode/src/question/index.ts index d18098a9c4f..760c1df6b17 100644 --- a/packages/opencode/src/question/index.ts +++ b/packages/opencode/src/question/index.ts @@ -31,21 +31,25 @@ export namespace Question { }) export type Info = z.infer - export const Request = z - .object({ - id: Identifier.schema("question"), - sessionID: Identifier.schema("session"), - questions: z.array(Info).describe("Questions to ask"), - tool: z - .object({ - messageID: z.string(), - callID: z.string(), - }) - .optional(), - }) - .meta({ - ref: "QuestionRequest", - }) + export const AskInput = z.object({ + sessionID: Identifier.schema("session"), + questions: z.array(Info).describe("Questions to ask"), + tool: z + .object({ + messageID: z.string(), + callID: z.string(), + }) + .optional(), + }).meta({ + ref: 'QuestionAskInput' + }) + export type AskInput = z.infer + + export const Request = AskInput.safeExtend({ + id: Identifier.schema("question"), + }).meta({ + ref: "QuestionRequest", + }) export type Request = z.infer export const Answer = z.array(z.string()).meta({ @@ -94,17 +98,17 @@ export namespace Question { } }) - export async function ask(input: { - sessionID: string - questions: Info[] - tool?: { messageID: string; callID: string } - }): Promise { + export async function ask( + input: AskInput, + options?: { awaitAnswers: T } + ) { + const { awaitAnswers } = options ?? { awaitAnswers: true } const s = await state() const id = Identifier.ascending("question") log.info("asking", { id, questions: input.questions.length }) - return new Promise((resolve, reject) => { + const answerPromise = new Promise((resolve, reject) => { const info: Request = { id, sessionID: input.sessionID, @@ -118,6 +122,8 @@ export namespace Question { } Bus.publish(Event.Asked, info) }) + + return (awaitAnswers ? answerPromise : id) as T extends true ? typeof answerPromise : typeof id } export async function reply(input: { requestID: string; answers: Answer[] }): Promise { diff --git a/packages/opencode/src/server/question.ts b/packages/opencode/src/server/question.ts index c893862ca9f..1cd5b0e09b7 100644 --- a/packages/opencode/src/server/question.ts +++ b/packages/opencode/src/server/question.ts @@ -2,6 +2,7 @@ import { Hono } from "hono" import { describeRoute, validator } from "hono-openapi" import { resolver } from "hono-openapi" import { Question } from "../question" +import { Session } from "../session" import z from "zod" import { errors } from "./error" @@ -28,6 +29,32 @@ export const QuestionRoute = new Hono() return c.json(questions) }, ) + .post( + "/ask", + describeRoute({ + summary: "Ask a question", + description: "Ask a question to the AI assistant.", + operationId: "question.ask", + responses: { + 200: { + description: "Created question request", + content: { + "application/json": { + schema: resolver(Question.Request.pick({ id: true })), + }, + }, + }, + ...errors(400, 404), + }, + }), + validator("json", Question.AskInput), + async (c) => { + const json = c.req.valid("json") + await Session.get(json.sessionID) + const id = await Question.ask(json, { awaitAnswers: false }) + return c.json({ id }) + }, + ) .post( "/:requestID/reply", describeRoute({ diff --git a/packages/opencode/test/question/question.test.ts b/packages/opencode/test/question/question.test.ts index cf24faa7d22..7ccac785d14 100644 --- a/packages/opencode/test/question/question.test.ts +++ b/packages/opencode/test/question/question.test.ts @@ -54,6 +54,35 @@ test("ask - adds to pending list", async () => { }) }) +test("ask - returns ID when not awaiting answers", async () => { + await using tmp = await tmpdir({ git: true }) + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const questions = [ + { + question: "What would you like to do?", + header: "Action", + options: [ + { label: "Option 1", description: "First option" }, + { label: "Option 2", description: "Second option" }, + ], + }, + ] + + const id = await Question.ask({ + sessionID: "ses_test", + questions, + }, { awaitAnswers: false }) + + const pending = await Question.list() + expect(pending.length).toBe(1) + expect(pending[0].questions).toEqual(questions) + expect(pending[0].id).toBe(id) + }, + }) +}) + // reply tests test("reply - resolves the pending ask with answers", async () => { diff --git a/packages/opencode/test/server/question.test.ts b/packages/opencode/test/server/question.test.ts new file mode 100644 index 00000000000..30395e2de00 --- /dev/null +++ b/packages/opencode/test/server/question.test.ts @@ -0,0 +1,126 @@ +import { describe, expect, test } from "bun:test" +import path from "path" +import { Session } from "../../src/session" +import { Log } from "../../src/util/log" +import { Instance } from "../../src/project/instance" +import { Server } from "../../src/server/server" +import { Question } from "../../src/question" +import { Bus } from "../../src/bus" + +const projectRoot = path.join(__dirname, "../..") +Log.init({ print: false }) + +const questions: Question.AskInput["questions"] = [ + { + question: "What is your name?", + header: "Name", + options: [ + { description: "Julian", label: "Julian (the best name)" }, + { description: "Other", label: "Other" }, + ], + }, +] + +describe("question.ask endpoint", () => { + test("should return simple ID when asked a question", async () => { + await Instance.provide({ + directory: projectRoot, + fn: async () => { + // #given + const session = await Session.create({}) + const app = Server.App() + + // #when + const ask = await app.request("/question/ask", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ sessionID: session.id, questions } satisfies Question.AskInput), + }) + const responses = await app.request(`/question`, { method: "GET" }) + + // #then + expect(ask.status).toBe(200) + const { id } = await ask.json() + expect(id).toMatch(/^que_/) + + expect(responses.status).toBe(200) + const [response] = await responses.json() + expect(response).toMatchObject({ id, questions, sessionID: expect.stringMatching(/^ses_/) }) + + await Session.remove(session.id) + }, + }) + }) + + test("should return 404 when session does not exist", async () => { + await Instance.provide({ + directory: projectRoot, + fn: async () => { + // #given + const nonExistentSessionID = "ses_nonexistent123" + + // #when + const app = Server.App() + const response = await app.request("/question/ask", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ sessionID: nonExistentSessionID, questions }), + }) + + // #then + expect(response.status).toBe(404) + }, + }) + }) + + test("should return 400 when session ID format is invalid", async () => { + await Instance.provide({ + directory: projectRoot, + fn: async () => { + // #given + const invalidSessionID = "invalid_session_id" + + // #when + const app = Server.App() + const response = await app.request("/question/ask", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ sessionID: invalidSessionID, questions }), + }) + + // #then + expect(response.status).toBe(400) + }, + }) + }) + + test("should return 400 when header is too long", async () => { + await Instance.provide({ + directory: projectRoot, + fn: async () => { + // #given + const session = await Session.create({}) + const longHeaderQuestions: Question.AskInput["questions"] = [ + { + question: "What is your name?", + header: "This header is way too long", + options: [{ description: "Option", label: "Option" }], + }, + ] + + // #when + const app = Server.App() + const response = await app.request("/question/ask", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ sessionID: session.id, questions: longHeaderQuestions }), + }) + + // #then + expect(response.status).toBe(400) + + await Session.remove(session.id) + }, + }) + }) +}) diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index 697dac7eefe..4b657b39aa2 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -85,6 +85,9 @@ import type { PtyUpdateErrors, PtyUpdateResponses, QuestionAnswer, + QuestionAskErrors, + QuestionAskInput, + QuestionAskResponses, QuestionListResponses, QuestionRejectErrors, QuestionRejectResponses, @@ -1809,6 +1812,41 @@ export class Question extends HeyApiClient { }) } + /** + * Ask a question + * + * Ask a question to the AI assistant. + */ + public ask( + parameters?: { + directory?: string + questionAskInput?: QuestionAskInput + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { key: "questionAskInput", map: "body" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post({ + url: "/question/ask", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } + /** * Reply to question request * diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index 2bb3a600274..fff8242c078 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -552,7 +552,6 @@ export type QuestionInfo = { } export type QuestionRequest = { - id: string sessionID: string /** * Questions to ask @@ -562,6 +561,7 @@ export type QuestionRequest = { messageID: string callID: string } + id: string } export type EventQuestionAsked = { @@ -1839,6 +1839,18 @@ export type SubtaskPartInput = { command?: string } +export type QuestionAskInput = { + sessionID: string + /** + * Questions to ask + */ + questions: Array + tool?: { + messageID: string + callID: string + } +} + export type Command = { name: string description?: string @@ -3647,6 +3659,35 @@ export type QuestionListResponses = { export type QuestionListResponse = QuestionListResponses[keyof QuestionListResponses] +export type QuestionAskData = { + body?: QuestionAskInput + path?: never + query?: { + directory?: string + } + url: "/question/ask" +} + +export type QuestionAskErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type QuestionAskError = QuestionAskErrors[keyof QuestionAskErrors] + +export type QuestionAskResponses = { + /** + * Created question request + */ + 200: { + id: string + } +} + +export type QuestionAskResponse = QuestionAskResponses[keyof QuestionAskResponses] + export type QuestionReplyData = { body?: { /** From 1151447ed349eb6bcd9f7b24999b04fe4d7984f8 Mon Sep 17 00:00:00 2001 From: Julian Coy Date: Sat, 17 Jan 2026 18:51:30 -0500 Subject: [PATCH 2/5] Move to help merge --- packages/opencode/src/server/{ => routes}/question.ts | 6 +++--- packages/opencode/src/server/server.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename packages/opencode/src/server/{ => routes}/question.ts (96%) diff --git a/packages/opencode/src/server/question.ts b/packages/opencode/src/server/routes/question.ts similarity index 96% rename from packages/opencode/src/server/question.ts rename to packages/opencode/src/server/routes/question.ts index 1cd5b0e09b7..7963971d630 100644 --- a/packages/opencode/src/server/question.ts +++ b/packages/opencode/src/server/routes/question.ts @@ -1,10 +1,10 @@ import { Hono } from "hono" import { describeRoute, validator } from "hono-openapi" import { resolver } from "hono-openapi" -import { Question } from "../question" -import { Session } from "../session" +import { Question } from "../../question" +import { Session } from "../../session" import z from "zod" -import { errors } from "./error" +import { errors } from "../error" export const QuestionRoute = new Hono() .get( diff --git a/packages/opencode/src/server/server.ts b/packages/opencode/src/server/server.ts index 7015c818822..6aa1f317673 100644 --- a/packages/opencode/src/server/server.ts +++ b/packages/opencode/src/server/server.ts @@ -51,7 +51,7 @@ import { HTTPException } from "hono/http-exception" import { errors } from "./error" import { Pty } from "@/pty" import { PermissionNext } from "@/permission/next" -import { QuestionRoute } from "./question" +import { QuestionRoute } from "./routes/question" import { Installation } from "@/installation" import { MDNS } from "./mdns" import { Worktree } from "../worktree" From 20781bd3d57f4235b5573884ce8c22db2a16f2fc Mon Sep 17 00:00:00 2001 From: Julian Coy Date: Wed, 28 Jan 2026 22:41:30 -0500 Subject: [PATCH 3/5] Remove test that...doesn't matter anymore --- .../opencode/test/server/question.test.ts | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/packages/opencode/test/server/question.test.ts b/packages/opencode/test/server/question.test.ts index 30395e2de00..42a3adb0d0b 100644 --- a/packages/opencode/test/server/question.test.ts +++ b/packages/opencode/test/server/question.test.ts @@ -93,34 +93,4 @@ describe("question.ask endpoint", () => { }, }) }) - - test("should return 400 when header is too long", async () => { - await Instance.provide({ - directory: projectRoot, - fn: async () => { - // #given - const session = await Session.create({}) - const longHeaderQuestions: Question.AskInput["questions"] = [ - { - question: "What is your name?", - header: "This header is way too long", - options: [{ description: "Option", label: "Option" }], - }, - ] - - // #when - const app = Server.App() - const response = await app.request("/question/ask", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ sessionID: session.id, questions: longHeaderQuestions }), - }) - - // #then - expect(response.status).toBe(400) - - await Session.remove(session.id) - }, - }) - }) }) From e1e356cab4a9425fa287e4b01efd15187b8a9450 Mon Sep 17 00:00:00 2001 From: opencode Date: Fri, 30 Jan 2026 06:48:49 +0000 Subject: [PATCH 4/5] release: v1.1.45 --- bun.lock | 36 ++++++++++++-------------- packages/app/package.json | 2 +- packages/console/app/package.json | 2 +- packages/console/core/package.json | 2 +- packages/console/function/package.json | 2 +- packages/console/mail/package.json | 2 +- packages/desktop/package.json | 2 +- packages/enterprise/package.json | 2 +- packages/extensions/zed/extension.toml | 12 ++++----- packages/function/package.json | 2 +- packages/opencode/package.json | 2 +- packages/plugin/package.json | 2 +- packages/sdk/js/package.json | 2 +- packages/slack/package.json | 2 +- packages/ui/package.json | 2 +- packages/util/package.json | 2 +- packages/web/package.json | 2 +- sdks/vscode/package.json | 2 +- 18 files changed, 38 insertions(+), 42 deletions(-) diff --git a/bun.lock b/bun.lock index 99d35168f30..538712601d5 100644 --- a/bun.lock +++ b/bun.lock @@ -18,14 +18,12 @@ "prettier": "3.6.2", "semver": "^7.6.0", "sst": "3.17.23", - "stackback": "0.0.2", "turbo": "2.5.6", - "why-is-node-running": "2.2.2", }, }, "packages/app": { "name": "@opencode-ai/app", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -75,7 +73,7 @@ }, "packages/console/app": { "name": "@opencode-ai/console-app", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@ibm/plex": "6.4.1", @@ -109,7 +107,7 @@ }, "packages/console/core": { "name": "@opencode-ai/console-core", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -136,7 +134,7 @@ }, "packages/console/function": { "name": "@opencode-ai/console-function", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@ai-sdk/anthropic": "2.0.0", "@ai-sdk/openai": "2.0.2", @@ -160,7 +158,7 @@ }, "packages/console/mail": { "name": "@opencode-ai/console-mail", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -184,7 +182,7 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@opencode-ai/app": "workspace:*", "@opencode-ai/ui": "workspace:*", @@ -215,7 +213,7 @@ }, "packages/enterprise": { "name": "@opencode-ai/enterprise", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@opencode-ai/ui": "workspace:*", "@opencode-ai/util": "workspace:*", @@ -244,7 +242,7 @@ }, "packages/function": { "name": "@opencode-ai/function", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "catalog:", @@ -260,7 +258,7 @@ }, "packages/opencode": { "name": "opencode", - "version": "1.1.43", + "version": "1.1.45", "bin": { "opencode": "./bin/opencode", }, @@ -364,7 +362,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@opencode-ai/sdk": "workspace:*", "zod": "catalog:", @@ -384,7 +382,7 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "1.1.43", + "version": "1.1.45", "devDependencies": { "@hey-api/openapi-ts": "0.90.10", "@tsconfig/node22": "catalog:", @@ -395,7 +393,7 @@ }, "packages/slack": { "name": "@opencode-ai/slack", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@opencode-ai/sdk": "workspace:*", "@slack/bolt": "^3.17.1", @@ -408,7 +406,7 @@ }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -450,7 +448,7 @@ }, "packages/util": { "name": "@opencode-ai/util", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "zod": "catalog:", }, @@ -461,7 +459,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", @@ -3901,7 +3899,7 @@ "which-typed-array": ["which-typed-array@1.1.20", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg=="], - "why-is-node-running": ["why-is-node-running@2.2.2", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA=="], + "why-is-node-running": ["why-is-node-running@3.2.2", "", { "bin": { "why-is-node-running": "cli.js" } }, "sha512-NKUzAelcoCXhXL4dJzKIwXeR8iEVqsA0Lq6Vnd0UXvgaKbzVo4ZTHROF2Jidrv+SgxOQ03fMinnNhzZATxOD3A=="], "widest-line": ["widest-line@5.0.0", "", { "dependencies": { "string-width": "^7.0.0" } }, "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA=="], @@ -4389,8 +4387,6 @@ "opencode/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.30", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="], - "opencode/why-is-node-running": ["why-is-node-running@3.2.2", "", { "bin": { "why-is-node-running": "cli.js" } }, "sha512-NKUzAelcoCXhXL4dJzKIwXeR8iEVqsA0Lq6Vnd0UXvgaKbzVo4ZTHROF2Jidrv+SgxOQ03fMinnNhzZATxOD3A=="], - "opencontrol/@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.6.1", "", { "dependencies": { "content-type": "^1.0.5", "cors": "^2.8.5", "eventsource": "^3.0.2", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "pkce-challenge": "^4.1.0", "raw-body": "^3.0.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.24.1" } }, "sha512-oxzMzYCkZHMntzuyerehK3fV6A2Kwh5BD6CGEJSVDU2QNEhfLOptf2X7esQgaHZXHZY0oHmMsOtIDLP71UJXgA=="], "opencontrol/@tsconfig/bun": ["@tsconfig/bun@1.0.7", "", {}, "sha512-udGrGJBNQdXGVulehc1aWT73wkR9wdaGBtB6yL70RJsqwW/yJhIg6ZbRlPOfIUiFNrnBuYLBi9CSmMKfDC7dvA=="], diff --git a/packages/app/package.json b/packages/app/package.json index 87ca7931c55..8459172e7cf 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/app", - "version": "1.1.43", + "version": "1.1.45", "description": "", "type": "module", "exports": { diff --git a/packages/console/app/package.json b/packages/console/app/package.json index b10593a8fa5..84d45d3a7b1 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-app", - "version": "1.1.43", + "version": "1.1.45", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/console/core/package.json b/packages/console/core/package.json index 111390efbe7..38811d4de29 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", - "version": "1.1.43", + "version": "1.1.45", "private": true, "type": "module", "license": "MIT", diff --git a/packages/console/function/package.json b/packages/console/function/package.json index c26b4584ded..50acf1567c6 100644 --- a/packages/console/function/package.json +++ b/packages/console/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-function", - "version": "1.1.43", + "version": "1.1.45", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json index 564a7140cc1..902dd447bed 100644 --- a/packages/console/mail/package.json +++ b/packages/console/mail/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-mail", - "version": "1.1.43", + "version": "1.1.45", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index c1f330ce930..1b01f8a6f2b 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/desktop", "private": true, - "version": "1.1.43", + "version": "1.1.45", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/enterprise/package.json b/packages/enterprise/package.json index 03016c1c58f..2091e685749 100644 --- a/packages/enterprise/package.json +++ b/packages/enterprise/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/enterprise", - "version": "1.1.43", + "version": "1.1.45", "private": true, "type": "module", "license": "MIT", diff --git a/packages/extensions/zed/extension.toml b/packages/extensions/zed/extension.toml index eaa882b65bd..283036bf5b1 100644 --- a/packages/extensions/zed/extension.toml +++ b/packages/extensions/zed/extension.toml @@ -1,7 +1,7 @@ id = "opencode" name = "OpenCode" description = "The open source coding agent." -version = "1.1.43" +version = "1.1.45" schema_version = 1 authors = ["Anomaly"] repository = "https://github.com/anomalyco/opencode" @@ -11,26 +11,26 @@ name = "OpenCode" icon = "./icons/opencode.svg" [agent_servers.opencode.targets.darwin-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-darwin-arm64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-darwin-arm64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.darwin-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-darwin-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-darwin-x64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-linux-arm64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-linux-arm64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-linux-x64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-linux-x64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.windows-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-windows-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-windows-x64.zip" cmd = "./opencode.exe" args = ["acp"] diff --git a/packages/function/package.json b/packages/function/package.json index 4a9e82def5e..9746d11dccf 100644 --- a/packages/function/package.json +++ b/packages/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/function", - "version": "1.1.43", + "version": "1.1.45", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/opencode/package.json b/packages/opencode/package.json index bd77afa2e8c..ab28687d358 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.1.43", + "version": "1.1.45", "name": "opencode", "type": "module", "license": "MIT", diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 19077d786d6..9e9232a4da7 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/plugin", - "version": "1.1.43", + "version": "1.1.45", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index e929d628943..6b550512dea 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", - "version": "1.1.43", + "version": "1.1.45", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/slack/package.json b/packages/slack/package.json index decfd834a74..fbcccac399a 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/slack", - "version": "1.1.43", + "version": "1.1.45", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/ui/package.json b/packages/ui/package.json index 2e7a2cfefdf..5fde0960aca 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/ui", - "version": "1.1.43", + "version": "1.1.45", "type": "module", "license": "MIT", "exports": { diff --git a/packages/util/package.json b/packages/util/package.json index f76106701b2..9a3eb8f7d33 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/util", - "version": "1.1.43", + "version": "1.1.45", "private": true, "type": "module", "license": "MIT", diff --git a/packages/web/package.json b/packages/web/package.json index 0f601ba248f..06ab5ef4e95 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -2,7 +2,7 @@ "name": "@opencode-ai/web", "type": "module", "license": "MIT", - "version": "1.1.43", + "version": "1.1.45", "scripts": { "dev": "astro dev", "dev:remote": "VITE_API_URL=https://api.opencode.ai astro dev", diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json index 1ffe553c2cd..7c160a454fb 100644 --- a/sdks/vscode/package.json +++ b/sdks/vscode/package.json @@ -2,7 +2,7 @@ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", - "version": "1.1.43", + "version": "1.1.45", "publisher": "sst-dev", "repository": { "type": "git", From 00637c0269312455e55e4977a7a8f55c728e93bd Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 30 Jan 2026 00:56:47 -0600 Subject: [PATCH 5/5] fix: rm ai sdk middleware that was preventing blocks from being sent back as assistant message content (#11270) Co-authored-by: opencode-agent[bot] --- packages/opencode/src/session/llm.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/opencode/src/session/llm.ts b/packages/opencode/src/session/llm.ts index 4c4f4114a28..0c765210452 100644 --- a/packages/opencode/src/session/llm.ts +++ b/packages/opencode/src/session/llm.ts @@ -1,4 +1,3 @@ -import os from "os" import { Installation } from "@/installation" import { Provider } from "@/provider/provider" import { Log } from "@/util/log" @@ -9,7 +8,6 @@ import { type StreamTextResult, type Tool, type ToolSet, - extractReasoningMiddleware, tool, jsonSchema, } from "ai" @@ -261,7 +259,6 @@ export namespace LLM { return args.params }, }, - extractReasoningMiddleware({ tagName: "think", startWithReasoning: false }), ], }), experimental_telemetry: {