Skip to content

fix(agent): keep parallel tool results together in model requests - #6894

Merged
M4n5ter merged 1 commit into
rust-previewfrom
codex/kimi-parallel-tool-results
Nov 14, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
codex/kimi-parallel-tool-results

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 14, 2026

Copy link
Copy Markdown
Member

Summary

Kimi rejects a continuation with HTTP 400 when a late tool receipt appears as a user message between two parallel tool results. Keep these receipts in the Host and send each accepted result once in the tool message sequence. When a Cell finishes while its tool callback is still active, let the callback deliver the result. Interrupted Cells can still recover from their recorded outcome.

Verification

  • Captured the Host's Chat Completions request against a local endpoint: two parallel calls, two consecutive tool results, one result per call. On the original code, the capture showed an intervening user message.
  • Compared consecutive requests in an ordinary tool continuation; each retained the previous message prefix unchanged. The background summary reuse and interrupted Cell recovery checks also passed.
  • Five targeted tests and formatting checks passed locally. The live Kimi endpoint was not called.

AI use

  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented and verified the change.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above

@M4n5ter
M4n5ter merged commit 80cf6f1 into rust-preview Nov 14, 2026
5 of 8 checks passed
@M4n5ter
M4n5ter deleted the codex/kimi-parallel-tool-results branch November 14, 2026 04:37
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.

1 participant