Skip to content

Commit 0b95396

Browse files
github-actions[bot]openhands-agentenyst
authored
fix(types): add type hint to on_policy_selected callback (#743)
* fix(types): add type hint to on_policy_selected callback Add ConfirmationPolicyBase type hint to the callback parameter and -> None return type annotation. Addresses item from code quality report. Co-authored-by: openhands <openhands@all-hands.dev> Closes #741 * chore: kick off CI for PR #743 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: enyst <engel.nyst@gmail.com>
1 parent 763b4b4 commit 0b95396

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

openhands_cli/tui/widgets/input_area.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434

3535
if TYPE_CHECKING:
36+
from openhands.sdk.security.confirmation_policy import ConfirmationPolicyBase
3637
from openhands_cli.tui.content.resources import LoadedResourcesInfo
3738
from openhands_cli.tui.textual_app import OpenHandsApp
3839
from openhands_cli.tui.widgets.main_display import ScrollableContent
@@ -136,7 +137,7 @@ def _command_confirm(self) -> None:
136137
current_policy = app.conversation_state.confirmation_policy
137138

138139
# Callback posts message that bubbles up to ConversationManager
139-
def on_policy_selected(policy):
140+
def on_policy_selected(policy: ConfirmationPolicyBase) -> None:
140141
self.post_message(SetConfirmationPolicy(policy))
141142

142143
confirmation_modal = ConfirmationSettingsModal(

0 commit comments

Comments
 (0)