From 09923f654c016aa18028bf91d9f0cc153efa8c8b Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Wed, 17 Dec 2025 22:16:57 +0800 Subject: [PATCH] feat(antigravity): add streaming support for Claude model requests --- .../runtime/executor/antigravity_executor.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/internal/runtime/executor/antigravity_executor.go b/internal/runtime/executor/antigravity_executor.go index 9f61c91b..cd78a831 100644 --- a/internal/runtime/executor/antigravity_executor.go +++ b/internal/runtime/executor/antigravity_executor.go @@ -77,6 +77,25 @@ func (e *AntigravityExecutor) Execute(ctx context.Context, auth *cliproxyauth.Au auth = updatedAuth } + if strings.Contains(req.Model, "claude") { + stream, errExecuteStream := e.ExecuteStream(ctx, auth, req, opts) + if errExecuteStream != nil { + return resp, errExecuteStream + } + + var buffer bytes.Buffer + for chunk := range stream { + if chunk.Err != nil { + return resp, chunk.Err + } + if len(chunk.Payload) > 0 { + _, _ = buffer.Write(chunk.Payload) + } + } + resp = cliproxyexecutor.Response{Payload: buffer.Bytes()} + return resp, nil + } + reporter := newUsageReporter(ctx, e.Identifier(), req.Model, auth) defer reporter.trackFailure(ctx, &err)