Skip to content
Merged
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: 4 additions & 1 deletion loopx/control_plane/quota/effect_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from ..goals.goal_ref_validation import exact_goal_ref
from ..work_items.delivery_batch_scale import DELIVERY_BATCH_SCALE_INPUT_CHOICES
from ..turn_driver.native_context_profile import NATIVE_CONTEXT_PAGE_OUTPUT_BYTES
from ..turn_driver.decision_capture import private_capture_supported

_PLATFORM_IS_POSIX = os.name == "posix"

Expand Down Expand Up @@ -268,6 +267,10 @@ def writeback_command(boundary: str) -> str:
writeback_command(" --delivery-boundary semantic_closeout")
+ " --agent-vision-json <file>"
)
# Imported here so the settlement-plan kernel stays loadable on its own: the
# capture-binding owner is orchestration a command template never needs.
from ..turn_driver.decision_capture import private_capture_supported

max_output_arg = (
f" --max-page-output-bytes {NATIVE_CONTEXT_PAGE_OUTPUT_BYTES}"
if private_capture_supported()
Expand Down
6 changes: 4 additions & 2 deletions tests/control_plane/test_quota_settlement.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,9 @@ def test_private_capture_support_matches_uid_boundary(
def test_settlement_command_uses_private_capture_support() -> None:
# The generated command and the CLI's private-capture check must share one
# platform qualification; a POSIX-looking host without getuid is unsupported.
with patch.object(quota_effect_program, "private_capture_supported", return_value=False):
# The settlement kernel resolves the predicate at its owner, because keeping
# capture IO out of the plan module's cold import is itself a guard.
with patch.object(decision_capture_module, "private_capture_supported", return_value=False):
plan = quota_effect_program.build_turn_scoped_cli_settlement_plan(
goal_id=GOAL_ID, agent_id=AGENT_ID, todo_id=TODO_ID,
turn_instance_id=TURN_ID, scoped_cli_args="", lifecycle_actor_args="",
Expand All @@ -835,7 +837,7 @@ def test_settlement_command_uses_private_capture_support() -> None:
assert command is not None
assert "--max-page-output-bytes" not in command

with patch.object(quota_effect_program, "private_capture_supported", return_value=True):
with patch.object(decision_capture_module, "private_capture_supported", return_value=True):
plan = quota_effect_program.build_turn_scoped_cli_settlement_plan(
goal_id=GOAL_ID, agent_id=AGENT_ID, todo_id=TODO_ID,
turn_instance_id=TURN_ID, scoped_cli_args="", lifecycle_actor_args="",
Expand Down
Loading