0xPlaygrounds / 0xPlaygrounds/rig

feat(agent): emit a live tool-execution start item on the multi-turn stream

Aperta
#2,246 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
8.6k
Fork
959
Merge medio
4h 32m
PR unite (30g)
117

Descrizione

Child issue for #2118 Phase 1 (interactive run control / host
observability): the stream needs a live tool-lifecycle signal that today
only exists via hooks.

## Summary

The multi-turn stream has no live tool-execution signal.
`ToolExecutionCommitted` and `ToolResult` surface only after the whole tool
batch settles (deliberately — batch commit is atomic), so a streaming
consumer that wants to render "running tool X…" — a chat UI, an SSE bridge,
any progress surface — has to register an `on_tool_call` hook and re-merge
that side channel into its own stream, re-deriving correlation the stream
already carries.

Hooks remain the right place for *steering*; pure observers should get a
first-class stream item.

## Proposal

A new `MultiTurnStreamItem` variant emitted at each tool call's actual start
moment, one per dispatched call (not per batch), carrying the tool name and
the existing `internal_call_id` so the full start ⟷ commit ⟷ result
lifecycle correlates on ids consumers already track. The enum is
`#[non_exhaustive]`, so the addition is minor and non-breaking; every
existing item keeps its position and the atomic-after-settle batch commit is
unchanged.

## Acceptance criteria

- [ ] One start item per dispatched call, emitted live (observable while the
tool is still running), on both the sequential and
`tool_concurrency > 1` paths.
- [ ] Correlates with the model `ToolCall` item, `ToolExecutionCommitted`,
and `ToolResult` via `internal_call_id`.
- [ ] Emitted for MCP-backed tools the same as local tools.
- [ ] Ordering contract documented on the variant; existing event ordering
unchanged.
- [ ] Hook-skipped and never-dispatched (invalid-recovery) calls have
defined, documented behavior.

I have an implementation ready and will open a PR against this issue.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue is about adding a new MultiTurnStreamItem variant for tool-execution start signals. Start by examining the stream implementation in the codebase, likely in a module handling multi-turn streams or agent execution. Look for existing ToolExecutionCommitted and ToolResult items to understand the pattern. The work involves modifying the stream emission logic in both sequential and concurrent tool dispatch paths, ensuring correlation via internal_call_id, and updating documentation for ordering and edge cases like hook-skipped calls.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
ai-infra-agents, backend-api-design
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.