fix(agents): drop partialJson streaming artifacts from session history repair#93469
Merged
vincentkoc merged 3 commits intoJun 16, 2026
Conversation
25 tasks
a193340 to
3a694e1
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3a694e1 to
86fe9d5
Compare
Member
|
reverified after relevant mainline drift:
|
Member
|
Merged via squash.
Thanks @drvoss! |
14 tasks
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jun 17, 2026
…y repair (openclaw#93469) Merged via squash. Prepared head SHA: 86fe9d5 Co-authored-by: drvoss <3031622+drvoss@users.noreply.github.com> Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com> Reviewed-by: @vincentkoc
crh-code
pushed a commit
to crh-code/openclaw
that referenced
this pull request
Jun 18, 2026
…y repair (openclaw#93469) Merged via squash. Prepared head SHA: 86fe9d5 Co-authored-by: drvoss <3031622+drvoss@users.noreply.github.com> Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com> Reviewed-by: @vincentkoc
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
What problem does this PR solve?
argumentsas complete, then strippingpartialJsonwithout checking whether the remaining block was a finalized OpenAI Responses call or an interrupted Anthropic artifact.Why does this matter now?
What is the intended outcome?
partialJsonartifacts, keep finalized OpenAI Responses tool calls, and preserve retainedsessions_spawnattachment content on kept blocks.What is intentionally out of scope?
What does success look like?
partialJsonstripping, and existingsessions_spawnattachment preservation still works.What should reviewers focus on?
repairToolCallInputs()and the matching regression coverage insrc/agents/session-transcript-repair.test.ts.Linked context
Which issue does this close?
Which issues, PRs, or discussions are related?
Was this requested by a maintainer or owner?
Real behavior proof (required for external PRs)
id,name,arguments: {}, andpartialJsonshould be dropped, while finalized OpenAI Responses tool calls should keep valid arguments, losepartialJson, and preserve retainedsessions_spawnattachment content.pnpm exec tsxthat importssanitizeToolCallInputs()fromsrc/agents/session-transcript-repair.ts.sessions_spawnblock (call_spawn|fc_456) plus one interrupted Anthropic-style block (toolu_123witharguments: {}andpartialJson).{ "droppedAnthropicArtifact": true, "assistantContent": [ { "type": "toolCall", "id": "call_spawn|fc_456", "name": "sessions_spawn", "arguments": { "attachments": [ { "content": "secret data", "name": "a.txt" } ] } } ], "sessionsSpawnAttachmentContent": "secret data" }sessions_spawnblock stayed,partialJsonwas removed from the retained block, and attachment content was preserved.partialJson, which is the blocker called out in prior review.Tests and validation
Which commands did you run?
node scripts/run-vitest.mjs src/agents/session-transcript-repair.test.ts --runnode scripts/run-vitest.mjs src/agents/session-transcript-repair.attachments.test.ts --runpnpm check:changedWhat regression coverage was added or updated?
src/agents/session-transcript-repair.test.tsnow locks in the keep/drop split between finalized OpenAI Responses tool calls and interrupted AnthropicpartialJsonartifacts.What failed before this fix, if known?
id + name + arguments: {} + partialJsonshape survived cleanup as a replayable tool call afterpartialJsonremoval.If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)partialJsonartifacts instead of replaying them as valid tool calls.Did config, environment, or migration behavior change? (
Yes/No)Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)What is the highest-risk area?
partialJson.How is that risk mitigated?
partialJsonon Anthropic streaming artifacts and finalized OpenAI Responses blocks, and the updated regression tests pin the intended split and preservedsessions_spawnpayload path.Current review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?
fully testedfooter.#57523from a closing claim to related context only, because this PR repairs transcript fallout rather than claiming to fix the upstream Kimi transport ordering bug itself.AI-assisted: drafted with Copilot.