Goose drops the reasoning_content field between turns instead of passing it back to the API. GLM-4.7 via Z.AI requires this field to be preserved for its "Preserved Thinking" feature to work. Without it, the model loses all reasoning context after every single action and spirals into infinite loops — redoing completed work, corrupting files, and spawning redundant subagents.
To Reproduce
- Configure Goose with Z.AI as a custom provider (Anthropic I have only tested) using model
glm-4.7
- Give it any multi-step agentic task (e.g. fix linting violations across multiple files)
- Watch the model lose track of what it already did after each tool call and begin looping
Expected behavior
Goose should pass reasoning_content back to the API on every turn with clear_thinking: false, as required by Z.AI's API for multi-turn agentic tasks. The same model completes identical tasks correctly in Claude Code in ~2 minutes. In Goose the same task took 40+ tool calls and 40 minutes with no successful completion.
Screenshots
Please provide the following information
- OS & Arch: Macos Tahoe 26.3
- Interface: CLI and Desktop
- Version: 1.24.0
- Extensions enabled: Developer
- Provider & Model: Z.AI custom provider – glm-4.7 / glm-5
Additional context
Related issues: #6902 (same reasoning_content passback bug with Kimi k2.5), #6322 (partial fix that doesn't cover Z.AI/GLM).
Z.AI Preserved Thinking docs: https://docs.z.ai/guides/capabilities/thinking-mode for extra info on it
Goose drops the
reasoning_contentfield between turns instead of passing it back to the API. GLM-4.7 via Z.AI requires this field to be preserved for its "Preserved Thinking" feature to work. Without it, the model loses all reasoning context after every single action and spirals into infinite loops — redoing completed work, corrupting files, and spawning redundant subagents.To Reproduce
glm-4.7Expected behavior
Goose should pass
reasoning_contentback to the API on every turn withclear_thinking: false, as required by Z.AI's API for multi-turn agentic tasks. The same model completes identical tasks correctly in Claude Code in ~2 minutes. In Goose the same task took 40+ tool calls and 40 minutes with no successful completion.Screenshots
Please provide the following information
Additional context
Related issues: #6902 (same
reasoning_contentpassback bug with Kimi k2.5), #6322 (partial fix that doesn't cover Z.AI/GLM).Z.AI Preserved Thinking docs: https://docs.z.ai/guides/capabilities/thinking-mode for extra info on it