Skip to content

FilesystemMiddleware can emit an unreadable /conversation_history/<uuid>.md reference after oversized HumanMessage eviction #6554

Description

@AnqiHuangQiQi

Submission checklist

  • This is a bug, not a usage question.
  • I added a clear and descriptive title.
  • I searched existing issues and didn't find this.
  • I can reproduce this with the latest released version.
  • I included a minimal reproducible example and steps to reproduce.

Area (Required)

  • deepagents (SDK)
  • dcode
  • talon
  • acp
  • evals
  • daytona
  • modal
  • quickjs
  • runloop
  • vercel
  • langsmith-sandbox
  • Other / not sure / general

Related Issues / PRs

Related issue: #5123
That issue requests exposing FilesystemMiddleware eviction limits through
create_deep_agent(), but it was automatically closed without resolution.

Reproduction Steps / Example Code (Python)

from deepagents import create_deep_agent
from deepagents.backends import StateBackend
from langchain_core.messages import HumanMessage
agent = create_deep_agent(
    model="anthropic:claude-sonnet-4-6",
    backend=lambda runtime: StateBackend(runtime),
    system_prompt=(
        "If the user message is replaced with a /conversation_history path, "
        "immediately call read_file on that path."
    ),
)
prompt = (
    "Review this content. If it is archived, read the archive before answering.\n"
    + ("x" * 210_000)
)
for event in agent.stream(
    {"messages": [HumanMessage(content=prompt)]},
    stream_mode="values",
):
    print(event)

Error Message and Stack Trace (if applicable)

Error: File '/conversation_history/473efc2b-7d37-4fe2-ba65-eadda9f36464.md' not found

Description

The oversized HumanMessage is evicted to a randomly generated
/conversation_history/<uuid>.md path. The model receives that path, but
read_file reports that it does not exist. Re-execution can generate another
UUID and repeat the same sequence.

And this end in a non-stop loop.

Environment / System Info

OS: Linux
deepagents: 0.6.8
langchain: 1.3.10
langchain-core: 1.4.7
Backend: StateBackend
Execution environment: durable/replayed workflow runtime

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

org:externalIssue or pull request created by someone outside the `langchain-ai` GitHub organization.package:deepagentsChanges related to the `deepagents` SDK and agent harness.priority:backlogNot currently planned/prioritized work, often affecting a limited feature or set of users.topic:backendsFilesystem and storage backends for Deep Agents.topic:filesystemFilesystem tools and file-management behavior.type:bugAn unexpected problem or incorrect behavior.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions