From b7241a37399b71938ad8e3e343dcd29fcaf10ca3 Mon Sep 17 00:00:00 2001 From: rabesss <26330469+rabesss@users.noreply.github.com> Date: Sun, 5 Jul 2026 13:59:08 +0530 Subject: [PATCH 1/3] docs: add Kilo review guidance --- REVIEW.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 REVIEW.md diff --git a/REVIEW.md b/REVIEW.md new file mode 100644 index 00000000000..f72a7af8935 --- /dev/null +++ b/REVIEW.md @@ -0,0 +1,23 @@ +# REVIEW.md + +## Review Contract +- Review only issues introduced by the current pull request unless a changed line exposes an existing critical risk. +- Prioritize correctness, security, data integrity, auth, destructive operations, and user-visible regressions. +- Keep comments actionable: name the failing behavior, the affected path, and the smallest credible fix. +- Do not flag formatting-only issues, dependency freshness, or broad refactors when existing tooling or maintainers already own them. + +## Severity Calibration +- Critical: data loss, privilege escalation, token or secret exposure, billing mistakes, broken authentication, destructive operations without safeguards. +- Warning: missing validation, unsafe defaults, untested edge cases, concurrency/race risks, resource leaks, misleading errors. +- Nit: avoid unless the issue materially affects maintainability or repeated review history says this repo needs attention there. + +## Verification Expectations +- Business logic changes need tests that assert observable behavior. +- Security-sensitive changes need negative tests or clear manual verification notes. +- CLI/API changes should preserve backward compatibility unless the PR explicitly documents a breaking change. +- Generated files, snapshots, and lockfiles should only be reviewed when they are the actual source of risk. + +## Agent-Maintained Review Memory +Agents that open or update PRs in this repository must keep this section current when review history shows a repeated pattern. Add dated bullets only for durable repo-specific lessons, not one-off PR commentary. + +- No recurring repo-specific review patterns have been recorded yet. From 00e5cced31d4f33494908db98105c9ea98117c71 Mon Sep 17 00:00:00 2001 From: rabesss <26330469+rabesss@users.noreply.github.com> Date: Sun, 5 Jul 2026 14:23:48 +0530 Subject: [PATCH 2/3] docs: remove Kilo review guidance --- REVIEW.md | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 REVIEW.md diff --git a/REVIEW.md b/REVIEW.md deleted file mode 100644 index f72a7af8935..00000000000 --- a/REVIEW.md +++ /dev/null @@ -1,23 +0,0 @@ -# REVIEW.md - -## Review Contract -- Review only issues introduced by the current pull request unless a changed line exposes an existing critical risk. -- Prioritize correctness, security, data integrity, auth, destructive operations, and user-visible regressions. -- Keep comments actionable: name the failing behavior, the affected path, and the smallest credible fix. -- Do not flag formatting-only issues, dependency freshness, or broad refactors when existing tooling or maintainers already own them. - -## Severity Calibration -- Critical: data loss, privilege escalation, token or secret exposure, billing mistakes, broken authentication, destructive operations without safeguards. -- Warning: missing validation, unsafe defaults, untested edge cases, concurrency/race risks, resource leaks, misleading errors. -- Nit: avoid unless the issue materially affects maintainability or repeated review history says this repo needs attention there. - -## Verification Expectations -- Business logic changes need tests that assert observable behavior. -- Security-sensitive changes need negative tests or clear manual verification notes. -- CLI/API changes should preserve backward compatibility unless the PR explicitly documents a breaking change. -- Generated files, snapshots, and lockfiles should only be reviewed when they are the actual source of risk. - -## Agent-Maintained Review Memory -Agents that open or update PRs in this repository must keep this section current when review history shows a repeated pattern. Add dated bullets only for durable repo-specific lessons, not one-off PR commentary. - -- No recurring repo-specific review patterns have been recorded yet. From 47af0c5345232ac03de215f76852435426c9b45e Mon Sep 17 00:00:00 2001 From: rabesss <26330469+rabesss@users.noreply.github.com> Date: Wed, 8 Jul 2026 23:21:05 +0530 Subject: [PATCH 3/3] Normalize compact stream flag --- .../openai/openai_responses_compact_test.go | 25 ++++++++++++++----- .../openai/openai_responses_handlers.go | 9 ------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/sdk/api/handlers/openai/openai_responses_compact_test.go b/sdk/api/handlers/openai/openai_responses_compact_test.go index 48b7e3bbdee..3014625eeba 100644 --- a/sdk/api/handlers/openai/openai_responses_compact_test.go +++ b/sdk/api/handlers/openai/openai_responses_compact_test.go @@ -2,6 +2,7 @@ package openai import ( "context" + "encoding/json" "errors" "net/http" "net/http/httptest" @@ -20,6 +21,7 @@ type compactCaptureExecutor struct { alt string sourceFormat string calls int + payload []byte } func (e *compactCaptureExecutor) Identifier() string { return "test-provider" } @@ -28,6 +30,7 @@ func (e *compactCaptureExecutor) Execute(ctx context.Context, auth *coreauth.Aut e.calls++ e.alt = opts.Alt e.sourceFormat = opts.SourceFormat.String() + e.payload = append(e.payload[:0], req.Payload...) return coreexecutor.Response{Payload: []byte(`{"ok":true}`)}, nil } @@ -47,7 +50,7 @@ func (e *compactCaptureExecutor) HttpRequest(context.Context, *coreauth.Auth, *h return nil, errors.New("not implemented") } -func TestOpenAIResponsesCompactRejectsStream(t *testing.T) { +func TestOpenAIResponsesCompactNormalizesStream(t *testing.T) { gin.SetMode(gin.TestMode) executor := &compactCaptureExecutor{} manager := coreauth.NewManager(nil, nil, nil) @@ -67,16 +70,26 @@ func TestOpenAIResponsesCompactRejectsStream(t *testing.T) { router := gin.New() router.POST("/v1/responses/compact", h.Compact) - req := httptest.NewRequest(http.MethodPost, "/v1/responses/compact", strings.NewReader(`{"model":"test-model","stream":true}`)) + req := httptest.NewRequest(http.MethodPost, "/v1/responses/compact", strings.NewReader(`{"model":"test-model","input":"hello","stream":true}`)) req.Header.Set("Content-Type", "application/json") resp := httptest.NewRecorder() router.ServeHTTP(resp, req) - if resp.Code != http.StatusBadRequest { - t.Fatalf("status = %d, want %d", resp.Code, http.StatusBadRequest) + if resp.Code != http.StatusOK { + t.Fatalf("status = %d, want %d", resp.Code, http.StatusOK) + } + if executor.calls != 1 { + t.Fatalf("executor calls = %d, want 1", executor.calls) + } + var payload map[string]any + if err := json.Unmarshal(executor.payload, &payload); err != nil { + t.Fatalf("payload JSON: %v", err) } - if executor.calls != 0 { - t.Fatalf("executor calls = %d, want 0", executor.calls) + if _, ok := payload["stream"]; ok { + t.Fatalf("payload still includes stream: %s", string(executor.payload)) + } + if executor.alt != "responses/compact" { + t.Fatalf("alt = %q, want %q", executor.alt, "responses/compact") } } diff --git a/sdk/api/handlers/openai/openai_responses_handlers.go b/sdk/api/handlers/openai/openai_responses_handlers.go index 5b2c006a302..3216e1e597f 100644 --- a/sdk/api/handlers/openai/openai_responses_handlers.go +++ b/sdk/api/handlers/openai/openai_responses_handlers.go @@ -405,15 +405,6 @@ func (h *OpenAIResponsesAPIHandler) Compact(c *gin.Context) { } streamResult := gjson.GetBytes(rawJSON, "stream") - if streamResult.Type == gjson.True { - c.JSON(http.StatusBadRequest, handlers.ErrorResponse{ - Error: handlers.ErrorDetail{ - Message: "Streaming not supported for compact responses", - Type: "invalid_request_error", - }, - }) - return - } if streamResult.Exists() { if updated, err := sjson.DeleteBytes(rawJSON, "stream"); err == nil { rawJSON = updated