5673 Commits

Author SHA1 Message Date
openhands
830da136a3 Fix linting issues in Slack unit tests
- Fixed trailing whitespace and end-of-file issues
- Reformatted imports and long lines according to ruff standards
- All tests still passing after formatting changes

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-04 06:02:31 +00:00
openhands
e4fe466cfe Add comprehensive unit tests for Slack and GitHub v1/v0 conversation handling
- Created focused unit tests for slack_view.py covering 3 essential scenarios:
  1. V1 vs V0 decision logic based on user setting
  2. Message routing to correct method based on conversation v1 flag
  3. Paused sandbox resumption for V1 conversations

- Fixed failing tests in test_github_view.py by adding missing saas_user_auth parameter
- Converted async test class to use pytest fixtures instead of unittest.TestCase
- All tests now pass with proper async handling and no coroutine warnings

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-04 05:57:58 +00:00
rohitvinodmalhotra@gmail.com
988575de10 add info log 2025-12-04 00:37:22 -05:00
openhands
cff0707ce6 Fix GitHub v1 callback processor tests
- Fixed all import paths from openhands.app_server.event_callback.github_v1_callback_processor to integrations.github.github_v1_callback_processor
- Replaced @patch.dict(os.environ) with direct constant patches for GITHUB_APP_CLIENT_ID and GITHUB_APP_PRIVATE_KEY
- Added missing get_prompt_template mocks to tests that trigger summary requests
- Fixed newline character handling in test_get_installation_access_token_success
- All 17 tests now pass successfully
- Lint checks pass

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-04 05:36:30 +00:00
rohitvinodmalhotra@gmail.com
4b428edaaf restore check for v0 2025-12-04 00:23:47 -05:00
rohitvinodmalhotra@gmail.com
e02175e26a Merge branch 'main' into slack-callback-v1 2025-12-04 00:18:14 -05:00
openhands
bcc1718cc1 Fix pre-commit formatting issues
- Applied ruff formatting fixes to test files
- Fixed import ordering and line length issues
- All pre-commit hooks now pass successfully
- Tests continue to pass after formatting changes

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-04 05:17:26 +00:00
openhands
0b098244d9 Refactor Slack v1 callback processor tests
- Completely rewrote test suite with focus on high-impact scenarios
- Added comprehensive test for double callback processing (main requirement)
- Implemented parameterized tests for event filtering, error scenarios
- Achieved 98% test coverage with minimal but comprehensive test cases
- Tests cover: event filtering, double callbacks, end-to-end flow, error handling
- All 14 tests pass successfully when run from enterprise/ folder

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-04 05:13:26 +00:00
rohitvinodmalhotra@gmail.com
4fb4092a62 resume sandbox if it isn't already running 2025-12-03 23:58:15 -05:00
rohitvinodmalhotra@gmail.com
4577775725 run on message send 2025-12-03 23:47:11 -05:00
rohitvinodmalhotra@gmail.com
c8841f0647 fix endpoint 2025-12-03 23:07:18 -05:00
rohitvinodmalhotra@gmail.com
319d5a0fc9 move github processor 2025-12-03 23:00:35 -05:00
rohitvinodmalhotra@gmail.com
87848a152e fix text content type 2025-12-03 21:56:50 -05:00
rohitvinodmalhotra@gmail.com
06d0ab85e1 try uuid 2025-12-03 21:04:26 -05:00
rohitvinodmalhotra@gmail.com
c2007b8086 Revert "Fix v1 conversation lookup timing issue in SlackUpdateExistingConversationView"
This reverts commit f264e9a049fefaf5ce2711e4e87a171cf1f7a004.
2025-12-03 21:03:50 -05:00
openhands
f264e9a049 Fix v1 conversation lookup timing issue in SlackUpdateExistingConversationView
- Use ADMIN context like SlackV1CallbackProcessor (which works successfully)
- Add retry logic with exponential backoff for conversation lookup
- Handle race condition where conversation exists but not yet in app_conversation_info_service
- Add detailed logging for debugging timing issues

The issue was that SlackV1CallbackProcessor works with ADMIN context because it runs
after the conversation is fully established, while our method runs immediately when
a follow-up message comes in, creating a timing race condition.

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-04 02:00:40 +00:00
rohitvinodmalhotra@gmail.com
4d39f39c85 send msg 2025-12-03 20:28:55 -05:00
rohitvinodmalhotra@gmail.com
6c5d12febd check v1 flag 2025-12-03 20:00:47 -05:00
openhands
6b35a17923 Implement missing v1 conversation message handling in SlackUpdateExistingConversationView
- Add send_message_to_v1_conversation method to handle v1 conversations
- Use dependency injection pattern to access app conversation info service
- Implement proper message sending via agent server API
- Update create_or_update_conversation to call v1 method instead of pass
- Follow established patterns from SlackV1CallbackProcessor
- Include proper error handling and logging

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-03 23:37:44 +00:00
rohitvinodmalhotra@gmail.com
d344a6e5eb add conditional followup 2025-12-03 18:19:01 -05:00
rohitvinodmalhotra@gmail.com
1af27657be Merge branch 'slack-callback-v1' of https://github.com/OpenHands/OpenHands into slack-callback-v1 2025-12-03 16:28:12 -05:00
rohitvinodmalhotra@gmail.com
28945ef0ab fix missing bot token 2025-12-03 16:28:10 -05:00
openhands
5eec8ccc43 Fix Pydantic schema generation error for UserAuth class
Replace Pydantic dataclass with standard Python dataclass in GithubIssue
to avoid schema generation issues with UserAuth abstract base class.

