Commit 7ae2bf8
authored
feat: disable permission auto-prompts + typing indicator on webhook channels (tinyhumansai#552)
* feat(config): default screen intelligence, dictation, and vision model off
Flip defaults so no macOS TCC permission prompt fires on first run:
- `dictation.enabled`: `true` → `false` (was auto-starting rdev::listen,
which requests Accessibility/Input Monitoring on macOS)
- `screen_intelligence.use_vision_model`: `true` → `false` (fewer
surprise vision-model calls; Pass 1 Apple Vision OCR still runs)
Aligns all permission-gated auto-starts on a consistent opt-in posture:
`screen_intelligence.enabled`, `autocomplete.enabled`, and
`voice_server.auto_start` already default to `false`. Users must now
explicitly flip each toggle (config or JSON-RPC) before the core triggers
any OS permission dialog.
* feat(channels): fire typing indicator on webhook-inbound path
Two inbound flows exist today and only one fires typing:
- Local bot (`channels_config.telegram.bot_token` set) → dispatch.rs
already calls `channel.start_typing` + `spawn_scoped_typing_task`
- Backend webhook (Telegram → backend → socket.io → core) →
`ChannelInboundSubscriber` had **no typing call** — replies route via
backend REST, so the local `Channel` trait isn't reachable.
Close the gap by going through the backend:
- `api/rest.rs`: add `send_channel_typing(channel, jwt, body)` hitting
the new `POST /channels/:id/typing` backend route.
- `channels/bus.rs`: extract the agent-wait loop into `run_agent_loop`
and wrap it with a typing task that fires immediately on `start_chat`
success, refreshes every 4s (beats Telegram's ~5s and Discord's ~10s
typing TTLs), and cancels on every exit path (done / error / empty /
bus-closed / lagged / timeout). Backend failures log at debug — a
flaky typing call must never block the reply flow.
Generalises to every channel with a backend adapter; adapters without a
native typing API no-op gracefully.
* Enhance test stability by introducing a Mutex guard for TRIAGE_DISABLED_ENV in tests
- Added a static Mutex guard to ensure safe concurrent access to the `TRIAGE_DISABLED_ENV` variable during tests, preventing interleaved set_var/remove_var calls that could lead to spurious failures.
- Updated relevant test cases to acquire the Mutex lock when accessing the environment variable, ensuring consistent behavior across concurrent test executions.1 parent 933c233 commit 7ae2bf8
3 files changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
492 | 499 | | |
493 | 500 | | |
494 | 501 | | |
| |||
505 | 512 | | |
506 | 513 | | |
507 | 514 | | |
| 515 | + | |
508 | 516 | | |
509 | 517 | | |
510 | 518 | | |
| |||
520 | 528 | | |
521 | 529 | | |
522 | 530 | | |
| 531 | + | |
523 | 532 | | |
524 | 533 | | |
525 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments