Skip to content

fix(providers): complete repaired tool call streams#104714

Merged
steipete merged 1 commit into
release/2026.7.1from
codex/july-toolcall-test-contract
Jul 11, 2026
Merged

fix(providers): complete repaired tool call streams#104714
steipete merged 1 commit into
release/2026.7.1from
codex/july-toolcall-test-contract

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The July release branch promotes serialized plain-text tool calls for LM Studio, xAI, and Ollama, but its shared compatibility wrapper emits only toolcall_start and toolcall_delta before done. Plugin Prerelease exposed this as deterministic LM Studio failures, and the incomplete lifecycle can leave streaming consumers without the finalized tool-call event.

Why This Change Was Made

Emit the provider-neutral toolcall_end event from the existing shared promotion helper, matching the AssistantMessageEvent contract and current main behavior. The shared and Ollama tests now assert both lifecycle ordering and the finalized payload. This avoids backporting the much larger stream-normalization refactor while fixing the exact release-owned contract gap.

User Impact

LM Studio, xAI, and Ollama serialized tool-call repair now completes the streaming lifecycle before the final message, so consumers can finalize repaired calls consistently.

Evidence

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 117db716cb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

delta: typeof record.partialArgs === "string" ? record.partialArgs : "{}",
partial: message,
});
stream.push({ type: "toolcall_end", contentIndex, toolCall: record, partial: message });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Complete the runtime promotion path too

When a provider does not opt into this SDK wrapper and instead relies on the embedded-agent wrapStreamFnPromoteStandaloneTextToolCalls path, the same normalizer still receives a start/delta-only factory in src/agents/embedded-agent-runner/run/attempt.tool-call-normalization.ts:932-949, and src/agents/embedded-agent-runner/run/attempt.ts:3162-3168 applies that wrapper to active sessions. Those promoted streams still emit toolcall_start, toolcall_delta, then done, so streaming consumers waiting for toolcall_end remain broken outside the provider-local wrapper fixed here.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 5:28 PM ET / 21:28 UTC.

Summary
The PR backports toolcall_end emission for promoted plain-text tool calls, adds shared and Ollama lifecycle and payload assertions, and updates the release changelog.

PR surface: Source +1, Tests +19, Docs +1. Total +21 across 4 files.

Reproducibility: yes. The release-base helper visibly omits toolcall_end between the promoted delta and done, while the declared protocol and current main include that terminal event.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: CHANGELOG.md. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦀 challenger crab
Proof: 🌊 off-meta tidepool
Patch quality: 🦀 challenger crab
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • [P1] Continue normal maintainer review; ClawSweeper found no patch-correctness issue.

Security
Cleared: The patch introduces no dependency, permission, secret, workflow, package-resolution, downloaded-artifact, or executable supply-chain changes.

Review details

Do we have a high-confidence way to reproduce the issue?

Yes. The release-base helper visibly omits toolcall_end between the promoted delta and done, while the declared protocol and current main include that terminal event.

Is this the best way to solve the issue?

Yes. Completing the lifecycle in the existing shared release helper is narrower and safer than backporting current main’s larger stream-normalization refactor.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fc0fd1bddaa3.

Label changes

Label changes:

  • add P1: The release-branch defect can leave repaired tool calls unfinished for LM Studio, xAI, and Ollama streaming workflows.
  • add rating: 🦀 challenger crab: Overall readiness is 🦀 challenger crab; proof is 🌊 off-meta tidepool and patch quality is 🦀 challenger crab.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply because live repository permission reports the author has admin access; focused Testbox and CI results remain useful supplemental evidence.

Label justifications:

  • P1: The release-branch defect can leave repaired tool calls unfinished for LM Studio, xAI, and Ollama streaming workflows.
  • rating: 🦀 challenger crab: Overall readiness is 🦀 challenger crab; proof is 🌊 off-meta tidepool and patch quality is 🦀 challenger crab.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply because live repository permission reports the author has admin access; focused Testbox and CI results remain useful supplemental evidence.
Evidence reviewed

PR surface:

Source +1, Tests +19, Docs +1. Total +21 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 2 19 0 +19
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 21 0 +21

What I checked:

Likely related people:

  • steipete: Authored the current-main bounded stream-normalization implementation and has the strongest recent history across the shared provider-stream surface. (role: feature owner and recent area contributor; confidence: high; commits: 05ebaf41f6ee, 062f88e3e3af; files: packages/tool-call-repair/src/promote.ts, src/plugin-sdk/provider-stream-shared.ts, extensions/lmstudio/src/stream.ts)
  • fuller-stack-dev: Introduced the earlier promotion of serialized tool calls through the shared repair package, which is the behavior this release backport completes. (role: introduced related behavior; confidence: medium; commits: 3ea911558c45; files: src/plugin-sdk/provider-stream-shared.ts, packages/tool-call-repair/src/promote.ts)
  • vincentkoc: Recently refactored shared provider payload-normalization helpers in the same public provider-stream SDK module. (role: recent adjacent contributor; confidence: medium; commits: 35bafea757fa, 2ba9d6eabef9; files: src/plugin-sdk/provider-stream-shared.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 5e0dfa5 into release/2026.7.1 Jul 11, 2026
144 of 151 checks passed
@steipete
steipete deleted the codex/july-toolcall-test-contract branch July 11, 2026 21:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

extensions: ollama maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant