monad-developers / monad-developers/ultrafuzz

Add a tight Pi adapter for OpenRouter

Open
#659 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

deferred-post-v0.1 enhancement
Dominant language
TypeScript
Stars
85
Forks
18
Avg merge
11h 10m
Merged PRs (30d)
194

Description

Part of #653. Smithers already ships the Pi harness in its built-in registry (smithers agents capabilities --format json lists id pi, binary pi, export PiAgent), and its options already expose provider, model, apiKey, mode, session, sessionDir, thinking, tools and skills, with env / inheritEnv on the base CLI options. This issue is therefore a tight adapter, not an integration.

Scope

Add packages/runtime/src/templates/smithers/agents/pi.tsx modelled line-for-line on claude.tsx:

  • Construct the Smithers Pi agent with model and provider taken from the model profile.
  • Never set apiKey — that option is the only path that puts a credential into argv (it emits --api-key). Pass the credential through env: workflowControlChildEnvironment(...) instead.
  • Pass the isolation and telemetry-suppression variables through the same env, and set sessionDir to a run-scoped path so no state lands in the operator's real home.
  • Read only auth / api_key_env / config_dir from [agents.PiAgent] via the shared TOML reader, off ULTRAFUZZ_CONFIG_PATH.
  • Keep the subclass to the buildCommand env scrub and nothing else.

Register in agentFactories (agents/index.tsx) and AGENT_TEMPLATES (packages/runtime/src/init.ts). Add PiAgent: "pi" to AGENT_EXECUTABLES in packages/runtime/src/doctor.ts with a --version pin assertion. Ship an opt-in [models.pi] profile, non-default.

Prerequisites (do these first)

  1. Resolve the actual Pi CLI package name and the version to pin — it is not installed in the reference environment.
  2. Confirm whether Smithers' Pi diagnostics recognise an OpenRouter provider at all; their provider mapping may cover only the first-party vendors. If it does not, that is an upstream Smithers issue, not something to patch around in the adapter.

Acceptance criteria

  • Adapter is under ~100 lines, imports nothing from node:fs except readFileSync, and overrides only buildCommand.
  • Unit test: the built argv contains no credential value.
  • Unit test: the credential is present in the child env and the env went through workflowControlChildEnvironment.
  • ultrafuzz doctor requires the pinned Pi CLI and reports a version mismatch.
  • One real OpenRouter smoke run completes an ultrafuzz node end to end.

Explicitly out of scope

The G1-G8/G10 conformance suite. Capability truth is smithers agents capabilities / doctor / test; ultrafuzz does not define a second contract.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

First resolve the Pi CLI package and pinned version, then check smithers agents capabilities --format json and Pi diagnostics for OpenRouter support. Read packages/runtime/src/templates/smithers/agents/claude.tsx, update the named registry, template, doctor, and model-profile locations, and add the specified unit tests. Done means the credential stays out of argv, reaches the child environment, doctor detects version mismatches, and an OpenRouter smoke run completes an ultrafuzz node.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.