fix(provider): only send tool_stream for Z.AI providers in streaming path#5806
Merged
singlerider merged 2 commits intozeroclaw-labs:masterfrom Apr 17, 2026
Merged
Conversation
β¦path The streaming method `stream_chat_with_tools` unconditionally set `tool_stream: true` for all providers when streaming was enabled. This caused 400 Bad Request errors on non-Z.AI OpenAI-compatible endpoints (e.g. litellm proxies) that reject the unrecognized `tool_stream` key. The non-streaming path already correctly used `tool_stream_for_tools()` which gates on `requires_tool_stream()` (Z.AI host or name check). Apply the same guard to both streaming payload branches so the field is only serialized for Z.AI providers. Related: zeroclaw-labs#2901
Collaborator
Verdict: Needs author action (minor)Thanks @zavertiaev β small, surgical fix that closes a real bug for non-Z.AI OpenAI-compatible proxies (litellm, vLLM, etc.). Nice work. Comprehension summary
What I verified
Validation battery
Security / performance assessment
Architectural notes
Findings
What must change before re-review
Once the labels land this is ready for maintainer merge. The code change itself is correct, minimal, well-tested, and aligned with the existing pattern. |
singlerider
approved these changes
Apr 16, 2026
Collaborator
singlerider
left a comment
There was a problem hiding this comment.
Code is correct and well-tested. Approving.
Collaborator
|
This will be merged after v0.7.0 is cut. |
whtiehack
added a commit
to whtiehack/zeroclaw
that referenced
this pull request
Apr 18, 2026
β¦treaming paths - stream_chat_with_tools δΈ€δΈͺεζ―ζ ζ‘δ»Άε tool_stream: Some(true)οΌι Z.AI provider ζ₯ 400 - δΈ€ε€ι½ζΉζ tool_stream_for_tools() ι¨ζ§οΌδΈιζ΅εΌθ·―εΎδΈθ΄ - ε non_zai_provider_omits_tool_stream εε½ζ΅θ― Ports upstream 1da35db (zeroclaw-labs#5806) to master_wecom's pre-workspace-split layout. Co-authored-by: Eugene Zavertiaev <152089142+zavertiaev@users.noreply.github.com>
WareWolf-MoonWall
added a commit
to WareWolf-MoonWall/zeroclaw
that referenced
this pull request
Apr 18, 2026
β¦ changelog - Bump workspace version 0.7.0 β 0.7.1 in root Cargo.toml - Revert release workflow to gh release create --target for workflow_dispatch (the git-push approach from zeroclaw-labs#5860 is blocked by the org Restrict creations rule; --target uses the Releases API which bypasses it, and v0.7.1 has no immutable release lock so the previous blocker does not apply) - Update CHANGELOG-next.md: retitle to v0.6.9 β v0.7.1, restore full comprehensive notes from the upstream draft, and add entries that were missing from the original v0.7.0 draft: - feat(observability): otel_headers for authenticated OTLP exporters (zeroclaw-labs#5700) - feat: GitHub Copilot provider onboarding (zeroclaw-labs#5321) - fix(channels/telegram): inline_keyboard for tool approval requests (zeroclaw-labs#5790) - fix(provider): strip tool_stream for non-Z.AI providers (zeroclaw-labs#5806) - fix(agent): normalize empty successful tool output (zeroclaw-labs#5565) - fix(web): theme mode switch not applying correctly (zeroclaw-labs#5724) - fix(web): add visual preview swatches to theme selector (zeroclaw-labs#5767) - fix: cron_run tool output not delivered to configured channels
WareWolf-MoonWall
added a commit
to WareWolf-MoonWall/zeroclaw
that referenced
this pull request
Apr 18, 2026
β¦ changelog - Bump workspace version 0.7.0 β 0.7.1 in root Cargo.toml - Revert release workflow to gh release create --target for workflow_dispatch (the git-push approach from zeroclaw-labs#5860 is blocked by the org Restrict creations rule; --target uses the Releases API which bypasses it, and v0.7.1 has no immutable release lock so the previous blocker does not apply) - Update CHANGELOG-next.md: retitle to v0.6.9 β v0.7.1, restore full comprehensive notes from the upstream draft, and add entries that were missing from the original v0.7.0 draft: - feat(observability): otel_headers for authenticated OTLP exporters (zeroclaw-labs#5700) - feat: GitHub Copilot provider onboarding (zeroclaw-labs#5321) - fix(channels/telegram): inline_keyboard for tool approval requests (zeroclaw-labs#5790) - fix(provider): strip tool_stream for non-Z.AI providers (zeroclaw-labs#5806) - fix(agent): normalize empty successful tool output (zeroclaw-labs#5565) - fix(web): theme mode switch not applying correctly (zeroclaw-labs#5724) - fix(web): add visual preview swatches to theme selector (zeroclaw-labs#5767) - fix: cron_run tool output not delivered to configured channels
WareWolf-MoonWall
added a commit
to WareWolf-MoonWall/zeroclaw
that referenced
this pull request
Apr 18, 2026
Version
- Bump workspace version 0.7.0 β 0.7.1 in root Cargo.toml + Cargo.lock
CI rationalisation (FND-004 Phase 1 β Rationalise)
- Delete checks-on-pr.yml and ci-run.yml β two workflows doing identical
work on every PR, producing duplicate signal and double compute cost
- Add ci.yml (name: Quality Gate) β single staged pipeline replacing both:
Stage 1: fmt + clippy --workspace (fast gate)
Stage 2: build matrix, check all-features / no-default-features / 32-bit,
benchmarks compile (parallel, gated on Stage 1)
Stage 3: nextest (gated on Stage 1)
Stage 4: cargo deny check β licenses, sources, advisories (deny.toml
already present and triaged)
Stage 5: CI Required Gate composite job (branch protection target)
- Remove rust_strict_delta_gate.sh β workspace-aware clippy --workspace
makes delta comparison implicit (clean baseline = any warning fails)
- pre-release-validate.yml: remove pull_request trigger (secrets unavailable
on fork PRs caused guaranteed failure on every Cargo.toml bump); remove
stale CARGO_REGISTRY_TOKEN check (crates.io publishing removed in zeroclaw-labs#5858)
Release workflow
- Revert release-stable-manual.yml to gh release create --target for
workflow_dispatch (git push approach from zeroclaw-labs#5860 blocked by org Restrict
creations rule; Releases API bypasses it; v0.7.1 has no immutable lock)
Changelog
- Retitle CHANGELOG-next.md to v0.6.9 β v0.7.1, restore full release notes,
add entries missing from original draft: otel_headers (zeroclaw-labs#5700), GitHub
Copilot onboarding (zeroclaw-labs#5321), Telegram inline_keyboard (zeroclaw-labs#5790), tool_stream
fix (zeroclaw-labs#5806), empty tool output (zeroclaw-labs#5565), web theme fixes (zeroclaw-labs#5724, zeroclaw-labs#5767),
cron_run delivery fix
WareWolf-MoonWall
added a commit
to WareWolf-MoonWall/zeroclaw
that referenced
this pull request
Apr 18, 2026
Version
- Bump workspace version 0.7.0 β 0.7.1 in root Cargo.toml + Cargo.lock
CI rationalisation (FND-004 Phase 1 β Rationalise)
- Delete checks-on-pr.yml and ci-run.yml β two workflows doing identical
work on every PR, producing duplicate signal and double compute cost
- Add ci.yml (name: Quality Gate) β single staged pipeline replacing both:
Stage 1: fmt + clippy --workspace (fast gate)
Stage 2: build matrix, check all-features / no-default-features / 32-bit,
benchmarks compile (parallel, gated on Stage 1)
Stage 3: nextest (gated on Stage 1)
Stage 4: cargo deny check β licenses, sources, advisories (deny.toml
already present and triaged)
Stage 5: CI Required Gate composite job (branch protection target)
- Remove rust_strict_delta_gate.sh β workspace-aware clippy --workspace
makes delta comparison implicit (clean baseline = any warning fails)
- pre-release-validate.yml: remove pull_request trigger (secrets unavailable
on fork PRs caused guaranteed failure on every Cargo.toml bump); remove
stale CARGO_REGISTRY_TOKEN check (crates.io publishing removed in zeroclaw-labs#5858)
Release workflow
- Revert release-stable-manual.yml to gh release create --target for
workflow_dispatch (git push approach from zeroclaw-labs#5860 blocked by org Restrict
creations rule; Releases API bypasses it; v0.7.1 has no immutable lock)
Changelog
- Retitle CHANGELOG-next.md to v0.6.9 β v0.7.1, restore full release notes,
add entries missing from original draft: otel_headers (zeroclaw-labs#5700), GitHub
Copilot onboarding (zeroclaw-labs#5321), Telegram inline_keyboard (zeroclaw-labs#5790), tool_stream
fix (zeroclaw-labs#5806), empty tool output (zeroclaw-labs#5565), web theme fixes (zeroclaw-labs#5724, zeroclaw-labs#5767),
cron_run delivery fix
theonlyhennygod
pushed a commit
that referenced
this pull request
Apr 18, 2026
β¦ 1) (#5867) Version - Bump workspace version 0.7.0 β 0.7.1 in root Cargo.toml + Cargo.lock CI rationalisation (FND-004 Phase 1 β Rationalise) - Delete checks-on-pr.yml and ci-run.yml β two workflows doing identical work on every PR, producing duplicate signal and double compute cost - Add ci.yml (name: Quality Gate) β single staged pipeline replacing both: Stage 1: fmt + clippy --workspace (fast gate) Stage 2: build matrix, check all-features / no-default-features / 32-bit, benchmarks compile (parallel, gated on Stage 1) Stage 3: nextest (gated on Stage 1) Stage 4: cargo deny check β licenses, sources, advisories (deny.toml already present and triaged) Stage 5: CI Required Gate composite job (branch protection target) - Remove rust_strict_delta_gate.sh β workspace-aware clippy --workspace makes delta comparison implicit (clean baseline = any warning fails) - pre-release-validate.yml: remove pull_request trigger (secrets unavailable on fork PRs caused guaranteed failure on every Cargo.toml bump); remove stale CARGO_REGISTRY_TOKEN check (crates.io publishing removed in #5858) Release workflow - Revert release-stable-manual.yml to gh release create --target for workflow_dispatch (git push approach from #5860 blocked by org Restrict creations rule; Releases API bypasses it; v0.7.1 has no immutable lock) Changelog - Retitle CHANGELOG-next.md to v0.6.9 β v0.7.1, restore full release notes, add entries missing from original draft: otel_headers (#5700), GitHub Copilot onboarding (#5321), Telegram inline_keyboard (#5790), tool_stream fix (#5806), empty tool output (#5565), web theme fixes (#5724, #5767), cron_run delivery fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
masterstream_chat_with_toolsunconditionally settool_stream: truefor all providers when streaming was enabled, causing 400 Bad Request on non-Z.AI OpenAI-compatible endpoints (e.g. litellm proxies) that reject the unrecognizedtool_streamkey.self.tool_stream_for_tools()(same guard as non-streaming path) sotool_streamis only serialized for Z.AI providers.Label Snapshot (required)
sk: lowsize: XSproviderprovider: compatibleChange Metadata
bugproviderLinked Issue
Supersede Attribution (required when Supersedes is used)
N/A
Validation Evidence (required)
Commands and result summary:
```bash
cargo fmt --all -- --check # exit 0, no output
cargo clippy --all-targets -- -D warnings # exit 0, Finished dev profile
cargo test -p zeroclaw-providers # 762 passed; 0 failed; 0 ignored
```
Security Impact (required)
Privacy and Data Hygiene (required)
passCompatibility / Migration
i18n Follow-Through (required when docs or user-facing wording changes)
Human Verification (required)
tool_streamkey β confirmed root cause via docker logs.tool_stream: true(existing tests pass). Non-Z.AI providers with/without tools getNone.Side Effects / Blast Radius (required)
OpenAiCompatibleProvider::stream_chat_with_toolsonlyrequires_tool_stream()gatenon_zai_provider_omits_tool_stream_regardless_of_streamingtestAgent Collaboration Notes (recommended)
Rollback Plan (required)
git revert <commit>Unrecognized key(s) in object: 'tool_stream'Risks and Mitigations
requires_tool_stream()has a bugzai_tool_requests_enable_tool_streamandz_ai_host_enables_tool_stream_for_custom_profilestests cover this