Skip to content

feat: add Devin CLI crewmate and scout adapter - #5380

Merged
kunchenguid merged 9 commits into
mainfrom
fm/fm-devin-worker-adapter-r1
Sep 23, 2026
Merged

kunchenguid merged 9 commits into
mainfrom
fm/fm-devin-worker-adapter-r1

Conversation

@kunchenguid

@kunchenguid kunchenguid commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Intent

Chosen: option A - firstmate ships the Devin CLI crewmate/scout adapter itself on top of external PR #5188, crediting the contributor, fixing the three must-fixes, with live checks.

Context: the original ask was to look into supporting Devin CLI in firstmate as a crewmate harness (and optionally as a firstmate harness), consistent with how other harnesses are supported, after checking whether it is already supported or an open PR already implements it the way we would. The feasibility report (data/fm-devin-harness-feasibility-s1/report.md, read it in full) found that firstmate has no Devin support, and that PR 5188 by @belyaev-den already builds a crewmate/scout-only adapter in the verified Gemini/AGY pattern. It applies to current main with one trivial conflict (the test-family list in bin/fm-test-run.sh) and its suites pass. Three gaps must be fixed before landing:

  1. On an idle Devin, a double Escape opens a picker whose Enter reverts file changes, and the PR's interrupt and exit paths can deliver that double Escape to an idle worker.
  2. Devin silently runs the captain's Claude Code hooks (verified), including Herdr's Claude hook, which would likely mislabel a Devin pane as Claude.
  3. Devin adds a "Co-Authored-By: Devin" trailer to commits by default, which breaks the no-agent-co-author rule.
    The separate question of Devin as a primary or secondmate harness was not answered and is out of scope.

What Changed

  • Add Devin CLI as a crewmate/scout harness with spawn, detection, composer, lifecycle-hook, and control-plane support; primary and secondmate launches remain unsupported. Builds on @belyaev-den’s work in feat(bin): add Devin CLI as a verified crewmate/scout worker adapter #5188.
  • Use a private per-task config to disable Claude Code imports and Devin commit attribution. Guard double-Escape interrupts against the idle revert picker and invalidate busy state conservatively after cancellation.
  • Add adapter documentation and portable and live verification coverage.

Credit, related work, and known limitation

Known limitation - Herdr exit and relaunch. On the Herdr backend, fm-control exit and fm-control relaunch refuse for a Devin worker. Nothing is typed and nothing is lost. The reason: Herdr reads carry no cursor, so the shared cursorless composer classifier finds Devin's ❭ composer row but reads the plain rule drawn under it as an unpaired Pi separator and answers unknown, and exit requires a proven-empty composer (relaunch exits first). Interrupt, steering, native Devin pane identity, and liveness all work on Herdr (verified in a named Herdr 0.9.0 lab). Follow-up fm-devin-herdr-composer-frame-r1 teaches the shared classifier Devin's frame. tmux is unaffected.

Follow-ups not built here (should-fix gaps from the feasibility review):

  • JSON-with-comments user configs make the per-task config snapshot refuse to spawn.
  • No --model validation against devin models list --format json.
  • Steering a busy worker: one live check passed (queued, not cancelled), but there is no dedicated guard against a retry Enter on an empty busy composer cancelling the turn.
  • The styled-composer guard depends on the user's theme_mode; pinning theme_mode and show_hints in the worker config is not done.
  • Herdr: the exit/relaunch limitation above; Herdr's own devin integration was not installed or exercised.
  • /no-mistakes slash submission was verified once live and recorded, but has no dedicated guard.
  • --config first-run behavior was checked once in a real home (no org or first-run dialog) but is not guarded.

Risk Assessment

⚠️ Medium: The worker-only adapter and three required safeguards are source-backed, but lifecycle control depends on version-specific rendered signals and has limited live backend coverage.

Testing

