13 Commits

Author SHA1 Message Date
brooklyn! b79107c565 fix(gateway): include command context in sudo password requests 2026-09-15 02:22:22 -05:00
kshitijk4poor 4fc64b6730 refactor(terminal): probe NOPASSWD only when a prompt would fire; drop the host-only probe
With BaseEnvironment supplying a backend-scoped probe to every production
caller, the module-level host-only `_sudo_nopasswd_works` (and its
TERMINAL_ENV gate) had no callers left; the `or` fallback and the outer
try/except around a callback that already fails closed were dead too.

Move the probe under `should_prompt_for_sudo`: headless callers (gateway,
cron, delegated children) reach `(command, None)` whether or not the probe
runs, so the extra backend round trip — an ssh exec on the SSH backend —
was pure waste on every headless sudo command.

test_subagent_sudo_prompt no longer needs to patch the host probe out:
bare `_transform_sudo_command(cmd)` calls have no probe by construction.
2026-09-11 11:19:53 +05:30
fangliquanflq d38064e3c1 fix(terminal): probe remote passwordless sudo 2026-09-11 11:19:53 +05:30
Teknium 9745a7f0f1 fix(terminal): show sudo password prompts for paths and env prefixes 2026-09-07 07:09:30 -07:00
Teknium 14791b4d4e simplify(compat): approval — drop 43 facade re-exports + _command_detection_variants late-bind seam, repoint 30 callers + 46 test files
tools/approval.py no longer re-exports sibling names (approval_context/prompt/floors/detection/
human_wait/smart/gateway_wait); it imports only what it uses. Siblings reference sibling-defined
names directly (module-attribute reads on tools.approval_context so patching the defining module
still works); only facade-owned state (_lock, _gateway_queues, _permanent_approved, _denied,
_denial_breaker_addendum, _gateway_notify_cb) is still read back through tools.approval.
approval_detection calls its own _command_detection_variants instead of late-binding through the facade.
2026-09-03 13:49:57 -07:00
Teknium 98c140bc4b simplify(compat): code_execution_tool/environments.local — drop 36 re-exports, repoint 5 callers + 14 test files 2026-09-03 13:24:04 -07:00
Teknium 0071ba9965 Merge origin/main (561b053f79) into simp/forwardport: forward-port 220 main commits into the simplified tree 2026-09-03 03:31:03 -07:00
Teknium af5aee9b01 refactor(terminal): spinner-pause env cleanup via pop; hit 430-line target 2026-09-02 20:28:44 -07:00
Teknium db87f06c80 refactor(terminal): compact terminal_tool_sudo docstrings/comments (WHY/invariants kept) 2026-09-02 20:26:02 -07:00
Teknium 5ef79fa8af refactor(terminal): regex shell tokenizer, compact scanner/prompt/nopasswd probe (fuzz-proven identical) 2026-09-02 20:18:22 -07:00
Teknium 87f3a068b2 refactor(terminal): unify sudo/compound-background rewriters on one _scan_shell scanner (fuzz-proven identical) 2026-09-02 20:13:29 -07:00
Teknium d320d5f741 refactor(termhub): compact re-export blocks and wrap companion-module docstrings 2026-09-02 15:59:18 -07:00
Teknium 21c7037975 refactor(terminal): extract sudo/shell-rewrite cluster to terminal_tool_sudo and backend builders/checkers to terminal_tool_backends 2026-09-02 15:31:31 -07:00