Skip to content

Show tool calls after an answered question below it - #2294

Draft
fazxes wants to merge 7 commits into
mainfrom
fazxes/end-tool-group-at-question
Draft

fazxes wants to merge 7 commits into
mainfrom
fazxes/end-tool-group-at-question

Conversation

@fazxes

@fazxes fazxes commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • After you answer a question the agent asked, its next tool calls now show in a new row below the answered question. Before, they joined the row above the question and pushed the question down, until the model wrote some text. The live screen now matches what --resume already showed.
  • A step that calls ask_user_question, in a reply whose calls run, now closes the open tool presentation group in core (transitionPresentationGroup takes a new asked_question field). Calls in that same step keep the open group, so a call made before the question stays in the row above it.
  • A question that never shows ends nothing. When a reply hits the output limit, fx drops its calls and asks again, or blocks them, so the calls after the resend stay in the open group, as they do after --resume.

On main, the live screen and --resume last disagree (fake gateway, 120 columns: read first.txt, ask, answer, read second.txt, read third.txt, reply):

main, live                                main, after --resume last
● Read first.txt, second.txt, third.txt   ● Read first.txt
  1) Choose next step?                      1) Choose next step?
     Run tests                                 Run tests
  Done after the question.                ● Read second.txt, third.txt
                                            Done after the question.

This branch draws the resumed rows live too:

this branch, live and after --resume last
● Read first.txt
  1) Choose next step?
     Run tests
● Read second.txt, third.txt
  Done after the question.

A read in the same step before the question ([read second.txt, ask]):

main, live                                main after --resume, and this branch live and after --resume
● Read first.txt, second.txt, third.txt   ● Read first.txt, second.txt
  1) Choose next step?                      1) Choose next step?
     Run tests                                 Run tests
  Done after the question.                ● Read third.txt
                                            Done after the question.

The test with prose before the next calls passes on main too. It guards the case that was already right.

Not changed

  • A question run through the toolbox setting (tool_placement.ask_user_question set to toolbox) still leaves the group open, and a resumed one shows as an ● Asked row instead of the answered question. This needs its own change: the transcript reads the toolbox call as a write in more than one place.

    live                                      after --resume last
    ● Read first.txt, second.txt, third.txt   ● Read first.txt
      1) Choose next step?                    ● Asked
         Run tests                            ● Read second.txt, third.txt
      Done after the question.                  Done after the question.
    
  • A call that comes after the question in the same step ([ask, read second.txt]) still joins the row above the question live, while --resume shows it below:

    this branch, live                after --resume
    ● Read first.txt, second.txt     ● Read first.txt
      1) Choose next step?             1) Choose next step?
         Run tests                        Run tests
    ● Read third.txt                 ● Read second.txt, third.txt
      Done after the question.         Done after the question.
    

    On main the same step drew all three reads above the question. Splitting the step by call order was left out on purpose: a streamed call's row is placed while the step streams, before the question box exists, so it draws above the box whatever group it gets, and a step has one group id, so [read, ask, read] could not split either.

  • Mid-turn notices, such as the compaction row, can sit inside an open group the same way. This change leaves them as they are.

  • A question whose arguments cannot be read still counts as asking, so the calls after it start a new row. After --resume, a ● Failed row shows between the two rows; the live screen does not show it, on main either.

  • The Ctrl+O transcript, ACP, fx ask, and what the model receives stay the same. The group id only shapes the compact transcript and is never saved.

Check findings

The change check against the merge base 4ffe87716 reports seven findings.

  • model-covered for src/core/agent/runtime/orchestrator.zig, once each for tests/tla/agent_runtime/, tests/tla/auth/, tests/tla/saved_turn/, tests/tla/subagent/ and tests/tla/toolbox/. These models describe the empty-reply nudge and malformed call feedback, the 401 login refresh, the order of a turn's saved messages, steering into subagents, and the toolbox catalog. The change only picks which presentation group id a step's tool rows carry, from the step's own calls and whether its reply ran them. It sends, saves, retries, and runs the same things as before, so none of the modeled behavior changes (R7.2). No model in tests/tla/ describes presentation groups.
  • fuzz-reached for request_wrapper_text (direct, through orchestrator.zig). A 60 second round, python3 -m scripts.fuzz_nightly run --target request_wrapper_text --budget-seconds 60, exited 0 with "status": "ok" after 1,171 unique runs.
  • fuzz-reached for session_title (related, through tool_presentation.zig). A 60 second round on it also exited 0 with "status": "ok", after 567 unique runs.

A step that calls ask_user_question now closes the open tool
presentation group, so the calls after the answer start a new group and
their row draws below the answered question. Before, they joined the
group from before the question, whose row draws at its first call, and
pushed the answered question down until the model wrote some text. A
resumed session already drew them below the question.

Calls in the step that asks keep the open group, so a call made before
the question stays in the row above it.
@fazxes fazxes added the type: bug Fixes incorrect behavior label Nov 25, 2026
A reply that hits the output limit never runs its calls: fx drops them
and asks again, or blocks them. Its ask_user_question call no longer
closes the open presentation group, since no question shows, so the
calls after a resend stay in that group, as they do after a resume.
With tool_placement.ask_user_question set to toolbox, the model asks
through a toolbox run, which reads as a write, so the step never
counted as asking and the calls after the answer still joined the row
above the question. The step now looks at the call a toolbox run
carries, as the transcript's rows already do.
…olbox

Each case checks the rows live and after a resume: two questions in
one turn, calls that stream in after the answer, and a question asked
through toolbox, whose resumed question shows as an Asked row.
This reverts commit b546fd74cc6cd4fe6cb5a66f6a5e2b06c3203fa3.

A question run through toolbox needs more than the step's ask check:
the transcript still reads the toolbox call as a write, and a resumed
toolbox question draws as an Asked row. That case moves to its own
change.
The toolbox placement of ask_user_question moves to its own change, so
its test and the settings and resumed-rows options only it used go too.
The tests for two questions in one turn and for streamed calls after the
answer stay.
@fazxes fazxes closed this Nov 25, 2026
@fazxes fazxes reopened this Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Fixes incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant