From 1b60509aac014370e7759c73d277f4fb48965e15 Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Wed, 30 Jul 2025 10:13:21 -0700 Subject: [PATCH] chore: Start summarizing at 80k tok instead of 100k (#604) * chore: Start summarizing at 80k tok instead of 100k * cr --- apps/open-swe/src/__tests__/tokens.test.ts | 7 ------- apps/open-swe/src/utils/tokens.ts | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/open-swe/src/__tests__/tokens.test.ts b/apps/open-swe/src/__tests__/tokens.test.ts index 14344059..6d9926bf 100644 --- a/apps/open-swe/src/__tests__/tokens.test.ts +++ b/apps/open-swe/src/__tests__/tokens.test.ts @@ -11,7 +11,6 @@ import { import { calculateConversationHistoryTokenCount, getMessagesSinceLastSummary, - MAX_INTERNAL_TOKENS, } from "../utils/tokens.js"; import { GraphState } from "@open-swe/shared/open-swe/types"; @@ -769,9 +768,3 @@ describe("getMessagesSinceLastSummary", () => { expect(toolMessageExists).not.toBeDefined(); }); }); - -describe("MAX_INTERNAL_TOKENS constant", () => { - it("should be defined as 100,000", async () => { - expect(MAX_INTERNAL_TOKENS).toBe(100_000); - }); -}); diff --git a/apps/open-swe/src/utils/tokens.ts b/apps/open-swe/src/utils/tokens.ts index 7089afaf..628a872d 100644 --- a/apps/open-swe/src/utils/tokens.ts +++ b/apps/open-swe/src/utils/tokens.ts @@ -7,8 +7,8 @@ import { import { getMessageContentString } from "@open-swe/shared/messages"; import { traceable } from "langsmith/traceable"; -// After 100k tokens, summarize the conversation history. -export const MAX_INTERNAL_TOKENS = 100_000; +// After 80k tokens, summarize the conversation history. +export const MAX_INTERNAL_TOKENS = 80_000; export function calculateConversationHistoryTokenCount( messages: BaseMessage[],