Gemini Executive Synthesis
LLM response parsing failure (JSON wrapped in markdown code blocks)
Technical Positioning
Robust LLM integration and reliable content parsing for novel generation
SaaS Insight & Market Implications
This issue highlights a critical integration fragility: LLM output format inconsistencies. Vertex AI's Gemini models wrapping JSON in markdown code blocks breaks `inkos`'s `state-validator.js` parser. This directly impedes core autonomous novel writing functionality, preventing chapter audits and saves. The pain point is unexpected variability in LLM API responses, forcing developers to implement highly specific parsing logic for each provider/model. Market implication: SaaS platforms relying on diverse LLM backends must anticipate and robustly handle non-standard outputs, or risk significant operational friction and user dissatisfaction. This parsing failure directly impacts content generation workflow, leading to stalled progress and wasted compute.
Proprietary Technical Taxonomy
Vertex AI
Gemini3.1 pro
Gemini2.5 pro
md代码块
state-validator.js
parseResult
JSON.parse
inkos write next
Raw Developer Origin & Technical Request
GitHub Issue
Mar 29, 2026
Repo: Narcooo/inkos
inkos write next 每次都不成功,openclaw告诉我是state-validator.js的锅,请求修复指导🙏
### What happened?
作者大大辛苦啦,想请教:
我拿了Vertex AI 做了一层API KEY的代理,然后因为用的是Gemini3.1 pro的接口,很神奇地发现inkos write next 每次都不成功,然后查原因,Openclaw告诉我,每次写完之后,内容被包裹在md的代码块里。
openclaw多次提醒我:
“该端点的 Gemini 模型返回 JSON 时总是包裹在 markdown 代码块里,而 inkos 的解析器不处理这种格式”、“问题来源是state-validator.js的parseResult“、“这个 API 端点返回的 JSON 被包在 markdown 代码块里(```json ... ```),inkos 的 state-validator 解析时没处理这种格式,导致 JSON.parse 失败”
想问一下,这种从vertex AI 调用 gemini2.5 pro 或者gemini3.1 pro,回出现这种JSON被包在markdown 代码块里,导致小说write后无法过审和保存的问题,有什么办法解决么?
### Steps to reproduce
1.搭建Vertex AI的代理
2.将自己搭的代理API key 应用于inkos
3.inkos doctor 测试调通
4.开始inkos write next
5.多次始终无法通过(写完无法通过审核,无法保存)
6.查找问题,发现是上述提到的原因
### Expected behavior
原本应该可以跑完模型就存下新的一个章节
### InkOS version
0.63
### Operating system
Linux
### LLM provider / model
vertex AI(Gemini3.1 pro)
### Relevant logs
```shell
```
Developer Debate & Comments
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from Narcooo/inkos.
Extracted Positioning
Performance degradation and excessive token usage in long-form content generation due to 'full context injection'
Optimizing LLM context management for scalability and efficiency in long-form content generation
Extracted Positioning
Architectural design ideas and questions for an AI novel generation system, focusing on RAG, state management, character intelligence, narrative consistency, and feedback loops
Advanced architectural design for scalable, consistent, and intelligent AI novel generation, addressing complex narrative challenges
Extracted Positioning
Inconsistent API key validation between `inkos doctor` and `inkos write next`, leading to 401 errors during chapter generation
Consistent and reliable API key validation across all operational modes
Extracted Positioning
Chapter generation stalling or 'breaking' mid-process, particularly for new books and the first chapter
Reliable and complete chapter generation for new projects
Extracted Positioning
API key authentication failure when using custom providers and multiple agents/routes
Reliable API key management and authentication for custom LLM providers and multi-agent configurations
Frequently Asked Questions
Market intelligence mapped to LLM response parsing failure (JSON wrapped in markdown code blocks).
What problem does LLM response parsing failure (JSON wrapped in markdown code blocks) solve?
Based on our AI analysis of the original developer request, its primary technical positioning is: Robust LLM integration and reliable content parsing for novel generation
How is the developer community reacting to LLM response parsing failure (JSON wrapped in markdown code blocks)?
Yes, we have tracked 3 direct responses and active debates regarding this specific topic originating from GitHub Issue.
What architecture is tied to LLM response parsing failure (JSON wrapped in markdown code blocks)?
Our proprietary extraction maps LLM response parsing failure (JSON wrapped in markdown code blocks) to adjacent architectural concepts including Vertex AI, Gemini3.1 pro, Gemini2.5 pro, md代码块.