Commit Graph

5888 Commits

Author SHA1 Message Date
Chuck Butkus
997371aed7 Another fix 2025-12-10 01:27:46 -05:00
Chuck Butkus
a1cb0d75af Revert "Try one more thing"
This reverts commit 0c7b4573c9.
2025-12-10 01:02:13 -05:00
Chuck Butkus
0c7b4573c9 Try one more thing 2025-12-10 00:45:51 -05:00
Chuck Butkus
64e4ef1b15 test fixes 2025-12-10 00:25:35 -05:00
Chuck Butkus
b34c89c0f8 Lint fixes 2025-12-09 23:24:12 -05:00
openhands
d5734a8d0c Fix test failures in enterprise/tests/unit/server/test_event_webhook.py
- Fixed session_maker mocking by directly patching the module-level variable
- Updated all failing tests to properly mock the database session
- Fixed TestUpdateConversationMetadata tests to use correct session_maker
- Fixed TestOnWrite::test_on_write_metadata_success to use correct session_maker
- Fixed TestProcessBatchOperationsBackground tests to use correct session_maker
- All 33 tests in test_event_webhook.py now pass

The main issue was that session_maker is imported directly from storage.database
at module import time, so patching 'storage.database.session_maker' wasn't
effective. Instead, we now directly patch the module-level variable in the
conversation_callback_utils module.

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-10 04:20:51 +00:00
Chuck Butkus
e760c182dc Lint fixes 2025-12-09 22:33:41 -05:00
openhands
71009298af Fix enterprise test failures by mocking StoredConversationMetadata lazy imports
- Fixed NoneType errors in conversation store, SQL app conversation info service,
  conversation callback processor, and event webhook tests
- Added proper mocking of StoredConversationMetadata lazy import to use actual
  OpenHands core class instead of None
- Fixed UserStore.get_user_by_id mocking in conversation store tests
- All previously failing tests now pass (23 tests verified)

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-10 03:27:09 +00:00
Chuck Butkus
48f08cab0e Lint fixes 2025-12-09 22:06:22 -05:00
openhands
475e96c314 Fix circular import error between enterprise and core modules
- Move ApiKeyStore import to lazy loading in enterprise/server/mcp/mcp_config.py
- Implement lazy import mechanism in enterprise/storage/stored_conversation_metadata.py using __getattr__
- Move UserContext import to TYPE_CHECKING block in openhands/app_server/app_conversation/sql_app_conversation_info_service.py

This resolves the circular import chain:
user_context → user_models → provider → events → stream → io → json → llm → config → mcp_config → server.mcp.mcp_config → storage → stored_conversation_metadata → sql_app_conversation_info_service → user_context

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-10 02:41:27 +00:00
Chuck Butkus
c5dda5d0d7 Fix tests 2025-12-09 21:12:13 -05:00
openhands
63086831cb Fix circular import in openhands.events.serialization.event
The circular import was caused by openhands.events.serialization.event
importing openhands.llm.metrics at module level, which eventually led
back to openhands.events through the config system.

Changes:
- Remove module-level import of openhands.llm.metrics classes
- Add lazy import in event_from_dict function where metrics are used
- Preserve all existing functionality while breaking the import cycle

This fixes the second circular import in the chain:
events.serialization.event → llm.metrics → config → storage → events

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-10 02:05:49 +00:00
openhands
0d163bf1ce Fix circular import in openhands.events.event
The circular import was caused by openhands.events.event importing
openhands.llm.metrics at module level, which eventually led back to
openhands.events.event through the config system.

Changes:
- Move Metrics import to TYPE_CHECKING block for type annotations
- Add lazy import in llm_metrics property getter for runtime usage
- Use forward references in type annotations
- Preserve all existing functionality while breaking the import cycle

Fixes the ImportError: cannot import name 'Event' from partially
initialized module 'openhands.events.event' error.

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-10 01:41:23 +00:00
openhands
6649be08a7 Fix circular import issue by extracting RecallType to standalone module
- Created new module openhands/events/recall_type.py with RecallType enum
- Removed RecallType from openhands/events/event.py to break circular dependency
- Updated all import statements across 13 files to use new module path
- Resolves circular import chain: sync/enrich_user_interaction_data.py ->
  integrations.github.data_collector -> ... -> openhands.events.event ->
  openhands.llm.metrics -> ... -> storage.conversation_callback ->
  openhands.events.observation.agent -> openhands.events.event (circular)

