Skip to content

feat(provider): add Devin CLI provider - #179

Closed
ademiwa wants to merge 1 commit into
openclaw:mainfrom
ademiwa:feat/devin-cli-provider
Closed

feat(provider): add Devin CLI provider#179
ademiwa wants to merge 1 commit into
openclaw:mainfrom
ademiwa:feat/devin-cli-provider

Conversation

@ademiwa

@ademiwa ademiwa commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Adds a devin provider backed by the local Devin CLI in non-interactive print mode. Provider selection via --provider devin / CLAWPATCH_PROVIDER=devin, with Devin-backed map, review, fix, revalidate, and doctor --provider devin.

Follows the same conventions as the claude (#93) and grok providers: a src/providers/devin.ts module exporting devinProvider + devinTesting, registered in src/provider.ts, with helper tests in src/provider.test.ts and documentation in docs/providers.md, README.md, and docs/spec.md.

Motivation

Devin CLI (Cognition's agent CLI) is a coding-harness CLI that fits clawpatch's provider model (shells out to a local agent CLI, parses structured JSON output). Adding it expands the set of supported review/fix backends alongside codex, claude, grok, opencode, pi, and cursor.

Implementation details

  • Read-only enforcement via --permission-mode: review and revalidate use --permission-mode auto (the Devin runtime auto-approves read-only tools only and never grants writes in print mode). Fix uses --permission-mode accept-edits. This is real tool-level enforcement, not a prompt-only directive — the same approach opencode uses with OPENCODE_PERMISSION and grok uses with --disallowed-tools.
  • Prompt delivery: writes the full clawpatch prompt to a temp file and calls devin --print --prompt-file <path> --permission-mode <mode>.
  • JSON output: parsed from stdout with the shared extractJson helper (same approach as grok, opencode, pi — the Devin CLI has no native --json-schema flag).
  • Reasoning effort: the Devin CLI has no --reasoning-effort flag (verified against v3000.2.17), so the requested effort level is injected into the prompt text.
  • Model pass-through: --model <model> is passed through when configured; when unset, Devin uses its own configured default (~/.config/devin/config.json on macOS/Linux, %APPDATA%\devin\config.json on Windows).
  • Environment: the Devin subprocess inherits the ambient environment. Devin uses config-file-based auth (not env-var API keys), like grok, cursor, opencode, and pi. Strict env isolation (as claude does) would break Devin's credential discovery. This is consistent with the dominant provider pattern (4 of 5 comparable providers use ambient env).
  • Timeout: 300s default, override with CLAWPATCH_DEVIN_TIMEOUT_MS or CLAWPATCH_PROVIDER_TIMEOUT_MS.
  • Version gating: not implemented. No known Devin CLI security advisories exist as of v3000.2.17. The check method validates availability via devin --version.

Also includes a minor cross-platform fix: the Claude env test block in src/provider.test.ts now uses path.join instead of forward-slash string literals for path expectations, so those tests pass on Windows as well as Unix.

Testing performed

  • pnpm typecheck — passed (0 errors)
  • pnpm lint — passed (0 warnings, 0 errors, 113 files, 125 rules)
  • pnpm format:check — changed files pass (pre-existing CRLF format issues on 181 other files are unrelated to this PR)
  • pnpm test — 871 passed, 22 skipped, 0 failed (full suite on the combined working tree)
  • pnpm build — passed (clean compile)
  • Devin provider helper tests: 3 passed (prompt construction with reasoning effort, timeout precedence, failure message previews)
  • providerByName("devin") registry test: passed
  • Verified Devin CLI flag surface against the real binary (devin --versiondevin 3000.2.17, --print, --prompt-file, --model, --permission-mode all confirmed)

Test plan

  • CI passes on Linux (pnpm typecheck && pnpm lint && pnpm format:check && pnpm test && pnpm build)
  • clawpatch doctor --provider devin detects the Devin CLI (requires devin auth login first)
  • clawpatch review --provider devin --limit 1 produces structured findings
  • clawpatch map --source agent --provider devin produces feature records

Add a `devin` provider backed by the local Devin CLI in non-interactive
print mode. Provider selection via `--provider devin` /
`CLAWPATCH_PROVIDER=devin`, with Devin-backed `map`, `review`, `fix`,
`revalidate`, and `doctor --provider devin`.

- Read-only enforcement via `--permission-mode auto` (review/revalidate)
  and `--permission-mode accept-edits` (fix), using the Devin runtime's
  own permission system rather than prompt-only directives
- Prompt delivery via `--print --prompt-file <path>` to a temp file
- JSON output parsed with the shared extractor (same approach as grok)
- Reasoning effort injected into the prompt text (the Devin CLI has no
  `--reasoning-effort` flag as of v3000.2.17)
- Model pass-through with `--model`; when unset, Devin uses its own
  configured default
- Timeout: 300s default, override with `CLAWPATCH_DEVIN_TIMEOUT_MS`
- Ambient env inherited (Devin uses config-file auth, like grok/cursor/
  opencode; strict env isolation would break credential discovery)
- Devin provider docs in `docs/providers.md`, `README.md`, `docs/spec.md`
- Helper tests for prompt construction, timeout, and failure messages

Also fixes cross-platform path expectations in the Claude env test block
by using `path.join` instead of forward-slash string literals.
@ademiwa
ademiwa requested a review from a team as a code owner August 2, 2026 09:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffe908324c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/provider.test.ts
});
});

