Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.6.1 - Unreleased

- Removed the direct MiniMax HTTP provider and its transport dependency; provider integrations are now explicitly limited to coding harnesses and agent CLIs.
- Added uv workspace member mapping with repository-relative paths and member-local test commands while preserving mixed root source and test groups, thanks @srnm.

## 0.6.0 - 2026-06-11
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ Supported provider names today:
- `claude`: local Claude Code CLI in print mode
- `cursor`: local Cursor Agent CLI (experimental; `doctor` is enabled by default)
- `grok`: local Grok Build CLI
- `minimax`: MiniMax OpenAI-compatible HTTP API; supports `map`, `review`, and `revalidate`, but not `fix`
- `opencode`: local OpenCode CLI
- `pi`: local Pi coding agent in print mode
- `mock`: deterministic test provider
Expand Down Expand Up @@ -230,4 +229,6 @@ to features so runs can resume and be audited.
- Provider output is parsed through strict schemas.
- Symlinked directories and generated build output are skipped during mapping.

See `docs/spec.md` for the longer product and implementation spec.
See [`VISION.md`](VISION.md) for project scope and `docs/spec.md` for the
longer product and implementation spec. Provider integrations are limited to
coding harnesses and agent CLIs; direct model API providers are out of scope.
69 changes: 69 additions & 0 deletions VISION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Clawpatch Vision

Clawpatch is an automated code-review and repair tool built on coding
harnesses. It maps repositories into bounded features, asks a coding agent to
review or repair them, validates the result, and preserves an auditable record.

Project overview: [`README.md`](README.md)
Provider details: [`docs/providers.md`](docs/providers.md)

## Core Boundary

Clawpatch integrates coding harnesses and agent CLIs, not model APIs.

A provider adapter belongs in Clawpatch when it launches an installed coding
harness that owns model transport, authentication, tool use, and coding-agent
behavior. Current examples include Codex, ACPX, Claude Code, Cursor Agent, Grok
Build, OpenCode, and Pi.

Clawpatch will not add direct model inference integrations. This excludes:

- HTTP clients or SDKs for chat, responses, or model inference APIs
- Clawpatch-owned provider API keys, base URLs, request envelopes, or billing behavior
- model-specific retry, quota, streaming, or structured-output transports
- read-only chat providers that cannot operate as coding harnesses

If a model provider needs support, add it to a coding harness or ACP adapter
first, then integrate that harness through its stable CLI or protocol. Model
selection and API authentication remain the harness's responsibility.
Adapters may pass documented authentication environment variables through to
the harness; they must not use those credentials to call model APIs themselves.

This boundary does not prohibit network access for non-model infrastructure
such as package registries. It specifically keeps model transport out of
Clawpatch.

## Principles

### 1. Harnesses own agent execution

Clawpatch should coordinate coding agents, not reimplement their model clients.
Harnesses own authentication, sessions, tools, permissions, model protocols,
and provider-specific compatibility.

### 2. Review and repair are one workflow

Provider integrations should fit the full coding lifecycle: inspect a checkout,
produce structured findings, plan or apply explicit fixes, and revalidate.
Partial support needs a strong reason and must still come from a coding
harness, not a bare inference endpoint.

### 3. Safety stays explicit

Review and revalidation should be read-only. Repair remains an explicit command
with clean-worktree checks, bounded permissions, validation, and an audit trail.
Clawpatch should expose the harness's security boundary honestly rather than
claiming stronger isolation than the harness provides.

### 4. Keep provider code small

An adapter should translate Clawpatch's stable inputs and schemas to a harness's
documented CLI or protocol. Provider-specific transport stacks and credential
systems are out of scope.

## Contribution Guardrail