The RecallType enum now has minimal dependencies and can be imported
without triggering the heavy dependency chain that caused the circular import.

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-10 00:46:31 +00:00
Chuck Butkus
ee0c1a1c2f Revert "Fix circular reference"
This reverts commit a2d61e0eb6.
2025-12-09 19:34:14 -05:00
Chuck Butkus
d3c002aee5 Fix unit tests 2025-12-09 19:11:45 -05:00
Chuck Butkus
a2d61e0eb6 Fix circular reference 2025-12-09 19:00:48 -05:00
Chuck Butkus
fab75ab33d Fix circular reference 2025-12-09 18:50:33 -05:00
Chuck Butkus
a8c4fc5318 Fix SQL migration to work with both SQLLite and Postgres 2025-12-09 18:30:58 -05:00
Chuck Butkus
1647a2466f Update to what is on main branch 2025-12-09 17:11:01 -05:00
Chuck Butkus
fe5b4bb34c Refactor to internal method 2025-12-09 15:21:48 -05:00
openhands
fb0bfd3684 Fix stripe_service tests to handle call_sync_from_async usage
- Updated test database schema to include all required tables (user, org, org_member, role, stripe_customer)
- Fixed test fixtures to use unified Base and create proper table relationships
- Updated test mocking to properly handle call_sync_from_async calls in find_customer_id_by_user_id and find_or_create_customer_by_user_id methods
- All tests now pass successfully after the stripe_service.py changes

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-09 19:49:47 +00:00
Chuck Butkus
9f5c2327ec Fix merge and some cleanup 2025-12-09 13:16:37 -05:00
chuckbutkus
1864cf9b7a Merge branch 'main' into migrate-org-db-litellm-from-deploy 2025-12-09 12:26:32 -05:00
Chuck Butkus
9ecf2c7e85 Add owner role 2025-12-09 11:59:42 -05:00
Rohit Malhotra
0aaad16d35 Fix V1 resolver custom secrets validation error (#11976)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-09 16:47:31 +00:00
Vasco Schiavo
df92923959 Refactor return statement to simplify get_supported_llm_models method (#11947) 2025-12-09 16:27:49 +00:00
sp.wack
e18168020a fix(frontend): skip flaky WebSocket broadcast tests (#11972) 2025-12-09 14:57:26 +00:00
Tim O'Farrell
a9c76d0ed4 APP-240 Fix GitHub webhook timeout issue to prevent client disconnect errors (#11965)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-09 07:29:11 -07:00
Rohit Malhotra
3743d10766 Fix: don't double count v1 conversation metadata (#11970) 2025-12-09 09:16:32 -05:00
Chuck Butkus
e8d89d9a55 Fix OSS unit tests 2025-12-08 22:25:06 -05:00
Chuck Butkus
d33c405ed5 Fix unit tests 2025-12-08 22:15:28 -05:00
Chuck Butkus
3db4d3210d More lint 2025-12-08 21:43:19 -05:00
Chuck Butkus
5ca5bbf3f0 Fix some unit tests 2025-12-08 21:37:23 -05:00
Chuck Butkus
b97a4fdee9 More lint fixes 2025-12-08 21:13:32 -05:00
Chuck Butkus
36a135b942 More lint fixes 2025-12-08 21:09:06 -05:00
Chuck Butkus
7dff779fce Lint fixes 2025-12-08 20:56:27 -05:00
chuckbutkus
f40954f39e Merge branch 'main' into migrate-org-db-litellm-from-deploy 2025-12-08 15:59:44 -05:00
Alona
9b57a0b14f Remove error icon from ExpandableMessage component (#11964) 2025-12-09 02:50:03 +07:00
Chuck Butkus
00797cd8a1 Add v1_enabled field 2025-12-08 14:12:46 -05:00
Chuck Butkus
be5cd4c818 Fix migration 2025-12-08 13:54:29 -05:00
chuckbutkus
297140e727 Merge branch 'main' into migrate-org-db-litellm-from-deploy 2025-12-08 13:38:55 -05:00
Alona
8559efa7b2 Remove loud red x icon on agent commands (#11962) 2025-12-09 01:28:13 +07:00
Hiep Le
bf06b7e3f3 fix(frontend): hide api key input field in advanced settings when provider is openhands (#11949) 2025-12-08 23:03:59 +07:00
Hiep Le
959d610d86 fix(frontend): set v1_enable correctly when saving mcp settings (#11948) 2025-12-08 23:03:26 +07:00
Bharath A V
16125f2ae9 Refactor(frontend): move settings-service into api folder and update (#11958) 2025-12-08 14:50:51 +00:00
dependabot[bot]
d31950c061 chore(deps): bump the version-all group in /frontend with 6 updates (#11957)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-08 14:46:08 +00:00
Tim O'Farrell
db64abc580 Refactor webhook endpoints to use session API key authentication (#11926)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-08 07:40:01 -07:00
Rohit Malhotra
ed7adb335c GitHub V1 Callbacks not trigger by v1 enabled flag (#11923)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-08 03:58:45 +00:00
Cesar Garcia
584517edec docs: fix broken architecture diagram link in openhands/README.md (#11924)
Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
2025-12-07 22:15:58 +00:00