Files
OpenHands/tests/unit
openhands 77f868081c feat: add Security settings section via OpenHandsAgentSettings
Create OpenHandsAgentSettings(AgentSettings) in the OpenHands codebase
that extends the SDK's AgentSettings with a 'security' section containing
confirmation_mode (critical) and security_analyzer (major). The SDK's
export_schema() picks these up automatically via its metadata conventions.

Backend:
- SecuritySettings pydantic model with SDK metadata annotations
- OpenHandsAgentSettings subclass used by _get_sdk_settings_schema()
- _SDK_TO_FLAT_SETTINGS bridges dotted SDK keys to flat Settings attrs
  so existing consumers (session init, security-analyzer setup) work
- _extract_sdk_settings_values seeds from flat fields for UI display

Frontend:
- /settings/security route renders the security schema section
- Nav: LLM -> Security -> Condenser -> Critic (both SAAS and OSS)
- Removed empty General page (no schema section exists for it yet)

Tests:
- New test_get_sdk_settings_schema_includes_security_section
- All 119 backend + 10 frontend tests pass

Co-authored-by: openhands <openhands@all-hands.dev>
2026-03-17 02:08:07 +00:00
..
2025-10-28 13:16:07 -04:00
2025-08-22 14:02:36 +00:00

Introduction

This folder contains unit tests that could be run locally.

Run all test:

poetry run pytest ./tests/unit

Run specific test file:

poetry run pytest ./tests/unit/test_llm_fncall_converter.py

Run specific unit test

poetry run pytest ./tests/unit/test_llm_fncall_converter.py::test_convert_tool_call_to_string

For a more verbose output, to above calls the -v flag can be used (even more verbose: -vv and -vvv):

poetry run pytest -v ./tests/unit/test_llm_fncall_converter.py

More details see pytest doc