Skip to content

Claude agent: complete each tool call when its tool_result arrives, not in bulk at end of turn #1837

Description

@atsushi-ishibashi

Problem

With the 0.1.x adapter (@rivet-dev/agent-os-claude), SDK user messages carrying tool_result blocks were ignored; active tool calls were only completed in bulk at the end of the turn. For a client rendering tool-call cards this looks wrong for both sequential and parallel tool use: a tool that finished in 1s stays "running" for the whole turn (which can be minutes), users cannot tell which tool is actually in flight, and every call then flips running → completed at the same instant.

Request

  • Each tool call should transition to completed/failed as soon as its tool_result arrives (is_error mapped to failed), with end-of-turn bulk completion kept only as a fallback for leftovers.
  • Please confirm the packaged Claude agent on current main behaves this way; if it still completes in bulk, please fix it.
  • A regression test with two tool calls finishing at different times would lock the behavior in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions