Skip to content

Add PostgreSQLFileStore — persistent EventLog for ephemeral deployments #2903

@StatPan

Description

@StatPan

In environments like Cloud Run or containers without persistent volumes, LocalFileStore either fails or falls back to InMemoryFileStore, which means the full EventLog (including tool_call/tool_result events) is lost between requests. This makes proper multi-turn resume impossible.

Proposal: add PostgreSQLFileStore as an optional FileStore backend (pip install openhands-sdk[postgresql]) that persists the EventLog to a PostgreSQL table, namespaced by conversation ID. Locking uses pg_try_advisory_lock so it's safe across multiple processes/instances.

store = PostgreSQLFileStore(dsn=..., namespace=str(conversation_id))
conv = LocalConversation(agent=agent, workspace=workspace, file_store=store)

Happy to open a PR if this direction looks reasonable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestproposalproposal for discussion

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions