From 2f6b5ffda0299d8031ee748dc565a00edaec211f Mon Sep 17 00:00:00 2001 From: "CJACK." <155826701+CJackHwang@users.noreply.github.com> Date: Thu, 30 Apr 2026 02:22:17 +0800 Subject: [PATCH 1/2] Fix current-input token text test expectation --- internal/httpapi/openai/history_split_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/httpapi/openai/history_split_test.go b/internal/httpapi/openai/history_split_test.go index b792794..d429b9b 100644 --- a/internal/httpapi/openai/history_split_test.go +++ b/internal/httpapi/openai/history_split_test.go @@ -336,8 +336,8 @@ func TestApplyCurrentInputFilePreservesFullContextPromptForTokenCounting(t *test if !strings.Contains(out.PromptTokenText, "first user turn") || !strings.Contains(out.PromptTokenText, "latest user turn") { t.Fatalf("expected prompt token text to contain file context with full conversation, got %q", out.PromptTokenText) } - if !strings.Contains(out.PromptTokenText, "[file content end]") || !strings.Contains(out.PromptTokenText, "[file name]: IGNORE") { - t.Fatalf("expected prompt token text to include IGNORE.txt file wrapper, got %q", out.PromptTokenText) + if strings.Contains(out.PromptTokenText, "[file content end]") || strings.Contains(out.PromptTokenText, "[file name]:") { + t.Fatalf("expected prompt token text to use raw transcript without wrapper tags, got %q", out.PromptTokenText) } if !strings.Contains(out.PromptTokenText, "Answer the latest user request directly.") { t.Fatalf("expected prompt token text to also include neutral live prompt, got %q", out.PromptTokenText) From 966f21211d59e372dfd4d393531ef7d3c00a2492 Mon Sep 17 00:00:00 2001 From: "CJACK." <155826701+CJackHwang@users.noreply.github.com> Date: Thu, 30 Apr 2026 02:31:06 +0800 Subject: [PATCH 2/2] Fix nil-session guard in chat history test --- internal/httpapi/openai/chat/chat_history_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/httpapi/openai/chat/chat_history_test.go b/internal/httpapi/openai/chat/chat_history_test.go index 3ed8fed..2201f0f 100644 --- a/internal/httpapi/openai/chat/chat_history_test.go +++ b/internal/httpapi/openai/chat/chat_history_test.go @@ -126,6 +126,7 @@ func TestStartChatHistoryRecoversFromTransientWriteFailure(t *testing.T) { session := startChatHistory(historyStore, req, a, stdReq) if session == nil { t.Fatalf("expected session even when initial persistence fails") + return } if session.disabled { t.Fatalf("expected session to remain active after transient start failure")