Skip to content

Comments

fix(deepagents): preserve ToolMessage metadata on eviction#248

Merged
Hunter Lovell (hntrl) merged 1 commit intomainfrom
hunter/preserve-artifacts
Feb 24, 2026
Merged

fix(deepagents): preserve ToolMessage metadata on eviction#248
Hunter Lovell (hntrl) merged 1 commit intomainfrom
hunter/preserve-artifacts

Conversation

@hntrl
Copy link
Member

Summary

Fixes a bug where the filesystem eviction path for large ToolMessage results rebuilt the message with only content/tool_call_id/name, dropping important runtime fields. After this change, we preserve the original ToolMessage metadata on the replacement message so downstream tracing/replay logic can still access it.

Changes

  • When evicting a large tool result to /large_tool_results/<tool_call_id>, construct the replacement ToolMessage by copying through:
    • id
    • artifact
    • status
    • metadata
    • additional_kwargs
    • response_metadata
  • Add a regression test to ensure those fields survive the eviction path.

@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

🦋 Changeset detected

Latest commit: b5f8dc7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
deepagents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

Choose a reason for hiding this comment

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

LGTM 👍

@hntrl Hunter Lovell (hntrl) merged commit 20c7df0 into main Feb 24, 2026
14 checks passed
@hntrl Hunter Lovell (hntrl) deleted the hunter/preserve-artifacts branch February 24, 2026 03:11
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.

2 participants