nitpicker-agent
The reusable agentic core extracted from nitpicker:
an LLM agent that reads files (read_file / glob / grep / read-only git) and fans out
parallel subagents, with provider-agnostic LLM clients and optional config-file-driven setup.
It carries none of nitpicker's CLI, review/debate, or PR machinery — just the loop, the tools, and the providers.
The caller owns task semantics through its system prompt, initial message, and optional subagent
prompt. The crate owns only the generic loop contracts it interprets itself—compaction, final-turn
handling, and the fallback subagent protocol—which remain auditable Markdown under prompts/.
Quick start
use *;
use Path;
async
See examples/file_agent.rs for a runnable version.
What you control
- Top-level prompt + task:
AgentBuilder::new(name, model, system_prompt, client)and theinitial_messagepassed to.run(...). - Tools: any
HashMap<String, Arc<dyn Tool>>.file_agent_tools()gives the file/git toolset plusspawn_subagent;all_tools()omits subagents; add your ownToolimpls. - Subagents:
subagent_system_prompt(...)overrides the prompt spawned subagents run with; the override propagates through nested spawns. Depth is capped at 2. - Clients:
client_from_env(LLMProvider::…)for Anthropic / OpenAI / Gemini / OpenRouter via env-var API keys, or build anyArc<dyn LLMClientDyn>yourself. Config-file-driven construction is available via theconfigandprovidermodules.
Features
azure—auth = "azure-ad"for Azure AI Foundry (pulls in the Azure SDK; raises MSRV to 1.88).antigravity— compiles in the Gemini-proxy client hook + config validation (the proxy server itself lives in thenitpickerbinary).
Breaking changes
0.4.0
- Added
fallback: Option<bool>toDefaultsConfig— source-breaking for code constructing the struct with literals (addfallback: None).
0.3.0
- Added
presets: Option<BTreeMap<String, PresetConfig>>toConfigandpresets: Option<Vec<String>>toDefaultsConfig— source-breaking for code constructing these structs with literals (addpresets: None). NewPresetConfigtype. - Added
presets/lanes/jobs/erroroptional fields toAggregationRecordandmodeltoToolCallRecord(same literal-construction caveat), plus the newLaneRecord/JobRecordtypes. Anerror-flagged aggregation record means synthesis failed post-collection — consumers must not render itstextas a verdict.
0.2.0
- Replaced
AgentResulttoken fields (total_input_tokens,total_output_tokens,total_tokens) andusage()method withusage: TokenUsage, which includescached_input_tokensandcache_creation_input_tokens. TokenUsage::input_tokensnow includes provider cache reads across all providers.- Added
max_tokens: Option<u64>toAgentConfig(defaults toNone, using provider per-model limits; Anthropic defaults to 8192).AgentBuilder::max_tokenstakesNonZeroU64. AlloyClient::newnow takesVec<AlloySlot>(client,model,max_tokens) to scope output caps per pooled model.
License
MIT