Skip to content

stream/resumable-turns: gaps blocking adoption by agent-runtime-based products #42

@drewstone

Description

@drewstone

Evidence from a full adoption evaluation in creative-agent (verdict: not adoptable today — the product has no hand-rolled buffer/replay for the module to replace, and the module can't tap the streams the product actually has):

  1. Event-vocabulary mismatch (silent no-op hazard): coalesceDeltas only recognizes tool-loop shapes ({type:'text'|'reasoning'} / {kind:'event'}). agent-runtime products stream ChatStreamEvent NDJSON ({type:'message.part.updated', data:{part, delta}}) — pumped through the buffer, every per-token delta persists as its own D1 row because the coalescer never fires. Needs a ChatStreamEvent coalescer or a pluggable coalesce seam.
  2. No seam into handleChatTurn: pumpBufferedTurn wants to own source iteration + the live write, but agent-runtime's handleChatTurn owns both and exposes only hooks.onEvent and a finished body. Needs either RunChatTurnInput accepting a TurnEventStore (runtime-side) or an event-tap mode on the pump that doesn't own the live write.
  3. No thread→running-turn discovery: the store is keyed by turnId only; a reloaded client (the main resume case — clientRunId lost on reload) can't find the in-flight turn to replay. Needs a listRunning(scopeId)-shaped query or a status row carrying the session/thread id.

Separately: resolveChatTurn turn-identity IS independently adoptable by these products (creative-agent approximates it with a user-turn count) — that's a small standalone adoption, not blocked by the above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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