fix: per-node max_tokens + validation 502 guard + correct_jrxml output validity

- backend/llm.py: per-node max_tokens via get_llm(max_tokens=N), LLM_MAX_TOKENS env var (default 8192)
- agent/nodes.py: 5 generation nodes use max_tokens=32768, generate_skeleton retries at 65536
- agent/nodes.py: fix ns:field regex (<field → <[\w:]*field) to handle namespace prefixes
- agent/nodes.py: fix correct_jrxml never writing back to state["current_jrxml"]
- agent/nodes.py: correct_jrxml rejects non-JRXML output (no <jasperReport tag)
- agent/nodes.py: _strip_continuation_wrapper strips markdown/prefixes from continuation rounds
- agent/nodes.py: _extract_jrxml iterates multiple markdown code blocks, skips fragments
- agent/graph.py: route_after_validate skips correction loop when service_unavailable
- agent/graph.py: route_after_save skips validation for empty JRXML
- backend/validation.py: returns service_unavailable: True for ConnectError and HTTP 5xx
- Docs: CLAUDE.md v14 changelog, README.md LLM_MAX_TOKENS, .env.example LLM_MAX_TOKENS
This commit is contained in:
2026-05-24 15:20:25 +08:00
parent e362f530ea
commit 4e14334030
8 changed files with 388 additions and 32 deletions
+1
View File
@@ -176,6 +176,7 @@ jrxml-agent/
| ANTHROPIC_API_KEY | Anthropic 兼容 API 密钥(优先) | - |
| ANTHROPIC_BASE_URL | Anthropic 兼容 Base URL | https://api.minimaxi.com/anthropic |
| LLM_MODEL | 模型名称 | MiniMax-M2.7 |
| LLM_MAX_TOKENS | 默认 max_tokens(各节点可覆盖) | 8192 |
| LOCAL_LLM_MODEL | Ollama 模型 | qwen2.5-coder:7b |
| EMBED_BACKEND | local 或 cloud | local |
| LOCAL_EMBED_MODEL | 嵌入模型 | Qwen/Qwen3-Embedding-0.6B |