Skip to content

[Bug]: separate agent-server processes can attach to the same conversations_path and resume active conversations #2966

@neubig

Description

@neubig

Summary

Two agent-server processes that point at the same conversations_path can load the same persisted conversations, which creates split-brain behavior when one of those conversations is already active.

Why this matters

The default Config.conversations_path is workspace/conversations. In shared runtimes (for example an OpenHands Cloud sandbox), a second agent-server that starts with default settings can attach to the same persisted conversations as the server that is already backing the active session.

This is closely related to the scenario covered in #2943, where a second service resumes or attaches to a still-running conversation from the same persistence directory.

Expected behavior

A second agent-server should not be able to attach to or resume a conversation that is already owned by another live server process unless there is an explicit handoff.

Possible fixes

  • Acquire an exclusive startup lock for conversations_path.
  • Refuse startup when another live server is already using the same persistence directory.
  • Enforce conversation leases / ownership checks before resuming persisted active conversations.

Related context

This issue was created by an AI agent (OpenHands) on behalf of the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions