Skip to content

meta-profiles ignore OH_PERSISTENCE_DIR — host ~/.openhands/meta-profiles leaks into isolated agent-servers #3835

Closed

Description

@simonrosenberg

What

openhands-agent-server/.../meta_profiles_router.py (introduced by #3744) constructs MetaProfileStore() with no arguments at every handler (list / get / save / delete / activate), so it always falls back to:

_DEFAULT_META_PROFILE_DIR = Path.home() / ".openhands" / "meta-profiles"

and ignores OH_PERSISTENCE_DIR.

This is the same isolation-leak class as #3815 (fixed for the LLM/agent profile stores by #3816): an agent-server started with a fresh OH_PERSISTENCE_DIR still reads and writes the host user's ~/.openhands/meta-profiles, so "isolated" instances (canvas CI/dev/QA rigs, multi-instance deployments) can't get a known-empty server and leak host state across instances.

Why it matters (correctness, not just hygiene)

Meta-profiles reference LLM profiles by name — MetaProfile.classifier_model, MetaProfile.default_model, and each MetaProfileClass.model are names of saved LLM profiles, resolved at runtime by the classify_and_switch_llm tool against the LLM profile store.

After #3816, LLM profiles resolve via OH_PERSISTENCE_DIR (→ else ~/.openhands). If meta-profiles don't resolve to the same base dir, a meta-profile and the LLM profiles it references can land in different roots under isolation, breaking name resolution. So the meta-profile store must co-resolve with the LLM profile store, not just "honor the env var."

Fix

Resolve the meta-profile store dir exactly as #3816 resolves the LLM/agent profile stores: OH_PERSISTENCE_DIR when set, else ~/.openhands, then /meta-profiles. Switch every meta_profiles_router.py call site off the bare MetaProfileStore() constructor.

Since #3744 is still open, the cleanest path is to land this on the #3744 branch before it ships, so the leak never reaches a release (it's not yet on main). PR to follow.

Refs

Activity

  1. added
    bug
    and removed on Jun 24, 2026
  2. all-hands-bot commented on Jul 31, 2026

    @all-hands-bot
    Collaborator

    Proposed closure: completed

    This issue reports that MetaProfileStore() is constructed without arguments in meta_profiles_router.py, ignoring OH_PERSISTENCE_DIR. PR #3836 ("fix(agent_server): honor OH_PERSISTENCE_DIR in meta-profiles router (#3835)") is merged and directly resolves this by passing the persistence-root-derived path to MetaProfileStore() in every handler.

    Evidence: #3836

    Maintainers should verify before closing.

    This comment was generated by an AI agent (OpenHands) on behalf of the user.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions