Skip to content

Commit e750fe6

Browse files
committed
fix: update command state handling to use OTHERS for non-success outcomes
1 parent c889670 commit e750fe6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wish-command-execution/src/wish_command_execution/command_executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ async def _execute_with_msfconsole(self, wish: Wish, command: str, cmd_num: int,
202202

203203
# Update command result
204204
exit_code = tool_result.exit_code if tool_result.exit_code is not None else (0 if tool_result.success else 1)
205-
state = CommandState.SUCCESS if tool_result.success else CommandState.FAILED
205+
state = CommandState.SUCCESS if tool_result.success else CommandState.OTHERS
206206

207207
# Finish the command
208208
result.finish(exit_code=exit_code, state=state)
@@ -228,7 +228,7 @@ async def _execute_with_msfconsole(self, wish: Wish, command: str, cmd_num: int,
228228

229229
except Exception as e:
230230
# Handle other errors
231-
result.finish(exit_code=1, state=CommandState.FAILED)
231+
result.finish(exit_code=1, state=CommandState.OTHERS)
232232
# Ensure log directory exists
233233
log_files.stdout.parent.mkdir(parents=True, exist_ok=True)
234234
with open(log_files.stdout, 'w') as f:

0 commit comments

Comments
 (0)