Agentic.Protocol.ACP.Quirks (agentic v0.2.2)

Copy Markdown

Agent-specific quirks and workarounds for ACP implementations.

Different ACP agents have non-standard behaviors that need special handling. This module centralizes those quirks so the generic ACP client can work correctly with all agents without per-agent modules.

Derived from https://github.com/openclaw/acpx/blob/main/src/acp/agent-command.ts

Known Quirks

AgentQuirk
GeminiVersion detection; < 0.33.0 needs --experimental-acp
Claude60s session creation timeout
CopilotPre-flight --help check for ACP support
QoderExtra args --max-turns, --allowed-tools
DroidDifferent subcommand structure
Gemini15s startup timeout

Summary

Functions

Get agent-specific grace period after stdin close before SIGTERM.

Filter non-JSON stdout lines for agents that produce them.

Infer tool kind from tool title when agent doesn't provide one.

Mutate command args for agent-specific requirements.

Check if agent needs pre-flight validation.

Run pre-flight validation for agents that need it.

Get agent-specific timeout for session creation.

Check if stdout lines from this agent should be filtered.

Get agent-specific timeout for startup.

Functions

close_grace_ms(command, args)

@spec close_grace_ms(String.t(), [String.t()]) :: non_neg_integer()

Get agent-specific grace period after stdin close before SIGTERM.

filter_non_json_lines(output)

@spec filter_non_json_lines(String.t()) :: String.t()

Filter non-JSON stdout lines for agents that produce them.

infer_tool_kind(title)

@spec infer_tool_kind(String.t() | nil) :: atom()

Infer tool kind from tool title when agent doesn't provide one.

mutate_args(command, args, opts \\ [])

@spec mutate_args(String.t(), [String.t()], keyword()) :: {String.t(), [String.t()]}

Mutate command args for agent-specific requirements.

needs_preflight?(command, args)

@spec needs_preflight?(String.t(), [String.t()]) :: boolean()

Check if agent needs pre-flight validation.

preflight_check(command, args)

@spec preflight_check(String.t(), [String.t()]) :: :ok | {:error, term()}

Run pre-flight validation for agents that need it.

session_create_timeout(command, args)

@spec session_create_timeout(String.t(), [String.t()]) :: non_neg_integer()

Get agent-specific timeout for session creation.

should_filter_stdout?(command, args)

@spec should_filter_stdout?(String.t(), [String.t()]) :: boolean()

Check if stdout lines from this agent should be filtered.

startup_timeout(command, args)

@spec startup_timeout(String.t(), [String.t()]) :: non_neg_integer()

Get agent-specific timeout for startup.