Repository navigation
Commit 514f6be
acli: fix Windows TUI (run_command, wheel scroll) + bench-driven fixes (#188)
* release: v1.27.4 — sync acli v0.6.3
Sync agenticCLI v0.6.3 into dashscope/acli:
- stagnation tracker with read-only hard cap for oneshot runs
- auto_approve config + ACLI_AUTO_APPROVE env override
- oneshot mode flag wired into the CLI runner
* feat(acli): sync agenticCLI — budget-aware nudge + retry hardening
- convergence nudge becomes budget-aware for autonomous runs
- HardenedProvider: capped exponential backoff (3 retries, 4s base,
16s cap) to survive transient model-API failures in long runs
* fix(acli): render markdown tables in TUI + restore input draft around confirm prompts
* feat(acli): confirm_mode=dangerous — only risky (DANGEROUS) ops prompt for confirmation
- New config option confirm_mode: "dangerous" (default) | "all"
- CONFIRM-level tools (run_command, write_file, ...) auto-pass in dangerous mode
- Read-only commands (grep/ls/cat/...) already skip prompts via is_safe_readonly
- Policy deny rules still take precedence over auto-pass
- DANGEROUS tools (delete_file, delete_directory) always prompt
* feat(acli): sync agenticCLI — post-change verification rule + plan wiring
Mirrors upstream 4562c7d and picks up the 0.6.4 version bump (SDK
version stays 1.27.4, which is still unreleased on this branch).
Coding tasks were ending without a single test run because the prompt
asked for it: rule 3 said to edit code "without stating a plan first",
the Concise bullet banned "test this / verify" as filler, and another
bullet forbade reporting what had just been done.
- rule 18: run the tests covering the change, or add a focused test when
nothing covers it, and report command + pass/fail
- rule 4: multi-step work uses create_plan/complete_step, already
registered and echoed as "## Current plan" but never mentioned before
Tree verified byte-identical to upstream src/acli after the import
rewrite; black passed and every dashscope.acli module imports.
* feat(acli): sync agenticCLI — oneshot flag overrides + combined sdk-client header
Mirrors agenticCLI 999db69 and 72ecc69:
- `-c` returned from main() before the --protocol/--max-turns overrides were
applied, so oneshot always ran with the config default of 50 turns. Every
terminal-bench run that asked for 150 was really capped at 50.
- TongyiProvider now sends acli/<version>[/<module>] in a single
x-dashscope-sdk-client header instead of splitting the version into
x-dashscope-sdk-version.
* feat(acli): sync agenticCLI — default model qwen3.8-max
Mirrors bc7caee: qwen3.8-max becomes the factory default in Config,
TongyiProvider, run_interactive/embedded.run and the Alibaba/Bailian setup
preset. Also re-vendors examples from agenticCLI-examples (67f2249) so
basic-chat and dashscope-sdk-expert stop overriding that default with
qwen3.7-max / qwen3.7-plus.
* fix(acli): sync agenticCLI — run_command on Windows inside the TUI
sys.stdout.encoding was read while decoding subprocess output, but the
TUI replaces sys.stdout with textual's capture object, which has no
.encoding, so every command failed with AttributeError. The encoding is
now resolved at import. Also passes the command to PowerShell as its own
argv element (no cmd.exe re-quoting), prefers pwsh, and adds -NoProfile.
* fix(acli): sync agenticCLI — capture the mouse in the TUI on Windows
With capture off the terminal never learns the app wants mouse events, so
Windows Terminal and conhost translate the wheel into arrow keys or
scroll their own buffer: the input box moved through its history, or the
whole screen dragged, while the output area never scrolled.
* test(acli): add unit tests for reflection.py
Cover the four core components:
- is_readonly_tool_call: 67 cases (known tools, shell commands, pipes,
redirects, container subcmds, env prefix, edge cases)
- ReflectionTracker: 11 cases (threshold, reset, hints, lessons)
- StagnationTracker: 10 cases (streak, hard cap, mixed sequences)
- convergence_hint: 12 cases (soft/hard boundaries, custom ratios,
remaining calculation, disable conditions)
---------
Co-authored-by: zhansheng.lzs <zhansheng.lzs@alibaba-inc.com>
Co-authored-by: luk384090-cloud <lu384090@gmail.com>1 parent e1fc686 commit 514f6be
23 files changed
Lines changed: 1209 additions & 113 deletions
File tree
- dashscope/acli
- cli
- examples
- basic-chat
- .acli
- dashscope-sdk-expert
- .acli
- memory
- providers
- tools
- ui
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
89 | 116 | | |
90 | 117 | | |
91 | 118 | | |
| |||
146 | 173 | | |
147 | 174 | | |
148 | 175 | | |
149 | | - | |
| 176 | + | |
150 | 177 | | |
151 | 178 | | |
152 | 179 | | |
| |||
175 | 202 | | |
176 | 203 | | |
177 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
178 | 212 | | |
179 | 213 | | |
180 | 214 | | |
| |||
186 | 220 | | |
187 | 221 | | |
188 | 222 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 223 | + | |
210 | 224 | | |
211 | 225 | | |
212 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
251 | | - | |
| 254 | + | |
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
281 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
| |||
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
280 | | - | |
281 | | - | |
282 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
| |||
314 | 321 | | |
315 | 322 | | |
316 | 323 | | |
317 | | - | |
| 324 | + | |
318 | 325 | | |
319 | 326 | | |
320 | 327 | | |
| |||
542 | 549 | | |
543 | 550 | | |
544 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
545 | 566 | | |
546 | 567 | | |
547 | 568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
0 commit comments