MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _gate_folder_trust

Function _gate_folder_trust

src/cli.py:168–189  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

166
167
168def _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
192def _run_tui_subcommand(rest: list[str]) -> int:

Callers 2

mainFunction · 0.85
_run_tui_subcommandFunction · 0.85

Calls 3

check_trust_acceptedFunction · 0.90
establish_session_trustFunction · 0.90
_prompt_folder_trustFunction · 0.85

Tested by

no test coverage detected