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
4 changes: 3 additions & 1 deletion config/backends/backend-instances/agy-cli-acp.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ connector: agy-cli-acp
extra:
# workspace_path omitted: project root comes from session auto-detection (per-request project_dir).
model: "auto"
process_timeout: 300
# 4 hours. Forwarded to the wrapper as --timeout-seconds (agy --print-timeout).
# agy's own print-mode default is 5 minutes and will abort long tool waits.
process_timeout: 14400
idle_timeout: 120
skip_permissions: true
mcp_servers: []
Expand Down
5 changes: 5 additions & 0 deletions src/connectors/agy_cli_acp.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
logger = logging.getLogger(__name__)

ACP_PROTOCOL_VERSION = 1
# Match go-agy-acp-wrapper's 4-hour per-turn ceiling. This is both the ACP
# JSON-RPC wait and --timeout-seconds forwarded to the wrapper; agy's own
# --print-timeout default is only 5 minutes.
DEFAULT_AGY_PROCESS_TIMEOUT_SECONDS = 14400.0
CANONICAL_MODEL_ID_PATTERN = re.compile(
r"^[a-z0-9][a-z0-9._-]*/[a-zA-Z0-9][a-zA-Z0-9._-]*$"
)
Expand Down Expand Up @@ -296,6 +300,7 @@
self._skip_permissions = True
self._mcp_servers: list[Any] = []
self._extra_wrapper_args: list[str] = []
self._process_timeout = DEFAULT_AGY_PROCESS_TIMEOUT_SECONDS

Check warning on line 303 in src/connectors/agy_cli_acp.py

View check run for this annotation

Codecov / codecov/patch

src/connectors/agy_cli_acp.py#L303

Added line #L303 was not covered by tests

async def initialize(self, **kwargs: Any) -> None:
try:
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/connectors/test_agy_cli_acp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pydantic.types import JsonValue
from src.connectors.acp_core.types import ACPNotification
from src.connectors.agy_cli_acp import (
DEFAULT_AGY_PROCESS_TIMEOUT_SECONDS,
AgyCliAcpConnector,
AgyCliConfiguredModelEnumerator,
build_agy_acp_wrapper_command,
Expand Down Expand Up @@ -172,6 +173,12 @@ def test_resolve_wrapper_prefers_existing_file(self, tmp_path: Path) -> None:
exe.write_text("noop", encoding="utf-8")
assert resolve_agy_acp_wrapper_executable(str(exe)) == str(exe.resolve())

def test_connector_default_process_timeout_is_four_hours(
self, connector: AgyCliAcpConnector
) -> None:
assert connector._process_timeout == DEFAULT_AGY_PROCESS_TIMEOUT_SECONDS
assert DEFAULT_AGY_PROCESS_TIMEOUT_SECONDS == 14400.0


class TestAgyCliAcpInitialization:
async def test_initialize_with_project_dir(
Expand All @@ -190,6 +197,7 @@ async def test_initialize_with_project_dir(
assert connector.is_backend_functional() is True
assert connector._default_project_dir == temp_workspace.resolve()
assert connector._model == "google/gemini-3.5-flash-medium"
assert connector._process_timeout == DEFAULT_AGY_PROCESS_TIMEOUT_SECONDS

async def test_initialize_requires_existing_workspace(
self, connector: AgyCliAcpConnector, tmp_path: Path
Expand Down
Loading