Skip to content

Commit ba38588

Browse files
author
zhansheng.lzs
committed
fix(acli): narrow _run_started for the repo mypy gate
_clamp_run_command_timeout subtracts the monotonic anchor after the ceiling-None guard, but the repo's mypy (pinned --python-version=3.10) cannot infer _run_started is non-None from that guard across methods — CI on PR #206 failed with "Unsupported operand types for - (float and None)". Fold the check into the guard; upstream agenticCLI gets the same line so the next sync stays byte-identical. black also explodes two long calls in the merge-touched tongyi tests.
1 parent 07929e1 commit ba38588

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎dashscope/acli/agent.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def _clamp_run_command_timeout(self, tool_call) -> str:
691691
if tool_call.name != "run_command":
692692
return ""
693693
ceiling = self._command_timeout_ceiling()
694-
if ceiling is None:
694+
if ceiling is None or self._run_started is None:
695695
return ""
696696
from dashscope.acli.tools.shell import default_timeout
697697

‎tests/unit/test_tongyi_native.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ def test_reasoning_content_is_stripped_from_the_wire():
371371

372372

373373
def test_max_output_tokens_sent_when_configured():
374-
body = _provider(max_output_tokens=4096)._build_request_body( # pylint: disable=protected-access
374+
body = _provider(
375+
max_output_tokens=4096,
376+
)._build_request_body( # pylint: disable=protected-access
375377
MESSAGES,
376378
None,
377379
)
@@ -398,7 +400,9 @@ def test_max_output_tokens_env_override(monkeypatch):
398400

399401

400402
def test_thinking_budget_sent_when_configured():
401-
body = _provider(thinking_budget=4096)._build_request_body( # pylint: disable=protected-access
403+
body = _provider(
404+
thinking_budget=4096,
405+
)._build_request_body( # pylint: disable=protected-access
402406
MESSAGES,
403407
None,
404408
)

0 commit comments

Comments
 (0)