- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
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>
- 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>
- 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>
- 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>