Skip to content

fix(sidequest): handle ToolResult in rebuild_cursors and apply_eviction#2120

Merged
bug-ops merged 3 commits intomainfrom
fix/2114-sidequest-toolresult
Mar 22, 2026
Merged

fix(sidequest): handle ToolResult in rebuild_cursors and apply_eviction#2120
bug-ops merged 3 commits intomainfrom
fix/2114-sidequest-toolresult

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 22, 2026

Summary

  • SidequestState::rebuild_cursors and apply_eviction previously only matched MessagePart::ToolOutput, silently skipping all tool results from native providers (OpenAI, Claude) which store results as MessagePart::ToolResult
  • Both methods now match both variants; ToolResult uses a content sentinel "[evicted by sidequest]" for idempotency (no compacted_at field on this variant)
  • 2 new unit tests: rebuild_cursors_includes_tool_result and apply_eviction_handles_tool_result

Fixes #2114.

Test plan

  • cargo nextest run -p zeph-core --lib — 6368 tests pass (+2 new)
  • cargo clippy --workspace --features full -- -D warnings — clean
  • rebuild_cursors_includes_tool_result — ToolResult appears in cursor list
  • apply_eviction_handles_tool_result — ToolResult content replaced with sentinel

bug-ops added 2 commits March 22, 2026 14:14
…on (#2114)

Native tool-use providers (OpenAI, Claude) store tool results as
MessagePart::ToolResult, not MessagePart::ToolOutput. rebuild_cursors
only matched ToolOutput, causing the cursor list to always be empty
and eviction to silently do nothing on all native providers.

Both rebuild_cursors and apply_eviction now match both variants.
ToolResult uses a content sentinel "[evicted by sidequest]" for
idempotency since the variant has no compacted_at field.
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 22, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 22, 2026 13:16
@bug-ops bug-ops merged commit e879a41 into main Mar 22, 2026
25 checks passed
@bug-ops bug-ops deleted the fix/2114-sidequest-toolresult branch March 22, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sidequest): rebuild_cursors only scans ToolOutput, misses ToolResult from native tool-use providers

1 participant