describe("Devin provider helpers", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add Devin command construction tests

These tests cover prompt text, timeouts, and failure messages but never invoke the provider or assert its constructed CLI arguments. Consequently, regressions in the safety-critical auto versus accept-edits selection, prompt-file delivery, or model forwarding can ship while this suite remains green; add focused read-only and fix argument tests, preferably around an extracted argument builder.

AGENTS.md reference: AGENTS.md:L34-L40

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 2:22 PM ET / 18:22 UTC.

ClawSweeper review

What this changes

Adds a local Devin CLI provider for Clawpatch map, review, fix, revalidate, and doctor workflows, with registry, helper-test, and provider-documentation updates.

Merge readiness

Blocked until real behavior proof is added - 7 items remain

This remains a useful but unproven new provider feature: current main does not contain Devin support, while the PR still lacks coverage for its safety-critical command arguments and inspectable after-fix runtime proof. It also needs maintainer confirmation that this provider-specific credential and permission contract belongs in core.

Priority: P3
Reviewed head: ffe908324c6d462dddc22e1666250131e7dbf49a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation follows existing provider structure, but missing live proof and an unaddressed safety-critical command-construction test gap prevent merge readiness.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The body reports tests and CLI flag discovery but contains no inspectable redacted terminal output, runtime log, recording, or artifact showing a successful Devin-backed Clawpatch command after this change; add live proof and update the PR body for re-review, redacting credentials and private endpoints.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The body reports tests and CLI flag discovery but contains no inspectable redacted terminal output, runtime log, recording, or artifact showing a successful Devin-backed Clawpatch command after this change; add live proof and update the PR body for re-review, redacting credentials and private endpoints.
Evidence reviewed 5 items Current main does not implement Devin support: The checked-out current-main provider registry lists acpx, claude, codex, cursor, grok, mock, opencode, and pi, but not devin. The requested provider capability is therefore not already implemented.
Command safety arguments lack direct coverage: The branch selects auto for read-only operations and accept-edits for fix while constructing the Devin subprocess invocation, but the added tests cover only prompt text, timeout precedence, and failure previews. Repository policy specifically calls for provider command-construction tests.
Prior P1 remains unresolved at the identical head: The prior ClawSweeper review raised the same command-construction concern at ffe9083; the current PR head is still that SHA, and its Devin helper tests still do not invoke the provider or assert its CLI arguments.
Findings 1 actionable finding [P1] Cover Devin permission-mode command arguments
Security Needs attention Permission-mode boundary is unproven: Read-only workflows depend on --permission-mode auto, while fix uses accept-edits; a regression in this argument construction could silently weaken the advertised review safety boundary.

How this fits together

Clawpatch selects a named local coding-agent provider, writes the workflow prompt to a temporary file, invokes the provider CLI, and schema-validates its JSON response. This PR adds Devin at that boundary, where the selected permission mode determines whether a workflow is intended to be read-only or able to edit the checkout.

flowchart LR
  A[Clawpatch command] --> B[Provider selection]
  B --> C[Devin provider]
  C --> D[Temporary prompt file]
  D --> E[Devin CLI permission mode]
  E --> F[JSON response]
  F --> G[Schema validation]
  G --> H[Workflow result]
Loading

Decision needed

Question Recommendation
Should Clawpatch core support Devin as a first-class provider with ambient credential discovery and a provider-specific permission-mode safety contract? Sponsor the Devin provider: Accept the new core provider after focused argument coverage and redacted live proof validate the proposed safety contract.

Why: Tests and runtime proof can validate the implementation, but they cannot determine whether this durable provider, credential, and safety commitment belongs in core.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The body reports tests and CLI flag discovery but contains no inspectable redacted terminal output, runtime log, recording, or artifact showing a successful Devin-backed Clawpatch command after this change; add live proof and update the PR body for re-review, redacting credentials and private endpoints.
  • Cover Devin permission-mode command arguments (P1) - The new helper tests only inspect prompt text, timeout precedence, and error previews; none exercise the provider or assert --print, --prompt-file, --model, or the read-only auto versus fix accept-edits arguments. This leaves the provider’s safety boundary unguarded despite the repository policy requiring provider command-construction coverage.
  • Resolve security concern: Permission-mode boundary is unproven - Read-only workflows depend on --permission-mode auto, while fix uses accept-edits; a regression in this argument construction could silently weaken the advertised review safety boundary.
  • Resolve merge risk (P1) - Read-only workflows rely on Devin's provider-specific --permission-mode auto contract, yet the branch has neither direct argument tests nor inspectable live evidence that validates the claimed boundary.
  • Resolve merge risk (P1) - Adding a named provider expands the supported CLI and credential boundary; maintainers must explicitly accept ambient-environment inheritance and Devin permission semantics as a core support contract.
  • Complete next step (P2) - A maintainer must decide whether the proposed Devin provider contract belongs in core; the contributor can then address the specific test and real-behavior proof gaps.

Findings

  • [P1] Cover Devin permission-mode command arguments — src/providers/devin.ts:93-102
  • [medium] Permission-mode boundary is unproven — src/providers/devin.ts:97
Agent review details

Security

Needs attention: The patch adds a third-party CLI execution and permission boundary, but the selected safety arguments are neither directly tested nor backed by inspectable live behavior proof.

Review metrics

Metric Value Why it matters
Provider surface 1 new provider; 5 workflow methods The new backend becomes available to map, review, fix, revalidate, and doctor users.
Patch size 264 added, 15 removed across 6 files Most of the patch is a new subprocess integration plus supporting tests and docs.

Merge-risk options

Maintainer options:

  1. Prove and test the permission boundary (recommended)
    Add command-argument tests for read-only and fix flows, then post redacted live output confirming a successful Devin-backed Clawpatch command without exposing credentials.
  2. Accept the provider contract explicitly
    A maintainer may accept ambient credential inheritance and Devin permission-mode semantics as the supported core-provider contract after reviewing the runtime proof.
  3. Pause core-provider expansion
    Close or defer this PR if maintainers do not want a provider-specific credential and permission boundary in Clawpatch core.

Technical review

Best possible solution:

Keep the provider addition narrow, add focused tests for the exact Devin argument lists, attach redacted live proof for doctor plus a successful read-only workflow, and merge only after maintainers approve the resulting provider and credential contract.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds a new provider rather than fixing established broken behavior. Its claimed live integration remains unproven because no inspectable successful Devin-backed Clawpatch run is attached.

Is this the best way to solve the issue?

Unclear: the local-provider shape matches existing integrations, but core acceptance depends on maintainer approval of Devin’s ambient-auth and permission-mode contract; the present patch also needs direct command-argument coverage.

Full review comments:

  • [P1] Cover Devin permission-mode command arguments — src/providers/devin.ts:93-102
    The new helper tests only inspect prompt text, timeout precedence, and error previews; none exercise the provider or assert --print, --prompt-file, --model, or the read-only auto versus fix accept-edits arguments. This leaves the provider’s safety boundary unguarded despite the repository policy requiring provider command-construction coverage.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4eed9cd13c15.

Labels

Label justifications:

  • P3: This is a speculative provider addition, not a demonstrated regression in an existing workflow.
  • merge-risk: 🚨 security-boundary: Read-only workflow safety and credential exposure depend on a new third-party CLI permission mode and ambient environment behavior.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports tests and CLI flag discovery but contains no inspectable redacted terminal output, runtime log, recording, or artifact showing a successful Devin-backed Clawpatch command after this change; add live proof and update the PR body for re-review, redacting credentials and private endpoints.

Evidence

Security concerns:

  • [medium] Permission-mode boundary is unproven — src/providers/devin.ts:97
    Read-only workflows depend on --permission-mode auto, while fix uses accept-edits; a regression in this argument construction could silently weaken the advertised review safety boundary.
    Confidence: 0.95

What I checked:

  • Current main does not implement Devin support: The checked-out current-main provider registry lists acpx, claude, codex, cursor, grok, mock, opencode, and pi, but not devin. The requested provider capability is therefore not already implemented. (src/provider.ts:16, 4eed9cd13c15)
  • Command safety arguments lack direct coverage: The branch selects auto for read-only operations and accept-edits for fix while constructing the Devin subprocess invocation, but the added tests cover only prompt text, timeout precedence, and failure previews. Repository policy specifically calls for provider command-construction tests. (src/providers/devin.ts:93, ffe908324c6d)
  • Prior P1 remains unresolved at the identical head: The prior ClawSweeper review raised the same command-construction concern at ffe9083; the current PR head is still that SHA, and its Devin helper tests still do not invoke the provider or assert its CLI arguments. (src/provider.test.ts:1841, ffe908324c6d)
  • No inspectable real behavior proof: The PR body reports checks and CLI-flag discovery, but leaves the planned doctor, review, and map runs unchecked and provides no redacted terminal output, runtime log, recording, or linked artifact showing a successful Devin-backed Clawpatch workflow. (ffe908324c6d)
  • Likely owner provenance: Current provider registry and comparable provider files attribute to Peter Steinberger in the checked-out main snapshot. The related merged Claude provider PR establishes the analogous local-CLI provider pattern and was authored by aurokin before merge commit 2d0059a. (src/provider.ts:5, 3c2a1a4e2d04)

Likely related people:

  • steipete: The checked-out current provider registry and comparable Grok provider lines attribute to Peter Steinberger, including the current release snapshot. (role: recent provider-area contributor; confidence: high; commits: 3c2a1a4e2d04, d1928f471899, 87f0350def72; files: src/provider.ts, src/providers/grok.ts, docs/providers.md)
  • aurokin: The merged Claude provider work is a close implementation precedent for this local-agent provider surface. (role: analogous provider feature author; confidence: medium; commits: 2d0059a9a8e0; files: src/providers/claude.ts, src/provider.ts, docs/providers.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add focused tests that assert the exact Devin argument lists for a read-only workflow, fix, and optional model forwarding.
  • Post redacted terminal output from clawpatch doctor --provider devin and one successful read-only Devin-backed workflow, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.
  • Obtain maintainer confirmation that this provider’s ambient-auth and permission model belongs in core.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-02T09:50:30.371Z sha ffe9083 :: needs real behavior proof before merge. :: [P1] Cover the Devin command and permission arguments
  • reviewed 2026-08-02T11:14:06.121Z sha ffe9083 :: needs real behavior proof before merge. :: [P1] Cover the Devin command and permission arguments
  • reviewed 2026-08-02T12:47:27.438Z sha ffe9083 :: needs real behavior proof before merge. :: [P1] Cover the Devin command and permission arguments
  • reviewed 2026-08-02T15:26:13.275Z sha ffe9083 :: needs real behavior proof before merge. :: [P1] Add tests for Devin permission arguments

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 2, 2026
@ademiwa ademiwa closed this by deleting the head repository Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant