Run the folder-trust gate; return ``False`` only when an interactive user declines (the caller then exits 1). Shared by the default interactive entry and the ``clawcodex tui`` subcommand — both hand control to the tool-executing agent-server, which has no trust gate of its own, so t
()
| 166 | |
| 167 | |
| 168 | def _gate_folder_trust() -> bool: |
| 169 | """Run the folder-trust gate; return ``False`` only when an interactive user |
| 170 | declines (the caller then exits 1). |
| 171 | |
| 172 | Shared by the default interactive entry and the ``clawcodex tui`` subcommand |
| 173 | — both hand control to the tool-executing agent-server, which has no trust |
| 174 | gate of its own, so the gate must run before either spawns it. |
| 175 | """ |
| 176 | from src.services.startup_gates import check_trust_accepted |
| 177 | |
| 178 | if check_trust_accepted(): |
| 179 | return True |
| 180 | if sys.stdin.isatty(): |
| 181 | return _prompt_folder_trust() |
| 182 | # Non-TTY (piped) stdin: grant trust implicitly. The Ink TUI needs a real |
| 183 | # TTY to render, so this path normally proceeds to a clean launch failure |
| 184 | # rather than an interactive session — but trust is still established so the |
| 185 | # project env is applied for any diagnostics. |
| 186 | from src.permissions.trust_boundary import establish_session_trust |
| 187 | |
| 188 | establish_session_trust() |
| 189 | return True |
| 190 | |
| 191 | |
| 192 | def _run_tui_subcommand(rest: list[str]) -> int: |
no test coverage detected