Skip to content

fix(prompt_builder): inject tool-use enforcement for GLM models#24715

Merged
teknium1 merged 1 commit into
mainfrom
salvage/pr-23702
May 13, 2026
Merged

fix(prompt_builder): inject tool-use enforcement for GLM models#24715
teknium1 merged 1 commit into
mainfrom
salvage/pr-23702

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #23702 by @ALIYILD onto current main.

Adds "glm" to the TOOL_USE_ENFORCEMENT_MODELS tuple so GLM models get the same tool-use guidance injected into their system prompt as other models that need it. Trivial 1-line addition.

GLM-family models (z-ai/glm-4.5-air, z-ai/glm-4.5-flash, etc.) exhibit
the same "describe-instead-of-call" failure mode that gpt/codex/gemini/
gemma/grok already trigger enforcement for. Without the injection,
free-tier GLM workers spawned by the kanban dispatcher routinely exit
cleanly (rc=0) without invoking kanban_complete or kanban_block,
producing the "protocol violation" error and triggering the dispatcher's
gave_up path.

Observed in real workloads: seven consecutive kanban tasks across three
GLM-tier profiles (shipbackend, frontend-engineer, backend-engineer) all
failed with the identical message:

    worker exited cleanly (rc=0) without calling kanban_complete or
    kanban_block — protocol violation

Re-running the same tasks on Claude Haiku immediately resolved them.
Adding "glm" to TOOL_USE_ENFORCEMENT_MODELS closes the gap so future
GLM-routed work receives the explicit "every response must contain a
tool call or final result" steering that already protects the other
enforcement-gated model families.

One-line change; no behavior change for non-GLM models.
@teknium1 teknium1 merged commit afa5b81 into main May 13, 2026
4 checks passed
@teknium1 teknium1 deleted the salvage/pr-23702 branch May 13, 2026 01:46
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent loop, run_agent.py, prompt builder labels May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants