Skip to content

bug(responses): initialize reasoning summary lifecycle for Anthropic streams #102

Description

@chrisnestrud

Summary

Codex Responses clients can report ReasoningSummaryPartAdded/Delta without active item when an Anthropic-compatible provider streams thinking before a tool call.

Root cause

The Responses stream emitted reasoning summary deltas without a complete active-item setup, and the Anthropic stream conversion omitted the response ID from CoreEventCreated. In addition, signature_delta was swallowed by the generic thinking-block path, so continuation requests lost the provider signature.

Fix

  • Emit an initial summary_text reasoning part and complete reasoning item lifecycle events.
  • Preserve the Anthropic message ID in CoreEventCreated.
  • Process signature_delta before generic thinking deltas.
  • Add a mocked E2E stream/replay test: Anthropic thinking + tool use → Responses output → Anthropic tool-result continuation.

Validation

CGO_ENABLED=0 go test -p 1 ./...
go test -tags=e2e ./internal/e2e -run "^TestOpenAIResponseAnthropicE2E_ReasoningToolReplay$"

Related

Split from #63, which also tracks the separate apply_patch proxy-mapping problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions