`ai-opencode`: `RUN_FINISHED` never arrives when an adapter teardown step does not settle
Maintainer thường phản hồi trong vòng 1 ngày
@tombeckenham đang làm issue này rồi.
Từ ngày 6/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
chat() holds RUN_FINISHED until the adapter's chatStream generator returns. In @tanstack/ai-opencode 0.4.14, the finally block of OpencodeTextAdapter.chatStream awaits handle.dispose(), server.dispose(), and bridge.close() in sequence. If one of them does not settle, the text streams but the run never ends, and the HTTP response stays open.
Repro
- Run
chat()withopencodeText(...),withSandbox(...), and at least one tool, so that a tool bridge opens. - Wrap the sandbox provider so that
process.kill()on a spawned process returns a promise that never settles (as a sandbox API call that never returns does). Or use anopencodeonPATHthat ignoresSIGTERMand keeps a request open on the tool bridge. - Observe:
TEXT_MESSAGE_ENDarrives, butRUN_FINISHEDdoes not.
Proposed fix
Give each teardown step a time limit, and log a step that fails:
const bounded = (step) => Promise.race([
Promise.resolve().then(step).catch((error) => logger.errors("opencode teardown failed", { error, source: "opencode.chatStream" })),
new Promise((resolve) => setTimeout(resolve, 1000).unref()),
])
await bounded(() => handle?.dispose())
await bounded(() => server?.dispose())
await bounded(() => bridge?.close())
Suggestion (separate, @tanstack/ai-sandbox-local-process)
spawn uses detached: true, so a spawned process group gets no signal when its owner process dies, and the server continues to run with parent 1. One option: start one watchdog per owner with a stdin pipe that only the owner holds, register each spawned group with it, and kill the registered groups when the pipe closes.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.2k
- Fork
- 361
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 210
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/ai
-
summarize() sends temperature 0.3 to models that reject sampling parameters (e.g. claude-sonnet-5-5)Có thể đã có người làm @jherr đã nhận 2 ngày trước. Đang mởhas-pr waiting-on: maintainer
TanStack/ai#1703 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-openrouter: malformed Chat Completions tool arguments execute as an empty objectCó thể đã có người làm @tombeckenham đã nhận 3 ngày trước. Đang mởhas-pr waiting-on: maintainer
TanStack/ai#1689 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
StreamProcessor discards metadata from REASONING_MESSAGE_STARTCó thể đã có người làm @tombeckenham đã nhận 3 ngày trước. Đang mởwaiting-on: maintainer
TanStack/ai#1667 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Async persistence restored before attach() never rejoins an in-flight runCó thể đã có người làm @tombeckenham đã nhận 6 ngày trước. Đang mởhas-pr waiting-on: maintainer
TanStack/ai#1639 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-mcp: support publishing MCP list changes to subscribed clientsCó thể đã có người làm @jherr đã nhận 6 ngày trước. Đang mởwaiting-on: maintainer
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
TanStack/ai#1631 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-task risk:low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
guyellis/http-status-check#512 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/playwright#43327 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/TypeScript#64758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
opensearch-project/OpenSearch-Dashboards#12937 ·
Maintainer thường phản hồi trong vòng 2 ngày