Commit 354ec48
fix(F1): route ACP permission asks to auto-deny instead of dropping (#76)
Track F-CRITICAL #1 from ROADMAP.md.
## Problem
`extras/acp/mod.rs::build_acp_permission` constructed
`(ask_tx, _ask_rx)` and immediately dropped `ask_rx`. When a tool
needed `Ask` confirmation in ACP mode (Zed / editor client), the
permission check called `ask_tx.send()`, awaited the oneshot
reply, and waited 30 seconds before timing out. The user saw a
generic tool failure with no context.
Tools requiring permission were effectively unrunnable from ACP
clients unless the user configured `--yolo` or explicit allow
rules in `permission` config.
## Fix
New `spawn_acp_ask_drain` task takes ownership of the receiver
and responds to every `AskRequest` with
`UserDecision::Deny` immediately. Fail-fast with a clear deny
beats a 30s timeout:
- The LLM sees the denial in the tool result and can re-plan.
- The error message is "Permission denied by user", not a
generic timeout.
- Explicit allow rules (set via config or `/allow add` in
interactive mode beforehand) still work — they short-circuit
before the ask channel.
Routing the ask through the ACP protocol as a real
`requestPermission` notification (so the editor surfaces a dialog)
is a larger Phase C5-ish feature; F1 is the minimum-viable
non-hang fix.
## Tests
Two new tests in `extras::acp::tests`:
- `acp_ask_drain_responds_with_deny`: send one `AskRequest`,
assert the reply arrives within 200ms with `Deny`.
- `acp_ask_drain_handles_multiple_concurrent_asks`: send 5
asks in a loop, assert all 5 replies arrive promptly with
Deny — guards against a single-shot drain bug.
## Test plan
- [x] `cargo test --features acp` — 2 new tests pass.
- [x] `cargo test --features plugin` — 649 pass (full suite).
- [x] `cargo build --all-features` — compiles, no warnings.
Co-authored-by: Yogthos <yogthos@gmail.com>1 parent 3defb69 commit 354ec48
1 file changed
Lines changed: 97 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
| 287 | + | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
292 | 387 | | |
293 | 388 | | |
294 | 389 | | |
| |||
0 commit comments