-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Is it a request payload issue?
- No, it's another issue.
Describe the bug
OpenCode session title generation fails when using Claude models through the Antigravity provider. Sessions show "New session - 2026-02-02T13:00:43.469Z" instead of descriptive titles like "Friendly greeting".
This affects only Claude models routed through CLIProxyAPI. Gemini and OpenAI models through the same proxy generate titles correctly.
Root Cause Analysis:
After investigating both OpenCode and CLIProxyAPI codebases, the issue appears related to:
- Recent refactor (commit
ac802a4) that removedselectInstructionsand OpenCode User-Agent handling - Streaming response translation for small/simple requests - the title agent sends a minimal streaming request that may not be properly translated back to Claude format
- The gzip fix in
code_handlers.go:176-195attempted to address this but doesn't fully resolve it
OpenCode's title generation flow:
packages/opencode/src/session/summary.ts:summarizeMessage()triggers the "title" agent- Uses
LLM.stream()with a small model (defaults to Claude Haiku or similar) - Request goes through CLIProxyAPI → Antigravity backend → response translation
- The translated response either returns empty or malformed, causing title generation to silently fail
CLI Type
Antigravity (Claude Code compatible)
Model Name
gemini-claude-opus-4-5-thinkinggemini-claude-sonnet-4-5-thinkinggemini-claude-sonnet-4-5
(Any Claude model routed through Antigravity provider)
LLM Client
OpenCode v1.1.48
Request Information
The title generation request is a simple streaming request to /v1/messages with:
- Small payload (just a text summarization prompt)
stream: true- Uses the "title" agent system prompt
The request originates from OpenCode's Vercel AI SDK integration hitting http://localhost:8317/v1/messages.
Expected behavior
Session titles should be generated and displayed (e.g., "Friendly greeting", "TypeScript math utility functions") instead of "New session - {timestamp}".
OS Type
- OS: Ubuntu 24.04.3 LTS (WSL2)
- Architecture: x64
Additional context
Workaround: Setting "small_model": "google/gemini-3-flash-preview" in OpenCode's opencode.json bypasses the issue by routing title generation requests directly to Google instead of through CLIProxyAPI.
Relevant CLIProxyAPI files to investigate:
sdk/api/handlers/claude/code_handlers.go-handleStreamingResponse()andhandleNonStreamingResponse()internal/runtime/executor/claude_executor.go-ExecuteStream()internal/translator/claude/gemini/claude_gemini_response.go- streaming response translation
The issue likely started after recent refactors to the translator layer. The fact that the gzip fix specifically mentions "title generation" suggests awareness of this issue area.