Skip to content

[DOCS] Document message/stream SSE event sequence for the TypeScript ADK #65

Closed

Description

@claude

Summary

The TypeScript ADK (@inference-gateway/adk) now implements the A2A message/stream JSON-RPC method via inference-gateway/typescript-adk#71 (closes inference-gateway/typescript-adk#16). The response is text/event-stream carrying CloudEvents v1.0 envelopes; the exact frame sequence is documented in README.md of inference-gateway/typescript-adk.

The public documentation site should mirror this contract so client implementers (browsers, other-language SDKs, gateway tooling) can build against the same wire format that the Go ADK and TypeScript ADK both expose.

Surface to cover

  • Event sequence: task.status.changed (WORKING) -> agent.delta (0..N) -> optional periodic task.status.changed heartbeat while IN_PROGRESS -> terminal task.status.changed (final=true) with state in {COMPLETED, FAILED, CANCELLED, INPUT_REQUIRED}.
  • STREAMING_STATUS_UPDATE_INTERVAL env var: default 1s, accepts Ns / Nms / Nm durations (e.g. 500ms, 250, 30s). Set to 0 to disable the periodic heartbeat.
  • Cancellation semantics on client disconnect: the executor receives an AbortSignal, the task is persisted as CANCELLED, and a final task.status.changed frame is emitted before the stream closes.
  • CloudEvents v1.0 envelope shape: subject = taskId, type drawn from AGENT_EVENT_TYPE.*, data is either a TaskStatusUpdateEvent or a Message.
  • Streaming capability advertised by the agent card via capabilities.streaming = true.
  • JSON-RPC error mapping for invalid params (-32602) returned synchronously as a regular JSON response, with no SSE stream opened.

Acceptance Criteria

  • Page documenting the message/stream SSE event sequence, covering all six surface points above.
  • Minimal client sample showing how to consume the stream (JS/TS fetch + an SSE parser), including handling of the terminal final=true frame.
  • Cross-reference from any existing message/send page to the streaming variant.
  • STREAMING_STATUS_UPDATE_INTERVAL documented in the configuration / env-var reference.
  • Note that the TypeScript ADK and the Go ADK expose the same wire format (single source of truth for client implementers).

References

Activity

  1. edenreich commented on May 27, 2026

    @edenreich
    Contributor

    @claude Can you document it? use /maintainer

  2. added
    documentation
    on May 27, 2026
  3. added theissue type on May 27, 2026
  4. claude commented on May 27, 2026

    @claude
    ContributorAuthor

    Claude finished @edenreich's task in 11m 32s —— View job • claude/issue-65-20260527-0045 • Create PR ➔


    Documenting TypeScript ADK message/stream SSE event sequence

    Todo

    • Read repo structure (sidebar, existing ADK / a2a / configuration pages)
    • Fetch authoritative wire-format reference from inference-gateway/typescript-adk (src/server/message-stream.ts, cloudevents.ts, sse.ts, conformance tests, server registration)
    • Cross-check Go ADK precedent (event types match AGENT_EVENT_TYPE.*, same source constant, same env-var name)
    • Add new ## The message/stream JSON-RPC method section to typescript-adk.md covering agent-card capability, registration, executor contract, handler options, event sequence, CloudEvents envelope, STREAMING_STATUS_UPDATE_INTERVAL, cancellation, JSON-RPC error mapping
    • Minimal fetch + SSE parser client sample with terminal final=true (and INPUT_REQUIRED final=false) handling
    • Cross-link from existing message/send section; mark createMessageStreamHandler as Available in the "What ships today" table; update page frontmatter description
    • Add streaming-parity bullets to "Parity with the Go ADK"
    • Lint (npm run lint:md), format (npm run format:check), build (npm run build) all pass
    • Commit pushed to branch claude/issue-65-20260527-0045 (commit ed5f9d8)

    Summary

    Single-file change: extended typescript-adk.md with a ~250-line ## The message/stream JSON-RPC method section. Wire format (CloudEvents v1.0 envelopes, subject = taskId, type from AGENT_EVENT_TYPE.{DELTA, TASK_STATUS_CHANGED}) and configuration (STREAMING_STATUS_UPDATE_INTERVAL, default 1s, accepts ms/s/m, 0 disables) are documented as the single source of truth shared with the Go ADK. Cancellation, validation, and the INPUT_REQUIRED stream-closing edge case are all spelled out for client implementers.

    One nuance worth flagging for review: the implementation emits INPUT_REQUIRED with final: false (the task is paused, not done) but the stream still closes - documented as a distinct bullet so clients know to treat it as a terminal frame for stream-lifecycle purposes even though final is false.

    PR

    | Branch: claude/issue-65-20260527-0045

  5. added a commit that references this issue on May 27, 2026
    ed5f9d8
  6. moved this from Todo to In progress in 2026on May 27, 2026
  7. added a commit that references this issue on May 27, 2026
    c7e6c76
  8. moved this from In progress to Done in 2026on May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions