Skip to content

feat(agents): add devin adapter#132

Closed
yyovil wants to merge 1 commit into
agents/12-continuefrom
agents/13-devin
Closed

feat(agents): add devin adapter#132
yyovil wants to merge 1 commit into
agents/12-continuefrom
agents/13-devin

Conversation

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 6, 2026

Greptile Summary

This PR introduces the Devin for Terminal (Cognition) agent adapter, wired into the registry alongside the existing grok, goose, and other adapters. The implementation delegates hook installation to claudecode.Plugin via Devin's documented Claude Code compatibility layer, maps AO's four permission modes onto Devin's two (auto / dangerous), and restores sessions with -r <agentSessionId>.

  • New adapter (devin/devin.go): binary resolution, launch/restore command construction, permission flag mapping, and SessionInfo reading hook-written metadata — all modelled closely on the grok adapter.
  • Registry + wiring test: devin.New() added to Constructors() and HarnessDevin added to the resolver smoke test, completing the integration.

Confidence Score: 4/5

Safe to merge after fixing the metadata key inconsistency in SessionInfo — title and summary will silently vanish if shared port constants are ever renamed.

The adapter correctly delegates hook installation, binary resolution, and permission mapping. The one real defect is in SessionInfo: it reads Title and Summary via private local string constants that duplicate the shared ports.MetadataKeyTitle and ports.MetadataKeySummary constants that the installed hooks actually write. Because the string values currently match, session info works today, but the devin adapter is silently decoupled from the shared vocabulary — a rename of those constants would break devin's title/summary without a compile error.

backend/internal/adapters/agent/devin/devin.go — the SessionInfo function and the devinTitleMetadataKey/devinSummaryMetadataKey const block; also update the corresponding map keys in devin_test.go.

Important Files Changed

Filename Overview
backend/internal/adapters/agent/devin/devin.go New Devin adapter mirroring the grok structure; SessionInfo uses private local constants instead of the shared ports.MetadataKeyTitle/ports.MetadataKeySummary that the installed hooks actually write, creating a silent divergence risk.
backend/internal/adapters/agent/devin/devin_test.go Comprehensive unit tests covering all adapter methods; TestSessionInfoReadsHookMetadata should use ports.MetadataKeyTitle/ports.MetadataKeySummary as map keys once the production code is updated to the shared constants.
backend/internal/adapters/agent/registry/registry.go Straightforward devin.New() insertion into the Constructors slice following the same pattern as all other adapters; no issues.
backend/internal/daemon/wiring_test.go Adds {domain.HarnessDevin, devin} to the resolver smoke test; correct and follows the established pattern.

Sequence Diagram

sequenceDiagram
    participant AO as AO Session Manager
    participant DP as devin.Plugin
    participant CC as claudecode.Plugin
    participant DV as devin binary

    AO->>DP: GetAgentHooks(ctx, cfg)
    DP->>CC: GetAgentHooks(ctx, cfg)
    CC-->>DP: writes .claude/settings.local.json
    DP-->>AO: ok

    AO->>DP: GetLaunchCommand(ctx, cfg)
    DP->>DP: devinBinary() [resolve + cache]
    DP-->>AO: [devin, --permission-mode, auto, -p, prompt]

    AO->>DV: exec launch command
    DV-->>AO: hook payloads (SessionStart → agentSessionId, title, summary)

    AO->>DP: GetRestoreCommand(ctx, cfg)
    DP-->>AO: [devin, --permission-mode, dangerous, -r, sessionID]

    AO->>DP: SessionInfo(ctx, session)
    DP-->>AO: "SessionInfo{AgentSessionID, Title, Summary}"
Loading

Reviews (2): Last reviewed commit: "feat(agents): add devin adapter" | Re-trigger Greptile

Comment thread backend/internal/adapters/agent/devin/devin.go Outdated
Comment thread backend/internal/adapters/agent/devin/devin.go Outdated
Registers the devin harness, stacked on the agent platform.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants