Strixa AI
TopicsSearchPricing
Sign inStart tracking

Signal Detail

Loading signal detail

Reading this signal card's judgment, risks, and evidence.

Strixa AI
TopicsSearchPricing
Sign inStart tracking
Back to Signal Feed
CodeTracked since May 19, 2026

Drop orphaned Anthropic tool_result blocks during handoff compaction

This change fixes a handoff/compaction bug where a prior assistant tool call is summarized away, leaving a `tool_result` with no visible `tool_use` anchor and causing Anthropic API 400 failures on resume. The PR adds a second pass in `transformMessages` to track surviving `tool_use` IDs, drop truly orphaned `tool_result` entries, and preserve their payload in a synthesized `<stale-tool-result>` developer message so context is not silently lost.

Anthropic APIhandoff compactiontool_usetool_result

Signal Intelligence

Confidence Level98%
Worth Continued TrackingFinal score 82% with 1 evidence item.
Primary Impact Areas
Anthropic APIhandoff compactiontool_use

What Happened

  • This change fixes a handoff/compaction bug where a prior assistant tool call is summarized away, leaving a `tool_result` with no visible `tool_use` anchor and causing Anthropic API 400 failures on resume. The PR adds a second pass in `transformMessages` to track surviving `tool_use` IDs, drop truly orphaned `tool_result` entries, and preserve their payload in a synthesized `<stale-tool-result>` developer message so context is not silently lost.
  • This change fixes a handoff/compaction bug where a prior assistant tool call is summarized away, leaving a `tool_result` with no visible `tool_use` anchor and causing Anthropic API 400 failures on resume. The PR adds a second pass in `transformMessages` to track surviving `tool_use` IDs, drop truly orphaned `tool_result` entries, and preserve their payload in a synthesized `<stale-tool-result>` developer message so context is not silently lost.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

Implemented robust orphan `tool_result` handling: after transforming messages, the code indexes surviving `tool_use` IDs, identifies `toolResult` entries without an anchor, drops only those orphans from API payloads, and emits their content as a `<stale-tool-result>` developer note (except empty-content cases) so stalled sessions can continue without data loss.

Why Track This

Why It Matters

Operators running `oh-my-pi` resume/handoff flows with tool-calling will be able to recover from previously wedged sessions because retries no longer loop on the same malformed payload, so they avoid repeated manual intervention and failed continue actions. The PR converts malformed orphan outputs into structured developer notes while preserving content for auditability, and leaves legitimate deferred or aborted tool-call pairs untouched; teams should still monitor for any unexpected drop of delayed tool results if future compaction transforms alter message ordering or summarization behavior.

Impact

Operators running `oh-my-pi` resume/handoff flows with tool-calling will be able to recover from previously wedged sessions because retries no longer loop on the same malformed payload, so they avoid repeated manual intervention and failed continue actions. The PR converts malformed orphan outputs into structured developer notes while preserving content for auditability, and leaves legitimate deferred or aborted tool-call pairs untouched; teams should still monitor for any unexpected drop of delayed tool results if future compaction transforms alter message ordering or summarization behavior.

What To Watch Next

  • Watch whether Anthropic API becomes a repeated pattern.
  • Track follow-up changes around AI Coding Agents.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: orphan_tool_result_false_positive_detection, compaction_summary_shape_changes.
Open Topic TimelineOpen Technical EventOpen Original Sourceorphan_tool_result_false_positive_detection / compaction_summary_shape_changes / tool_call_ordering_regressions

Supporting Evidence

GITHUB PULL REQUESTHigh Trust

can1357/oh-my-pi PR #1165: fix(ai): drop orphan tool_result when handoff drops its tool_use

A stuck-session resume previously failed with `unexpected tool_use_id found in tool_result` because compaction moved the matching `tool_use` into handoff summary while the `tool_result` remained in the outgoing payload.