This resolves the server startup crash:
PydanticSchemaGenerationError: Unable to generate pydantic-core schema for UserAuth

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-03 19:00:09 +00:00
Hiep Le
d0496fea8c
chore: update sdk to latest version (#11897)
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
2025-12-04 01:36:19 +07:00
rohitvinodmalhotra@gmail.com
e705b848d9 add mcp key 2025-12-03 11:21:37 -05:00
Tim O'Farrell
8f91db8ec4
Replace USE_V1_CONVERSATION_API feature flag with user setting (#11893)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-03 09:02:40 -07:00
sp.wack
816d8acf1f
chore(frontend): isolate PATCH dependency bumps from #11869 (#11890)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-03 19:55:35 +04:00
sp.wack
97e6cb1340
chore(frontend): isolate MINOR dependency bumps from #11869 (#11888)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-03 14:29:18 +00:00
Hiep Le
cd9a3b02cf
feat(frontend): display command in observation block in ui (#11884) 2025-12-03 19:55:55 +07:00
Marco Dalalba
14695a8f0e
refactor/bugfix: simplify hasOpenHandsSuffix with provider lookup for gitlab/azure (#11877)
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2025-12-03 12:34:21 +00:00
Hiep Le
eaea8b3ce1
fix(frontend): buying credits does not work on staging (#11873) 2025-12-03 10:07:01 +07:00
Tim O'Farrell
72555e0f1c
APP-193: add X-Access-Token header support to get_api_key_from_header (#11872)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-02 17:01:09 -07:00
Tim O'Farrell
d3e907933a Updated other polymorphic types 2025-12-02 14:05:23 -07:00
Tim O'Farrell
edf4ad14d0 Fix broken DiscriminatedUnion
Since a field of AppConversationStartRequest is polymorphic, it should be an OpenHandsModel rather than a BaseModel
2025-12-02 14:01:15 -07:00
rohitvinodmalhotra@gmail.com
16eef24818 get trace 2025-12-02 14:36:35 -05:00
rohitvinodmalhotra@gmail.com
109cae0853 rm import hack 2025-12-02 13:35:03 -05:00
rohitvinodmalhotra@gmail.com
5a3362ec62 bring back discriminated union 2025-12-02 13:32:47 -05:00
rohitvinodmalhotra@gmail.com
0f3105b76d remove registry 2025-12-02 13:32:09 -05:00
Hiep Le
fd13c91387
fix(backend): apply user-defined condenser_max_size in new v1 conversations (#11862) 2025-12-03 00:24:25 +07:00
openhands
5197b17ad9 Combine conditionals for cleaner SlackCallbackProcessor logic
- Merge the two nested conditionals into a single combined condition
- Add explicit elif branches for better logging clarity
- Improve code readability and reduce nesting depth

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-02 15:48:53 +00:00
openhands
96b98e06ff Optimize v1 status checking by using slack_view attribute instead of database query
- Add v1 boolean attribute to SlackViewInterface with default False
- Set v1=True when creating V1 conversations, v1=False for V0 conversations
- Handle fallback case where V1 creation fails and falls back to V0
- Update slack manager to check slack_view.v1 instead of querying database
- Remove unused get_slack_conversation_by_id method from SlackConversationStore
- Eliminate unnecessary database query for better performance

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-02 15:48:53 +00:00
openhands
ae0d75975d Add v1 column to SlackConversation and conditionally add SlackCallbackProcessor
- Add migration 084 to add nullable boolean 'v1' column to slack_conversation table
- Update SlackConversation model to include v1 column
- Modify save_slack_convo method to record v1 conversation status
- Add get_slack_conversation_by_id method to SlackConversationStore
- Update slack manager to only add SlackCallbackProcessor for non-v1 conversations

Co-authored-by: openhands <openhands@all-hands.dev>
2025-12-02 15:48:53 +00:00
rohitvinodmalhotra@gmail.com
5e0d103f07 add import 2025-12-02 10:28:25 -05:00
rohitvinodmalhotra@gmail.com
2b2c4108f0 fix init 2025-12-02 10:28:07 -05:00
rohitvinodmalhotra@gmail.com
5385dd4054 fix missing method 2025-12-02 09:43:03 -05:00
Hiep Le
6139e39449
fix(backend): git settings not applying in v1 conversations (#11866) 2025-12-02 21:34:37 +07:00
Hiep Le
f76ac242f0
fix(backend): conversation statistics are currently not being persisted to the database (V1). (#11837) 2025-12-02 21:22:02 +07:00
rohitvinodmalhotra@gmail.com
0355c6e720 use basemodel instead 2025-12-02 09:05:28 -05:00
Hiep Le
1f9350320f
refactor(frontend): hide agent dropdown when v1 is enabled (#11860) 2025-12-02 20:22:40 +07:00
Hiep Le
1a3460ba06
fix(frontend): image attachments not working in v1 conversations (#11864) 2025-12-02 20:22:14 +07:00