A credentialed Devin worker launched in isolated tmux completed a brief, committed without agent attribution, ignored Claude hooks, handled steering and safe idle/busy interrupts, exited, and resumed. A named Herdr lab reported the worker as Devin and showed no Claude hook execution; its default-session tripwire passed on teardown. Targeted adapter and control tests passed. The broader bootstrap test was interrupted by the command timeout, and its result is not claimed.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Launch a Devin scout, complete a brief, steer it, and resume after exit ✅ pass live Credentialed Devin worker end-to-end run
Interrupt an idle Devin without opening or acting on its file-revert picker ✅ pass live Credentialed Devin worker end-to-end run: idle interrupt, raw picker, refused exit, dismissal, and unchanged files
Interrupt a busy Devin without mistaking cancellation for an idle turn ✅ pass live Credentialed Devin worker end-to-end run: cancellation and unknown busy state
Run a Devin worker with Claude hooks present without executing them or misidentifying the Herdr pane ✅ pass live Credentialed Devin worker end-to-end run; Named Herdr lab product observations and teardown
Have the Devin worker make a commit without an agent co-author trailer ✅ pass live Credentialed Devin worker end-to-end run: worker-created commit message checked for attribution
Evidence: Credentialed Devin worker end-to-end run

Source: Credentialed Devin worker end-to-end run

FM_TEST_BEGIN 2026-09-23T05:11:38Z tests/fm-devin-signals-live-e2e.test.sh family=live-harness-optin expected_gate_skip=live-capability
ok - devin 3000.11.1 (cc4e349ca55e): spawn brief, model, autonomy, trust, identity and native Stop
ok - devin 3000.11.1 (cc4e349ca55e): no Claude Code hook ran and the worker commit carries no attribution
ok - devin 3000.11.1 (cc4e349ca55e): real fm-send doorbell read and acknowledged
ok - devin 3000.11.1 (cc4e349ca55e): idle interrupt sends one press; an open revert picker blocks exit and is closed without reverting
ok - devin 3000.11.1 (cc4e349ca55e): double Escape cancels, preserves agent, and invalidates busy state
ok - devin 3000.11.1 (cc4e349ca55e): /quit and native -r session resume
FM_TEST_END 2026-09-23T05:12:58Z tests/fm-devin-signals-live-e2e.test.sh exit=0 duration_ms=79884 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=79959
FM_TEST_SUMMARY_FAMILY family=live-harness-optin count=1 duration_ms=79884 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-devin-signals-live-e2e.test.sh duration_ms=79884
Evidence: Named Herdr lab product observations and teardown

Source: Named Herdr lab product observations and teardown

session=fm-lab-devin-nm-13794-3058
native-agent=devin:idle
proof=42
Claude-hook=absent
lab-teardown=tripwire verified

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - medium risk

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Launch a Devin scout, complete a brief, steer it, and resume after exit ✅ pass live Credentialed Devin worker end-to-end run
Interrupt an idle Devin without opening or acting on its file-revert picker ✅ pass live Credentialed Devin worker end-to-end run: idle interrupt, raw picker, refused exit, dismissal, and unchanged files
Interrupt a busy Devin without mistaking cancellation for an idle turn ✅ pass live Credentialed Devin worker end-to-end run: cancellation and unknown busy state
Run a Devin worker with Claude hooks present without executing them or misidentifying the Herdr pane ✅ pass live Credentialed Devin worker end-to-end run; Named Herdr lab product observations and teardown
Have the Devin worker make a commit without an agent co-author trailer ✅ pass live Credentialed Devin worker end-to-end run: worker-created commit message checked for attribution
  • TMPDIR="$PWD/.test-temp" bin/fm-test-run.sh --jobs 1 tests/fm-devin-harness.test.sh tests/fm-control.test.sh tests/fm-bootstrap.test.sh (first two completed; command timed out during bootstrap)
  • TMPDIR="$PWD/.test-temp" FM_DEVIN_SIGNALS_LIVE=1 bin/fm-test-run.sh tests/fm-devin-signals-live-e2e.test.sh
  • bin/fm-herdr-lab.sh provision/run/teardown <named fm-lab session> with an isolated Devin home and fm-devin-config.sh; checked native agent identity, generated file, and Claude hook absence
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.