Pull requests and issues proposing direct model API providers are out of scope
and will be closed. Proposals for new coding harnesses should document the
harness command or protocol, authentication ownership, read/write permission
model, structured-output path, timeout behavior, and real review/repair proof.
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ stderr so pipes stay parseable.
- **Fixing findings.** [Patching](patching.md) documents the explicit fix workflow and validation steps.
- **Reading reports.** [Reporting](reporting.md) shows how to generate Markdown reports and filter by severity.
- **Configuring providers.** [Providers](providers.md) lists supported backends and future provider integration plans.
- **Understanding project scope.** [Vision](https://github.com/openclaw/clawpatch/blob/main/VISION.md) defines the coding-harness-only provider boundary.

## All features

Expand All @@ -65,4 +66,4 @@ stderr so pipes stay parseable.

## Project

Active development; the [changelog](https://github.com/openclaw/clawpatch/blob/main/CHANGELOG.md) tracks recent releases. Goals and implementation details in [spec.md](spec.md). Released under the [MIT license](https://github.com/openclaw/clawpatch/blob/main/LICENSE).
Active development; the [changelog](https://github.com/openclaw/clawpatch/blob/main/CHANGELOG.md) tracks recent releases. Product scope lives in [VISION.md](https://github.com/openclaw/clawpatch/blob/main/VISION.md), with implementation details in [spec.md](spec.md). Released under the [MIT license](https://github.com/openclaw/clawpatch/blob/main/LICENSE).
56 changes: 3 additions & 53 deletions docs/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ description: "AI provider configuration and model selection"

The default provider is the local Codex CLI.

Clawpatch integrates coding harnesses and agent CLIs only. Direct model API
providers are out of scope; see the project [vision](../VISION.md).

```bash
clawpatch doctor
```
Expand All @@ -17,7 +20,6 @@ Provider names today:
- `acpx`: routes through any ACP-compatible coding agent via `acpx`
- `claude`: shells out to Claude Code in print mode (`claude -p`)
- `grok`: shells out to the xAI Grok Build CLI in headless mode (`grok --prompt-file`)
- `minimax`: calls the MiniMax OpenAI-compatible HTTP API directly
- `opencode`: shells out to `opencode run --format json`
- `pi`: shells out to `pi -p` (non-interactive print mode)
- `cursor`: shells out to `cursor-agent -p --output-format json`
Expand Down Expand Up @@ -350,55 +352,3 @@ implementation uses `--trust` for the explicit trusted-workspace path and never
uses `--force` or `--yolo`. Complete HITL verification before promoting this to
default provider support, especially for ambient rules, MCP configuration,
temporary prompt file handling, timeout behavior, and any claimed read-only mode.

## MiniMax

The `minimax` provider calls the MiniMax OpenAI-compatible HTTP API directly. It
requires a Token Plan API key in `MINIMAX_API_KEY` and defaults to
`https://api.minimax.io/v1`.

```bash
export MINIMAX_API_KEY=sk-cp-...
clawpatch doctor --provider minimax
clawpatch review --provider minimax
clawpatch review --provider minimax --model MiniMax-M2.7-highspeed
```

How the MiniMax provider works:

- Endpoint: `POST ${MINIMAX_BASE_URL:-https://api.minimax.io/v1}/chat/completions`
with `Authorization: Bearer ${MINIMAX_API_KEY}`. `MINIMAX_BASE_URL` is trimmed,
normalized, and must use `https` unless it targets loopback HTTP for local
development; the bearer token is sent to that configured endpoint.
- Operations: `map`, `review`, and `revalidate` are supported. `fix` is not
supported because the chat completions API cannot edit the worktree; it fails
before checking credentials or making network calls with `unsupported-provider`
and exit code 2.
- Structured output: MiniMax M-series Chat Completions do not document OpenAI
`response_format.json_schema` support. Clawpatch therefore sends the provider
schema in the prompt, disables M3 thinking with `thinking: {type: "disabled"}`,
asks for `reasoning_split`, extracts the returned JSON, and validates it
locally with the same Zod schemas used by other providers.
- Model selection: `--model <name>` sets the request `model`; otherwise
`MINIMAX_MODEL` is used, then `MiniMax-M3`.
- HTTP failures: `401` and `403` map to exit code 4, `429` maps to exit code 5,
and other non-2xx statuses map to exit code 1. Embedded MiniMax auth,
rate-limit, balance, and usage-limit status codes are mapped the same way.
Error bodies are reduced to safe status/type/code signals and byte counts.
- Timeout: 30 minutes by default for provider calls, override with
`CLAWPATCH_MINIMAX_TIMEOUT_MS` or `CLAWPATCH_PROVIDER_TIMEOUT_MS`. The `/models`
doctor probe uses a 30-second timeout. Clawpatch uses a custom undici
dispatcher and an operation abort signal so socket headers/body timeouts and
full response-body reads track the configured timeout.
- Bounds: request bodies over 64 MiB and responses over 10 MiB fail before
parsing; error bodies are capped separately.

Permission caveat: MiniMax is a remote API provider. Review inputs are sent to
the configured MiniMax endpoint, and read-only behavior depends on the remote
model following the prompt. For untrusted code, run clawpatch in an isolated
checkout and avoid sending secret-bearing files.

Direct local-model and multi-model panel providers are not implemented yet. The
`acpx` provider is the generic route for ACP-compatible agents; the `grok`,
`opencode`, `pi`, and `cursor` providers are direct integrations for local CLIs;
the `minimax` provider is a direct integration for the MiniMax HTTP API.
5 changes: 2 additions & 3 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ Initial config:
".clawpatch/**"
],
"provider": {
"name": "openai",
"model": "gpt-5.2"
"name": "codex",
"model": null
},
"commands": {
"typecheck": null,
Expand Down Expand Up @@ -906,7 +906,6 @@ Implemented providers:
- `claude`: Claude Code CLI in print mode.
- `cursor`: experimental Cursor Agent CLI integration.
- `grok`: Grok Build CLI.
- `minimax`: MiniMax OpenAI-compatible HTTP API for map, review, and revalidate.
- `opencode`: OpenCode CLI.
- `pi`: pi coding agent.
- `mock` / `mock-fail`: deterministic test providers.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"files": [
"dist",
"README.md",
"VISION.md",
"LICENSE"
],
"type": "module",
Expand All @@ -30,7 +31,6 @@
"crabbox:warmup": "crabbox warmup"
},
"dependencies": {
"undici": "^6.26.0",
"zod": "^4.4.3"
},
"devDependencies": {
Expand Down
9 changes: 0 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/package-smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ async function packageSmokeTesting(): Promise<PackageSmokeTesting["packageSmokeT
describe("package smoke harness", () => {
it("installs the packed clawpatch artifact with packed runtime dependencies", async () => {
const smoke = await packageSmokeTesting();
const dependencySource = "/repo/node_modules/.pnpm/undici@6.26.0/node_modules/undici";
const dependencySource = "/repo/node_modules/.pnpm/zod@4.4.3/node_modules/zod";
const clawpatchTarball = "/tmp/clawpatch-0.5.1.tgz";
const dependencyTarball = "/tmp/undici-6.26.0.tgz";
const dependencyTarball = "/tmp/zod-4.4.3.tgz";

const dependencyNames = smoke.runtimeDependencyNames({
dependencies: { undici: "^6.26.0", zod: "^4.4.3" },
dependencies: { zod: "^4.4.3" },
});
expect(dependencyNames).toEqual(["undici", "zod"]);
expect(dependencyNames).toEqual(["zod"]);

const packArgs = smoke.packDependencyArgs({
dependencyPath: dependencySource,
Expand Down
Loading
Loading