Fix CI validation workflow: Add strict None checks for Mypy compliance
Browse files- env/environment.py +1 -1
- tests/test_environment.py +1 -1
env/environment.py
CHANGED
|
@@ -71,7 +71,7 @@ class SupportTicketEnv:
|
|
| 71 |
tool_output = f"Policy for {issue_type}: {policy}"
|
| 72 |
|
| 73 |
elif action.action_type == "issue_refund":
|
| 74 |
-
if self.state.user_data and self.state.user_data.chargeback_history > 0:
|
| 75 |
tool_output = "Refund denied due to chargeback history."
|
| 76 |
system_message = "Refund action blocked."
|
| 77 |
else:
|
|
|
|
| 71 |
tool_output = f"Policy for {issue_type}: {policy}"
|
| 72 |
|
| 73 |
elif action.action_type == "issue_refund":
|
| 74 |
+
if self.state.user_data and self.state.user_data.chargeback_history is not None and self.state.user_data.chargeback_history > 0:
|
| 75 |
tool_output = "Refund denied due to chargeback history."
|
| 76 |
system_message = "Refund action blocked."
|
| 77 |
else:
|
tests/test_environment.py
CHANGED
|
@@ -102,4 +102,4 @@ def test_fraud_detection_task():
|
|
| 102 |
action4 = Action(action_type="close_ticket", parameters={"resolution": "Refund denied due to chargebacks."})
|
| 103 |
obs4, reward4, done4, info4 = env.step(action4)
|
| 104 |
assert done4 is True
|
| 105 |
-
assert info4.get("current_reward",
|
|
|
|
| 102 |
action4 = Action(action_type="close_ticket", parameters={"resolution": "Refund denied due to chargebacks."})
|
| 103 |
obs4, reward4, done4, info4 = env.step(action4)
|
| 104 |
assert done4 is True
|
| 105 |
+
assert info4.get("current_reward", -1.0) == 0.0
|