Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions omnigent/server/routes/_sessions/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
)
from omnigent.harness_capabilities import ForkHistory
from omnigent.harness_plugins import (
ANTIGRAVITY_NATIVE_CODING_AGENT,
CLAUDE_NATIVE_CODING_AGENT,
CODEX_NATIVE_CODING_AGENT,
CURSOR_NATIVE_CODING_AGENT,
Expand Down Expand Up @@ -238,6 +239,9 @@
_CURSOR_NATIVE_HARNESS = CURSOR_NATIVE_CODING_AGENT.harness


_ANTIGRAVITY_NATIVE_HARNESS = ANTIGRAVITY_NATIVE_CODING_AGENT.harness


_KIRO_NATIVE_WRAPPER_LABEL_VALUE = KIRO_NATIVE_CODING_AGENT.wrapper_label


Expand Down Expand Up @@ -713,6 +717,7 @@ def get_server_host_registry() -> HostRegistry | None:
"COST_CONTROL_OVERRIDE_VALUES",
"_ALLOWED_EVENT_TYPES",
"_ANTIGRAVITY_NATIVE_ELICITATION_HOOK_TIMEOUT_S",
"_ANTIGRAVITY_NATIVE_HARNESS",
"_APPROVAL_TYPE",
"_BROWSER_ACTION_AWAIT_S",
"_BROWSER_ACTION_TIMEOUT_RESULT",
Expand Down
19 changes: 15 additions & 4 deletions omnigent/server/routes/_sessions/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7509,10 +7509,10 @@ def _derive_terminal_launch_args_from_spec(sub_spec: AgentSpec) -> list[str] | N
"""
Derive native-terminal YOLO pass-through args from a trusted sub-spec.

polly's native workers (claude-native / codex-native / cursor-native)
launch in a headless pane where no human can answer an ApprovalCard, so
every Edit/Write/Bash that prompts stalls the worker. This translates a
worker bundle's declared full-bypass intent into the per-session
polly's native workers (claude-native / codex-native / cursor-native /
antigravity-native) launch in a headless pane where no human can answer an
ApprovalCard, so every Edit/Write/Bash that prompts stalls the worker. This
translates a worker bundle's declared full-bypass intent into the per-session
``terminal_launch_args`` the runner already appends to the native CLI
argv:

Expand Down Expand Up @@ -7540,6 +7540,10 @@ def _derive_terminal_launch_args_from_spec(sub_spec: AgentSpec) -> list[str] | N
to ``auto`` or ``auto-review``, emit ``["--auto-review"]`` instead
(Smart Auto) so a bundle can choose Claude-style auto without full
yolo.
- antigravity-native -> ``["--dangerously-skip-permissions"]`` by
DEFAULT. Headless agy workers otherwise stall on agy's native
``request-review`` permission prompt for every tool call. An explicit
``executor.config.yolo: false`` opts back out.

Only those native harnesses are translated; for any other harness
(e.g. ``claude-sdk`` / ``cursor``, whose bypass is set via the SDK
Expand Down Expand Up @@ -7588,6 +7592,13 @@ def _derive_terminal_launch_args_from_spec(sub_spec: AgentSpec) -> list[str] | N
if _spec_config_flag_explicitly_disabled(sub_spec, "yolo"):
return None
return _validate_terminal_launch_args(["--yolo"])
if harness == _ANTIGRAVITY_NATIVE_HARNESS:
# Headless default: skip agy's request-review permission prompt.
# Without --dangerously-skip-permissions a headless agy worker stalls
# on every gated tool call. ``yolo: false`` is the opt-out.
if _spec_config_flag_explicitly_disabled(sub_spec, "yolo"):
return None
return _validate_terminal_launch_args(["--dangerously-skip-permissions"])
return None


Expand Down
40 changes: 33 additions & 7 deletions tests/server/routes/test_sessions_yolo_launch_args.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"""Unit tests for native-worker YOLO ``terminal_launch_args`` derivation.

Nessie's native sub-agent workers (claude-native / codex-native /
cursor-native) launch in a headless pane where no human can answer an
approval prompt. The server translates a worker's bypass stance into the
per-session ``terminal_launch_args`` the runner appends to the native
CLI argv: claude-native opts in via ``permission_mode``, while
codex-native and cursor-native default to full bypass (issue #171 /
cursor ``--yolo``) because the headless seam has no safe non-bypass
default, with ``yolo: false`` as the opt-out.
cursor-native / antigravity-native) launch in a headless pane where no human
can answer an approval prompt. The server translates a worker's bypass stance
into the per-session ``terminal_launch_args`` the runner appends to the native
CLI argv: claude-native opts in via ``permission_mode``, while codex-native,
cursor-native, and antigravity-native default to full bypass (issue #171 /
cursor ``--yolo`` / agy ``--dangerously-skip-permissions``) because the
headless seam has no safe non-bypass default, with ``yolo: false`` as the
opt-out.

These tests exercise the pure translation helper
``_derive_terminal_launch_args_from_spec`` directly with real
Expand Down Expand Up @@ -177,6 +178,31 @@ def test_cursor_native_permission_mode_auto_uses_auto_review() -> None:
assert _derive_terminal_launch_args_from_spec(spec) == ["--auto-review"]


def test_antigravity_native_defaults_to_skip_permissions_flag() -> None:
"""
A headless antigravity-native sub-agent defaults to permission bypass.

Polly's agy worker launches in a pane where no human answers agy's native
``request-review`` permission prompt. Without
``--dangerously-skip-permissions`` the worker stalls on the first gated
tool call.
"""
agy = _spec_with_config({"harness": "antigravity-native"})
assert _derive_terminal_launch_args_from_spec(agy) == ["--dangerously-skip-permissions"]


def test_antigravity_native_yolo_true_translates_to_skip_permissions_flag() -> None:
"""antigravity-native + ``yolo: true`` (string ``"True"``) -> skip flag."""
spec = _spec_with_config({"harness": "antigravity-native", "yolo": "True"})
assert _derive_terminal_launch_args_from_spec(spec) == ["--dangerously-skip-permissions"]


def test_antigravity_native_yolo_false_opts_out() -> None:
"""``yolo: false`` keeps antigravity-native prompting (no launch args)."""
spec = _spec_with_config({"harness": "antigravity-native", "yolo": "False"})
assert _derive_terminal_launch_args_from_spec(spec) is None


@pytest.mark.parametrize(
"harness",
["claude-sdk", "codex", "openai-agents", "cursor"],
Expand Down