Skip to content

feat(runtime): relay live executor output through streamAgentTurn #762

Description

@drewstone

Reproduction

Run any public executor through streamAgentTurn in @tangle-network/agent-runtime@0.131.0.
The executor's execute() returns an async iterable and emits usage while the underlying CLI Bridge or environment provider emits text and tool activity.

streamAgentTurn drains that iterable without yielding content:

if (isAsyncIterable(run)) {
  for await (const _usage of run) throwIfAborted(signal)
  result = executor.resultArtifact()
}

It then yields only llm_call, result-level tool calls, artifact, and final after execution settles.

Actual behavior

  • CLI Bridge receives SSE text and tool events internally, but consumers see no text_delta, reasoning_delta, tool_result, or live tool activity.
  • Provider executors collect AgentEnvironmentEvent[] internally, but consumers cannot observe them during the run.
  • A terminal application cannot show the harness output while it is running.

Expected behavior

streamAgentTurn should project executor progress into RuntimeStreamEvent incrementally.
The shared executor progress type needs a lossless Runtime-owned event form for text, reasoning, tool calls/results, interactions, and provider events.
Usage events must continue through the existing accounting path.

This is a regression from the former chat and box paths, which emitted live normalized events.
It blocks Braid from rendering current CLI Bridge and Tangle sandbox activity without duplicating Runtime's parsers.

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