Skip to main content

Module argv

Module argv 

Source
Expand description

Provider-aware construction of per-turn subprocess arguments.

Constants§

CODEX_TOOL_FEATURES 🔒
Codex features that each add a tool to the model’s request. /btw disables every one of them. Checked against the pinned CLI (0.154.0, codex features list) by capturing the request it sends: with these off, plus --ignore-user-config and web_search="disabled", the only tool left is request_user_input, which exec mode refuses to run (“request_user_input is not supported in exec mode”).
GEMINI_DENY_ALL_TOOLS_POLICY 🔒
The Gemini policy that denies every tool, built-in and MCP. Written to disk for --policy. Checked against the pinned CLI (0.60.0) by capturing its request: with this policy the request declares no tools at all, even with --yolo on.
MAX_PROMPT_ARG_UNITS 🔒
The longest prompt append_prompt_arg passes on the command line. Windows caps a whole command line at 32,767 UTF-16 units; this leaves room for the executable path and the provider’s own flags.

Functions§

append_prompt_arg 🔒
For a provider that takes its prompt as an argument rather than on stdin (Antigravity: agy -p <prompt>), append <flag> <prompt> last, after any resume flag. A prompt too long for the command line is refused, never truncated: a cut-off prompt would run as something the user didn’t send.
args_for_log 🔒
args as they may be logged: the prompt append_prompt_arg put last is replaced by its length. On stdin the prompt never reached a log; on the command line it must not either (#4407).
build_codex_argv 🔒
build_codex_side_question_argv 🔒
Build the argv for a /btw side question on a Codex pane: a tool-less codex exec turn, built from scratch rather than from the pane’s own argv, which may be the app-server’s and always carries --dangerously-bypass-approvals-and-sandbox.
build_gemini_side_question_argv 🔒
Build the argv for a /btw side question on a Gemini pane: headless stream-json with GEMINI_DENY_ALL_TOOLS_POLICY at policy_path, and approval mode default instead of the pane’s --yolo. No --skip-trust: trusting the folder would load the project’s own Gemini settings, hooks included, so /btw gets the same trust as the pane.
build_legacy_argv 🔒
build_side_question_argv 🔒
Build the argv for a /btw side-question one-shot turn (server/agent_handlers/side_question.rs) from base_one_shot_args — the same one-shot cli_args a normal turn on this block would use.
build_turn_argv 🔒
Build the argv for one provider turn, adding session continuation when a prior session id is available.
model_flag_value 🔒
The value of -m / --model (or --model=<v>) in args, if any.