{"record":{"id":"ccd931d8974cbb3f","repo":"Fission-AI/OpenSpec","slug":"context-too-large-contextsize-1024-tofixed","errorCode":null,"errorMessage":"Context too large (${(contextSize / 1024).toFixed(1)}KB, limit: ${MAX_CONTEXT_SIZE / 1024}KB)","messagePattern":"Context too large \\((.+?)KB, limit: (.+?)KB\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/project-config.ts","lineNumber":301,"sourceCode":"\n    // Parse schema field using Zod\n    const schemaField = z.string().min(1);\n    const schemaResult = schemaField.safeParse(raw.schema);\n    if (schemaResult.success) {\n      config.schema = schemaResult.data;\n    } else if (raw.schema !== undefined) {\n      console.warn(`Invalid 'schema' field in config (must be non-empty string)`);\n    }\n\n    // Parse context field with size limit\n    if (raw.context !== undefined) {\n      const contextField = z.string();\n      const contextResult = contextField.safeParse(raw.context);\n\n      if (contextResult.success) {\n        const contextSize = Buffer.byteLength(contextResult.data, 'utf-8');\n        if (contextSize > MAX_CONTEXT_SIZE) {\n          console.warn(\n            `Context too large (${(contextSize / 1024).toFixed(1)}KB, limit: ${MAX_CONTEXT_SIZE / 1024}KB)`\n          );\n          console.warn(`Ignoring context field`);\n        } else {\n          config.context = contextResult.data;\n        }\n      } else {\n        console.warn(`Invalid 'context' field in config (must be string)`);\n      }\n    }\n\n    // Parse rules field using Zod\n    if (raw.rules !== undefined) {\n      const rulesField = z.record(z.string(), z.array(z.string()));\n\n      // First check if it's an object structure (guard against null since typeof null === 'object')\n      if (typeof raw.rules === 'object' && raw.rules !== null && !Array.isArray(raw.rules)) {\n        // Artifact ids are intentionally not restricted to the built-in naming","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/project-config.ts#L283-L319","documentation":"Warning from readProjectConfig: the 'context' field is a string but exceeds MAX_CONTEXT_SIZE bytes. It is immediately followed by the 'Ignoring context field' warning; the oversized context is dropped and the config loads without it.","triggerScenarios":"Thrown at src/core/project-config.ts:301 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Trim the context text below the size limit shown in the message","Move large shared context into a file the workflow references instead"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}