Skip to content

v2: make durable terminal tool-input events self-contained #35638

Description

@kitlangton

Problem

The V2 tool-input lifecycle splits the tool name from later durable facts:

session.tool.input.started { assistantMessageID, callID, name }
session.tool.input.ended   { assistantMessageID, callID, text }
session.tool.called        { assistantMessageID, callID, input, executed, state? }

This is compact, but awkward for durable cursor consumers. If a projection has already checkpointed input.started and resumes at input.ended or tool.called, it cannot attribute the completed raw or parsed input to a tool without replaying backward, retaining extra state across restarts, or querying the projected Session message.

The information is technically redundant, but the terminal durable events are intended to be replayable full-value boundaries.

Proposed contract

Repeat name on durable terminal snapshots while keeping ephemeral deltas contextual:

session.tool.input.started { assistantMessageID, callID, name }
session.tool.input.delta   { assistantMessageID, callID, delta } // ephemeral
session.tool.input.ended   { assistantMessageID, callID, name, text }
session.tool.called        { assistantMessageID, callID, name, input, executed, state? }

executed and state remain on session.tool.called; this proposal only restores the missing tool identity.

Why

  • A durable terminal fact can be interpreted independently.
  • Cursor recovery does not depend on replaying earlier events.
  • Downstream projections remain stateless and replay-safe.
  • The storage cost is one repeated short string on two durable events.

The intended distinction is: streaming deltas may require context, while durable completed-value events should carry enough identity to stand alone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gang-grillDesign topics queued for later group grilling

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions