Skip to content

refactor(shared): extract ConfirmationMode to shared module - #825

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/extract-confirmation-modes
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/extract-confirmation-modes

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Extract ConfirmationMode type, CONFIRMATION_MODES dictionary, and VALID_CONFIRMATION_MODES list to a new shared module for reuse across ACP and TUI interfaces.

Changes

  • Create openhands_cli/shared/confirmation_modes.py with centralized definitions
  • Add ModeInfo TypedDict for better type safety on mode info dictionaries
  • Update acp_impl/confirmation.py to import from shared module (with re-exports for backward compatibility)
  • Update acp_impl/slash_commands.py to import from shared module
  • Export new types from openhands_cli/shared/__init__.py
  • Maintain backward compatibility via re-exports (existing imports continue to work)

Related Issue

Addresses finding from code quality report in #823

Testing

  • Linting passes (make lint)
  • Tests pass (make test)

This PR was automatically generated by the Code Quality Report workflow.

Move ConfirmationMode type, CONFIRMATION_MODES dict, and
VALID_CONFIRMATION_MODES list to shared/confirmation_modes.py
for reuse across ACP and TUI interfaces.

- Create openhands_cli/shared/confirmation_modes.py with centralized definitions
- Add ModeInfo TypedDict for better type safety on mode info dicts
- Update acp_impl/confirmation.py to import from shared module
- Update acp_impl/slash_commands.py to import from shared module
- Maintain backward compatibility via re-exports

Addresses item from code quality report.

Closes #823

Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants