Skip to content

Commit a53f89b

Browse files
committed
refactor: remove broken ask tool in favor of askquestion
The ask tool used Bus events that never reached the tool's subscription due to Instance.state scoping issues. The askquestion tool (upstream PR anomalyco#5958) uses HTTP endpoints and works correctly. Removed: - ask tool registration and implementation - Question namespace schemas - DialogQuestion UI components - TuiEvent.QuestionRequest/Response event types - ask.test.ts tests Updated plan.txt to reference askquestion instead of ask.
1 parent db7997b commit a53f89b

14 files changed

Lines changed: 1 addition & 1717 deletions

File tree

packages/opencode/src/cli/cmd/tui/app.tsx

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ import { ToastProvider, useToast } from "./ui/toast"
3131
import { ExitProvider, useExit } from "./context/exit"
3232
import { Session as SessionApi } from "@/session"
3333
import { TuiEvent } from "./event"
34-
import { DialogQuestion } from "@tui/component/dialog-question"
35-
import type { Question } from "@/question"
3634
import { KVProvider, useKV } from "./context/kv"
3735
import { Provider } from "@/provider/provider"
3836
import { ArgsProvider, useArgs, type Args } from "./context/args"
@@ -547,55 +545,6 @@ function App() {
547545
})
548546
})
549547

550-
// Handle question requests from the Ask tool
551-
sdk.event.on(TuiEvent.QuestionRequest.type as any, (evt: any) => {
552-
const request = evt.properties as Question.Request
553-
dialog.replace(
554-
() => (
555-
<DialogQuestion
556-
request={request}
557-
onSubmit={(answers) => {
558-
sdk.client.tui.publish({
559-
body: {
560-
type: TuiEvent.QuestionResponse.type,
561-
properties: {
562-
questionID: request.questionID,
563-
status: "ok",
564-
answers,
565-
},
566-
},
567-
} as any)
568-
}}
569-
onCancel={() => {
570-
sdk.client.tui.publish({
571-
body: {
572-
type: TuiEvent.QuestionResponse.type,
573-
properties: {
574-
questionID: request.questionID,
575-
status: "cancel",
576-
answers: [],
577-
},
578-
},
579-
} as any)
580-
}}
581-
/>
582-
),
583-
() => {
584-
// On escape/close, send cancel response
585-
sdk.client.tui.publish({
586-
body: {
587-
type: TuiEvent.QuestionResponse.type,
588-
properties: {
589-
questionID: request.questionID,
590-
status: "cancel",
591-
answers: [],
592-
},
593-
},
594-
} as any)
595-
},
596-
)
597-
})
598-
599548
sdk.event.on(SessionApi.Event.Deleted.type, (evt) => {
600549
if (route.data.type === "session" && route.data.sessionID === evt.properties.info.id) {
601550
route.navigate({ type: "home" })

packages/opencode/src/cli/cmd/tui/component/dialog-question/dialog-question-confirm.tsx

Lines changed: 0 additions & 61 deletions
This file was deleted.

packages/opencode/src/cli/cmd/tui/component/dialog-question/dialog-question-multi-select.tsx

Lines changed: 0 additions & 203 deletions
This file was deleted.

0 commit comments

Comments
 (0)