Skip to content

fix(agent): continue Ollama GLM replies after stop misreports#10740

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/ollama-stop-truncation
Closed

fix(agent): continue Ollama GLM replies after stop misreports#10740
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/ollama-stop-truncation

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • detect suspicious Ollama-hosted GLM finish_reason="stop" responses after tool turns when the visible text does not end naturally
  • reclassify that narrow case to "length" so the existing continuation path can request the missing tail instead of silently ending the turn
  • add regression coverage for the misreported-stop path plus scope guards for complete responses and non-Ollama backends

Testing

  • python3 -m pytest -o addopts= tests/run_agent/test_run_agent.py -k "ollama_glm_stop or non_ollama_stop or length_finish_reason_requests_continuation"

Closes #10711

@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #10782. Your GLM stop-misreport fix was cherry-picked onto current main with your authorship preserved in git log. Clean, narrowly-scoped fix. Closes #10711.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Ollama returns finish_reason='stop' on truncated GLM responses, causing agent to silently drop final output

2 participants