anomalyco / anomalyco/opencode

[Bug] Missing type:text when assistant returns text + question tool in same step

Open
#49,708 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

Problem:
Assistant sends text + question tool in one turn, but the log shows only the tool. The text part is lost.

Repro:

  1. User sends: {"type":"text","text":"request content"}
  2. Assistant sends commentary "This is demo text." plus question tool call
  3. Check data log order

Expected order (5 parts in 1 step):

  1. {"snapshot":"8f0572e1091e38e15b43080be8e09aa4315a0f15","type":"step-start"}
  2. {"type":"reasoning","text":""}
  3. {"type":"text","text":"This is demo text."}
  4. {"type":"tool","tool":"question","callID":"call_01a0b2d02cd470e28145337ec5d13635","state":{"status":"running"}}
  5. {"reason":"tool-calls","snapshot":"8f0572e1091e38e15b43080be8e09aa4315a0f15","type":"step-finish"}

Actual order (text missing):

  1. {"snapshot":"8f0572e1091e38e15b43080be8e09aa4315a0f15","type":"step-start"}
  2. {"type":"reasoning","text":""}
  3. {"type":"tool","tool":"question","callID":"call_01a0b3076e37574b4a315fa42a639a2","state":{"status":"running"}}
    -> Step 3 should be type:text, but it is missing.
Plugins

No response

OpenCode version

OpenCode Desktop v1.18.31

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by reproducing the assistant step with commentary text and a question tool call, then trace the event/log assembly for that step; done means the five expected parts appear in order, including the type:text part before the tool event.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.