You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Esc abort of task tool still loses task_id on v1.18.21 — v1.18.20 fix incomplete #44791
After the fix in v1.18.20 ("Surface failed subagent tool calls with a resumable task_id"), cancelling a task sub-agent with Esc still returns only Task cancelled / Tool execution aborted with no task_id. The child session is preserved in DB but parent has no handle to resume.
Repro on 1.18.21 (includes v1.18.20):
Primary dispatches sub-agent via task tool (e.g. "Write 200 line story, numbered 1..200")
Wait ~15s (well past session creation, TUI shows sub-agent running)
Press Esc once (TUI shows "esc again to interrupt")
Parent receives generic Task cancelled — no task_id: ses_... line
Child session DOES exist in DB with MessageAbortedError: Aborted (verified via opencode db "select id from session order by time_created desc"), e.g. ses_fca2e2e1fffew5cAkpmn6IgDgJ and ses_fca376712ffe8yo4PsY76GyGSW — but LLM cannot reference it.
Expected (per #13910):
task_id: ses_... (sub-agent session preserved — reuse to retry/inspect)
<task_error>Tool execution aborted</task_error>
and resume via task(task_id="ses_...").
Evidence:
Parent ses_fca390730ffeUxcxDUwJB9mr5J last messages have finish:"tool-calls" but no task_result with task_id
Child sessions: ses_fca376712ffe8yo4PsY76GyGSW (1787608733965) and ses_fca2e2e1fffew5cAkpmn6IgDgJ (1787609338370) both MessageAbortedError: Aborted, 0 tokens
v1.18.20 changelog lists "Surface failed subagent tool calls with a resumable task_id" — Esc path still empty
Suspected root cause:v1.18.20 fix wraps sub-agent internal failures inside tool/task.tsSessionPrompt.prompt() try/catch, but user Esc aborts the parent SessionPrompt.loop()AbortController outside that catch — all pending tools marked error("Tool execution aborted") before wrapper can return session.id. Same as #13910 lines 128-162, abort path not covered.
Suggested fix: ensure session.id is returned even on parent abort, and TUI renders task_id on aborted Task parts (cf. #24756).
Plugins
No response
OpenCode version
1.18.21
Steps to reproduce
opencode with any model, send prompt that triggers task tool (e.g. "Explore codebase and write 200 lines story")
While sub-agent running, press Esc after 15s
Observe parent receives "Task cancelled" with no task_id; check opencode db — child session exists but is unreachable
If your issue is specifically that the v1.18.20 fix did not cover the Esc/parent-abort path, it may be worth linking to or reopening #13910 rather than filing separately.
Activity
github-actions commentedon Aug 24, 2026
This issue might be a duplicate of or closely related to existing issues. Please check:
If your issue is specifically that the v1.18.20 fix did not cover the Esc/parent-abort path, it may be worth linking to or reopening #13910 rather than filing separately.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