diff --git a/client/src/lib/version.ts b/client/src/lib/version.ts index 255bea41..be1ae1ad 100644 --- a/client/src/lib/version.ts +++ b/client/src/lib/version.ts @@ -9,7 +9,7 @@ * Update this file with every code change / git commit. */ -export const APP_VERSION = "0.27.15"; +export const APP_VERSION = "0.27.16"; export interface ReleaseNote { version: string; @@ -18,6 +18,13 @@ export interface ReleaseNote { } export const RELEASE_NOTES: ReleaseNote[] = [ + { + version: "0.27.16", + date: "2026-03-20", + changes: [ + "Increase document limit to 250K characters — write instruction, context builder, and analysis endpoints all support much larger documents", + ], + }, { version: "0.27.15", date: "2026-03-13", diff --git a/server/context-builder.ts b/server/context-builder.ts index cc30361c..aa8a40bd 100644 --- a/server/context-builder.ts +++ b/server/context-builder.ts @@ -45,10 +45,10 @@ export { /** Default truncation limits — one place to change them */ export const LIMITS = { - document: 8000, - documentShort: 6000, - documentBrief: 2000, - documentFull: 50000, + document: 250_000, + documentShort: 100_000, + documentBrief: 20_000, + documentFull: 250_000, reference: 500, wireframe: 3000, historyEntries: 5, diff --git a/server/routes.ts b/server/routes.ts index 64c2ade8..078d3f8f 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -953,7 +953,7 @@ You MUST respond with ONLY valid JSON in this exact format (no markdown, no expl const challengeAppConfig = getAppTypeConfig(challengeAppType); const challengeAppContext = formatAppTypeContext(challengeAppType); - const MAX_ANALYSIS_LENGTH = 8000; + const MAX_ANALYSIS_LENGTH = 250_000; const analysisText = docText.slice(0, MAX_ANALYSIS_LENGTH); // Resolve personas — use effective (DB override + code default), fall back to built-in @@ -1144,7 +1144,7 @@ Output only valid JSON, no markdown.`, const appConfig = getAppTypeConfig(appType); const appContext = formatAppTypeContext(appType); - const MAX_ANALYSIS_LENGTH = 6000; + const MAX_ANALYSIS_LENGTH = 250_000; const analysisText = docText.slice(0, MAX_ANALYSIS_LENGTH); // Build discussion history context if available @@ -4374,7 +4374,7 @@ ${docText ? `CURRENT DOCUMENT:\n${docText.slice(0, 3000)}\n\n` : ""}INTERVIEW Q& const askAppConfig = getAppTypeConfig(askAppType); const askAppContext = formatAppTypeContext(askAppType); - const MAX_DOC_LENGTH = 6000; + const MAX_DOC_LENGTH = 250_000; const analysisText = docText.slice(0, MAX_DOC_LENGTH); // Build session context section from pinned documents / captured items diff --git a/shared/schema.ts b/shared/schema.ts index 4cdf18d7..efeedfc8 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -335,7 +335,7 @@ export const writeRequestSchema = z.object({ selectedText: z.string().max(50_000).optional(), // Intent (required - what user wants) - instruction: z.string().min(1, "Instruction is required").max(5_000), + instruction: z.string().min(1, "Instruction is required").max(250_000), // Context (optional - additional grounding) provocation: provocationContextSchema.optional(), diff --git a/tests/unit/server/context-builder.test.ts b/tests/unit/server/context-builder.test.ts index 7122803a..7a9576ee 100644 --- a/tests/unit/server/context-builder.test.ts +++ b/tests/unit/server/context-builder.test.ts @@ -343,10 +343,10 @@ describe("buildContext", () => { // --------------------------------------------------------------------------- describe("LIMITS", () => { it("has expected defaults", () => { - expect(LIMITS.document).toBe(8000); - expect(LIMITS.documentShort).toBe(6000); - expect(LIMITS.documentBrief).toBe(2000); - expect(LIMITS.documentFull).toBe(50000); + expect(LIMITS.document).toBe(250_000); + expect(LIMITS.documentShort).toBe(100_000); + expect(LIMITS.documentBrief).toBe(20_000); + expect(LIMITS.documentFull).toBe(250_000); expect(LIMITS.reference).toBe(500); expect(LIMITS.wireframe).toBe(3000); expect(LIMITS.historyEntries).toBe(5);