The MCP OAuth settings-store tests should keep persistence inside their pytest temporary directory by setting OH_PERSISTENCE_DIR.
Actual Behavior
In tests/agent_server/test_mcp_oauth_store.py, the affected tests create configurations using tmp_path but call get_settings_store() without setting OH_PERSISTENCE_DIR. The settings store therefore falls back to the user default ~/.openhands persistence directory, allowing encrypted MCP OAuth state to be written outside the pytest sandbox.
Reproduce with:
uv run pytest tests/agent_server/test_mcp_oauth_store.py -q
Before this change, the tests did not redirect OH_PERSISTENCE_DIR to tmp_path.
Acceptance Criteria
This issue was created and updated by an AI agent (OpenHands) on behalf of the user.
The MCP OAuth settings-store tests should keep persistence inside their pytest temporary directory by setting
OH_PERSISTENCE_DIR.Actual Behavior
In
tests/agent_server/test_mcp_oauth_store.py, the affected tests create configurations usingtmp_pathbut callget_settings_store()without settingOH_PERSISTENCE_DIR. The settings store therefore falls back to the user default~/.openhandspersistence directory, allowing encrypted MCP OAuth state to be written outside the pytest sandbox.Reproduce with:
Before this change, the tests did not redirect
OH_PERSISTENCE_DIRtotmp_path.Acceptance Criteria
OH_PERSISTENCE_DIRto its pytesttmp_path.uv run pytest tests/agent_server/test_mcp_oauth_store.py -q.This issue was created and updated by an AI agent (OpenHands) on behalf of the user.