Skip to main content

Module backend_droid

Module backend_droid 

Source
Expand description

Droid agent backend: drives Factory droid exec -o json headless.

Ground truth is crates/engine/tests/fixtures/droid_exec_scrutiny.json, a recorded droid exec -o json result object. Unlike codex/claude, droid -o json emits a SINGLE result object rather than a stream — there is no stitching required. This module is single-shot only: DroidSession::send_user_message and a resumed SessionSpec are both rejected at the seam rather than translated into droid flags.

Several SessionSpec fields are claude-isms with no droid equivalent and are deliberately ignored when building argv: json_schema, max_budget_usd, resume, permission_mode, allowed_tools / disallowed_tools, tools, settings_json, effort.

Structs§

DroidBackend
The AgentBackend for droid exec -o json: single-shot with autonomy selected from the session role.
DroidSession
A live droid exec -o json session (the AgentSession impl).

Functions§

build_args
Build the argv (excluding the binary itself) for one session.
discover_droid_binary
Locate a working droid binary.
parse_droid_result
Parse one stdout line (a single JSON result object) into AgentEvents: an AgentEvent::Init followed by a terminal AgentEvent::Result. model is the configured model, used both as the Init model (droid’s result object carries no model field) and as the pricing key when the result has no CLI-reported dollar cost.