Coding Agent Examples

Three runnable example crates in examples/, each a real agent (no mocks) that does the work and then independently verifies the result by running the produced code. All default to a Gemini 3 model; set a key first:

export GOOGLE_API_KEY=…          # or GEMINI_API_KEY
# or: CODING_PROVIDER=openai OPENAI_API_KEY=…

coding_agent

The harness in action, with four modes:

# Multi-language demo (Rust, Python, JavaScript) in a temp workspace:
cargo run --manifest-path examples/coding_agent/Cargo.toml

# Build a medium program over a persistent multi-turn session:
cargo run --manifest-path examples/coding_agent/Cargo.toml -- multiturn

# Scenario tour — increasing complexity, each independently verified:
cargo run --manifest-path examples/coding_agent/Cargo.toml -- tour

# A single task in your own directory:
cargo run --manifest-path examples/coding_agent/Cargo.toml -- ./some/dir "make tests pass"
  • demo — one-shot tasks across languages (writes & runs rustc/python3/node).
  • tour — five scenarios of rising complexity (hellomultifilefixtestdebugrefactor), each self-verified with a PASS/FAIL summary.
  • multiturn — one agent/runner/session grows a Python todo CLI over five turns (add/list → done → rm → robust errors → tests), building on its own prior work; verified by running its test suite.

Read it for: the CodingAgent harness, the plan→act→observe loop, multi-turn context retention.


coding_graph

The ultra-review workflow as an adk-graph StateGraph: implement → parallel correctness/edge-case/style reviewers → synthesize (deferred fan-in) → revise loop → finalize.

cargo run --manifest-path examples/coding_graph/Cargo.toml

Read it for: parallel agents in one super-step, add_deferred_node_fn fan-in, conditional cyclic routing. Verifies by importing the produced function and asserting the spec + edge cases.


coding_goal

Autonomous /goal mode with durable checkpointing: seeds a buggy module + failing test, loops plan→act→verify until python3 test_stats.py passes, prints the persisted checkpoint, then demonstrates resume (a completed goal is a no-op).

cargo run --manifest-path examples/coding_goal/Cargo.toml

Read it for: the verifier-gated goal loop, atomic goal-state checkpointing, and resume-across-restart.


streaming_bash

A web UI (Axum + WebSocket) that renders an LlmAgent's tool activity live from a single EventStream: streaming bash stdout/stderr plus one-shot read_file / grep / glob results, each as its own card.

cargo run --manifest-path examples/streaming_bash/Cargo.toml      # web UI
cargo run --manifest-path examples/streaming_bash/Cargo.toml -- cli

Read it for: ToolContext::emit_progress streaming, and the first-class Event::tool_calls() / Event::tool_results() / event.tool_progress_stream() accessors that let a UI render any tool's output generically. See Streaming Tool Progress.


A suggested path

  1. coding_agent (tour) — see the harness solve tasks of rising complexity.
  2. coding_agent (multiturn) — watch it build a program over a session.
  3. coding_goal — autonomous, verifier-gated, durable goal mode.
  4. coding_graph — parallel ultra-review orchestration.

The CLI (code / goal / ultracode) packages these patterns as first-class commands.

← Back to the Coding Agent overview