Skip to content

Add native Responses API passthrough#1

Merged
werbenhu merged 2 commits into
werbenhu:masterfrom
dundunge:agent/add-responses-api
Jul 22, 2026
Merged

Add native Responses API passthrough#1
werbenhu merged 2 commits into
werbenhu:masterfrom
dundunge:agent/add-responses-api

Conversation

@dundunge

@dundunge dundunge commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What changed

  • expose native POST /v1/responses with JSON and SSE passthrough
  • preserve Responses request bodies verbatim, including data-URI images, tools, tool_choice, and structured function_call_output content
  • expose non-streaming POST /v1/responses/compact and forward it to the matching xAI upstream endpoint
  • validate Responses requests using model and input without changing existing Chat Completions or Anthropic Messages validation
  • bump the application, UI, and documented build version to v0.0.10
  • document the native Responses base URL and Windows x64 release artifact

Why

GrokProxy already uses the xAI Responses endpoint internally, but its public API only exposed Chat Completions and Anthropic Messages. Native Responses clients therefore had to pass through an external Responses-to-Chat bridge before reaching GrokProxy.

For multimodal tool results, that extra conversion can serialize structured image content into text. Large base64 image payloads are then counted as text tokens, causing extreme context growth and upstream disconnects. Direct Responses passthrough avoids that conversion and keeps the original multimodal structure intact.

The compact route is included so Codex-style clients can continue using automatic server-side context compaction through the same Responses-compatible base URL.

Validation

  • gofmt on all changed Go files
  • go vet ./...
  • go test -count=1 ./... with Go 1.24.13
  • pnpm typecheck and pnpm lint
  • Wails 2.12.0 production build for windows/amd64
  • focused coverage for JSON passthrough, SSE passthrough, data-URI images, structured image-bearing tool output, compact forwarding, request validation, and method handling

@werbenhu
werbenhu marked this pull request as ready for review July 22, 2026 06:51
@werbenhu
werbenhu merged commit 7480948 into werbenhu:master Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants