Description
After a long, tool-heavy session reaches the auto-compaction point, the session becomes permanently unusable with an HTTP 500 Jinja template error:
{
"error": {
"code": 500,
"message": "\n------------\nWhile executing CallExpression at line 150, column 32 in source:\n...first %}\n {- raise_exception(\n'System message must be at the beginnin...\n\nError: Jinja\nException: System message must be at the beginning.",
"type": "server_error"
}
}
This happens immediately after compaction. The next user message fails, and every subsequent message in the same session returns the same error. Restarting pentestcode fixes the session temporarily, but the issue returns after another long session reaches compaction.
Environment:
Local Ollama through OpenAI-compatible endpoint
Model: hf.co/Blackfrost-Research/M.O.G.-SEC-27B-1M-CTX-GGUF:Q3_K_L and any other Qwen3.8 27B models.
Plugins
No response
OpenCode version
pentestcode v0.2.5
Steps to reproduce
No response
Screenshot and/or share link
Operating System
Windows 11 AMD64Bit | WSL linux/x86-64
Terminal
Kali Linux terminal inside Docker(WSL)
Description
After a long, tool-heavy session reaches the auto-compaction point, the session becomes permanently unusable with an HTTP 500 Jinja template error:
{
"error": {
"code": 500,
"message": "\n------------\nWhile executing CallExpression at line 150, column 32 in source:\n...first %}\n {- raise_exception(\n'System message must be at the beginnin...\n\nError: Jinja\nException: System message must be at the beginning.",
"type": "server_error"
}
}
This happens immediately after compaction. The next user message fails, and every subsequent message in the same session returns the same error. Restarting pentestcode fixes the session temporarily, but the issue returns after another long session reaches compaction.
Environment:
Local Ollama through OpenAI-compatible endpoint
Model: hf.co/Blackfrost-Research/M.O.G.-SEC-27B-1M-CTX-GGUF:Q3_K_L and any other Qwen3.8 27B models.
Plugins
No response
OpenCode version
pentestcode v0.2.5
Steps to reproduce
No response
Screenshot and/or share link
Operating System
Windows 11 AMD64Bit | WSL linux/x86-64
Terminal
Kali Linux terminal inside Docker(WSL)