Repository navigation
feat(bin): add Devin CLI as a verified crewmate/scout worker adapter - #5188
Closed
belyaev-den wants to merge 5 commits into
Closed
belyaev-den wants to merge 5 commits into
belyaev-den wants to merge 5 commits into
Conversation
Owner
|
thanks @belyaev-den - this was the right base. we built on it directly in #5380 (your five commits kept with your authorship) and added three fixes on top: no paired Escape on an idle Devin (the revert picker), workers no longer import the user's Claude Code hooks, and no Devin co-author trailer. 5380 is merged, so closing this as superseded. appreciate it! |
This was referenced Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Add Devin CLI as a worker runtime for firstmate: "what'd ya think about running dev with fusion as an implementer" - "devin cli & https://cognition.com/blog/devin-fusion - fable w/ free SWE-2 model" - route 2 of the two offered (a full verified Devin CLI adapter so firstmate can launch, steer, and watch Devin workers, unlocking both the free SWE-2 model and the paid Fusion lead-plus-sidekick pairings): "2 lgtm" - "paying for fusion - i approve".
Context: Devin CLI 3000.10.21 is installed at ~/.local/bin/devin and signed in (Devin Max plan).
devin models listshows SWE-2 (swe-2-medium|high|max, free) and Fusion pairings (fusion-<lead>-sidekick-swe-2-medium, e.g.fusion-claude-fable-5-1-high-sidekick-swe-2-medium,fusion-gpt-5-6-sol-high-sidekick-swe-2-medium).devin --helpshows--model <MODEL>,-p/--printnon-interactive mode,--permission-mode auto|accept-edits|smart|dangerous,--respect-workspace-trust false,--prompt-file,--export [PATH](exports after each turn),-c/--continue,-r/--resume [SESSION_ID],--config, anddevin acp(Agent Client Protocol server over stdio). The captain approved Devin-billed Fusion pairings for workers; crewmate and scout use is the goal, not secondmate or primary use.What Changed
devinas a verified crewmate/scout-only harness acrossfm-spawn.sh,fm-control-lib.sh,fm-busy-lib.sh,fm-composer-lib.sh,fm-harness.sh,fm-agent-process-lib.sh, andfm-bootstrap.sh: spawns launchdevin --permission-mode dangerous --respect-workspace-trust false --config <per-task snapshot> [--model <id>] -- <typed brief>, accept SWE-2 and Fusion model ids via--model, record--effortwithout passing it, and refuse--secondmate. Devin interrupt is a double Escape, exit is/quit, and the❭glyph, idle placeholder, and "esc twice to interrupt" / "Guide Devin while it works" footers are recognized as composer and delivery signals.bin/fm-devin-config.sh, which writes a mode-600 per-taskstate/<id>.devin-config.jsonsnapshot of the user's Devin config with generation-boundUserPromptSubmit/Stop/SessionEndbusy-state hooks appended;fm-control.sh interruptinvalidates the Devin busy record tounknown(cancel unconfirmed) because Devin emits noStopon cancellation, andfm-teardown.shremoves the config file.tests/fm-devin-harness.test.sh), an opt-in credentialed live guard (tests/fm-devin-signals-live-e2e.test.sh, gated byFM_DEVIN_SIGNALS_LIVE=1), new control/bootstrap test cases, theharness-adaptersDevin reference,docs/verification/devin.md, and Devin mentions in AGENTS.md and the configuration, agent-control, architecture, backend, and trace-context docs.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The adapter follows the verified gemini/agy pattern at every enumeration site, the generation-bound hook wiring and conservative interrupt invalidation trace correctly, prior review-round fixes are intact, and the final commit is documentation only.
Testing
Ran the portable Devin adapter regression, the fm-control suite (including the new Devin interrupt invalidation test), and the fm-bootstrap suite (including no-key acceptance of a devin dispatch profile) as the baseline; all passed. Then drove the product live three times against the real Devin CLI in isolated homes with copied credentials and private tmux sockets: the credentialed guard with swe-2-medium, the same guard with the approved Fusion pairing, and a manual capture drive with swe-2-medium that kept styled 120x40 pane captures at launch-busy, idle, doorbell, busy-before-interrupt, canceled, and exited states, rendered into an HTML artifact. The manual drive also drove the real spawn path with --secondmate --harness devin and got the crewmate/scout-only refusal. Every live-driven scenario passed. The stale-generation Stop hook / malformed config scenario and the no-key bootstrap acceptance scenario were exercised only by the portable test suites, not against the live product, so they are recorded as untested live. The worktree is clean and my task temp directories were removed.
devinfrom inside its own shell tool despite inherited foreign markers (bin/fm-harness.sh output written to harness.txt)unknown fm-interruptwith cancel=uncon…devin -r <session>resume with the private config reprocesses a new prompt (resumed.txt=493) and emits SessionStart source=resumeEvidence: Rendered tmux pane captures of the Devin worker lifecycle (launch busy, idle, doorbell, busy before interrupt, canceled, exited)
Source: Rendered tmux pane captures of the Devin worker lifecycle (launch busy, idle, doorbell, busy before interrupt, canceled, exited)
Evidence: Live guard transcript, free SWE-2 Medium
Source: Live guard transcript, free SWE-2 Medium
ok - devin 3000.11.1 (cc4e349ca55e): spawn brief, model, autonomy, trust, identity and native Stop ok - devin 3000.11.1 (cc4e349ca55e): real fm-send doorbell read and acknowledged 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 ... exit=0 duration_ms=263460Evidence: Live guard transcript, Fusion (Claude Fable 5.1 High + SWE-2 Medium)
Source: Live guard transcript, Fusion (Claude Fable 5.1 High + SWE-2 Medium)
ok - devin 3000.11.1 (cc4e349ca55e): spawn brief, model, autonomy, trust, identity and native Stop ok - devin 3000.11.1 (cc4e349ca55e): real fm-send doorbell read and acknowledged 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 ... exit=0 duration_ms=73628Evidence: Manual live drive log (busy transitions, composer verdict, interrupt and exit outcomes)
Source: Manual live drive log (busy transitions, composer verdict, interrupt and exit outcomes)
busy after spawn: busy fm-spawn busy during launch brief: busy devin-hook ok - launch brief executed (answer.txt=80235), Stop hook settled to idle devin-hook, agent alive idle composer verdict: empty ok - fm-send doorbell: steer.txt=1147, inbox message acknowledged into handled/, settled to idle devin-hook busy after interrupt: unknown fm-interrupt ok - fm-control interrupt: Devin rendered Canceled, agent alive, state unknown fm-interrupt, cancel=unconfirmed ok - fm-control exit: /quit returned the pane to a shellEvidence: Generated Devin launch command from fm-spawn
Source: Generated Devin launch command from fm-spawn
env -u CLAUDECODE -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS -u FM_OMP_HARNESS -u ATLASSIAN_AGENT_TYPE -u ROVODEV_CLI -u NO_COLOR '<lab>/fake/fakebin/devin' --permission-mode dangerous --respect-workspace-trust false --config '<lab>~/devin-manual.devin-config.json' --model 'swe-2-medium' -- "$(fm-operational-input.sh encode launch-brief < launch-brief.md)"Evidence: Private per-task Devin config with appended lifecycle hooks
Source: Private per-task Devin config with appended lifecycle hooks
Evidence: Real spawn refusal of a Devin secondmate
Source: Real spawn refusal of a Devin secondmate
error: devin is a verified crewmate/scout adapter only and cannot run a secondmate; it has no primary supervision protocol. Select a harness verified for secondmates.Evidence: Pane capture after fm-control interrupt (plain text)
Source: Pane capture after fm-control interrupt (plain text)
Evidence: Manual drive script used to produce the captures
Source: Manual drive script used to produce the captures
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-control.sh:438- Full pass over aec043c..02a5aff found no new defect. Traced paths: (1) spawn:devinresolves DEVIN_BIN before endpoint creation, arms a busy generation (bin/fm-spawn.sh:4074), writes the private config with that generation (bin/fm-spawn.sh:4117), substitutes DEVINBIN/DEVINCONFIG into the template, and refuses --secondmate (bin/fm-spawn.sh:2136); relaunch retires the prior config through fm_control_harness_wiring_paths (bin/fm-spawn.sh:4038 -> bin/fm-control-lib.sh:325) and re-arms. (2) hooks: bin/fm-devin-config.sh single-quotes every path, starts from {} when the user config is absent, refuses malformed input before replacing the prior file, and appends rather than overwrites user Stop/UserPromptSubmit/SessionEnd entries; apply calls are generation-bound so a stale Stop cannot clear a replacement. (3) classification:devin-hook fm-spawn fm-interrupt fm-recoveryare the trusted sources, and the record path (bin/fm-busy-lib.sh:914-925) yieldsbusy devin-hook,idle devin-hook, orunknown fm-interruptas the tests assert. (4) interrupt: deliver_interrupt captures the armed gen before two Escape presses 0.2s apart and writesunknownonly when a gen exists, so raw-launch tasks with no armed contract are untouched;exitinterrupts only on a busy verdict. (5) identity: exactdevincomm ancestry beats a foreign CLAUDECODE, and the process classifier anchorsdevinexactly like agy. The final commit 02a5aff changes only comments and docs. New tests execute the generated hook commands and the real spawn/control entry points rather than grepping source; the launch-log and meta assertions read generated interfaces and persisted state. Intent conformance holds: SWE-2 and Fusion model ids pass through --model unchanged, crewmate/scout dispatch is enabled, and primary/secondmate use is refused at spawn and at relaunch.✅ **Test** - passed
✅ No issues found.
devinfrom inside its own shell tool despite inherited foreign markers (bin/fm-harness.sh output written to harness.txt)unknown fm-interruptwith cancel=uncon…devin -r <session>resume with the private config reprocesses a new prompt (resumed.txt=493) and emits SessionStart source=resumebin/fm-test-run.sh tests/fm-devin-harness.test.sh(portable adapter regression: identity, worker-only kinds, composer safety, private config, spawn launch shape)bin/fm-test-run.sh tests/fm-control.test.sh(control-plane tables plus new Devin interrupt invalidation test)bin/fm-test-run.sh tests/fm-bootstrap.test.sh(no-key bootstrap accepts a devin crew-dispatch profile)FM_DEVIN_SIGNALS_LIVE=1 bin/fm-test-run.sh tests/fm-devin-signals-live-e2e.test.sh(live, swe-2-medium, exit 0 in 263s)FM_DEVIN_SIGNALS_LIVE=1 FM_DEVIN_MODEL=fusion-claude-fable-5-1-high-sidekick-swe-2-medium bin/fm-test-run.sh tests/fm-devin-signals-live-e2e.test.sh(live, Fusion pairing, exit 0 in 74s)Manual live drivedevin-manual-drive.sh(evidence dir): real fm-spawn launch of devin in a private tmux server, busy classification at each stage, idle composer verdict, real fm-send doorbell, fm-control interrupt and exit, pane captures at 7 lifecycle pointsManual adversarial check: real fm-spawn--secondmate --harness devinrefused with the crewmate/scout-only errorInspected generated launch command, task meta (model/effort recorded, effort absent from argv), and private per-task Devin config with appended lifecycle hooks✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.