Skip to content

feat(agents): add Devin integration - #794

Open
HashemKhalifa wants to merge 5 commits into
ScriptedAlchemy:codex/tracedecay-total-redesign-plan-reopenedfrom
HashemKhalifa:codex/devin-local-integration
Open

feat(agents): add Devin integration#794
HashemKhalifa wants to merge 5 commits into
ScriptedAlchemy:codex/tracedecay-total-redesign-plan-reopenedfrom
HashemKhalifa:codex/devin-local-integration

Conversation

@HashemKhalifa

@HashemKhalifa HashemKhalifa commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Why

TraceDecay's redesigned host architecture supports independent integrations for Codex, Cursor, Claude, and other agent hosts, but it did not yet model Devin. Devin has its own local MCP registry and CLI contract, so treating it as an alias of another host would make lifecycle behavior, diagnostics, and future host capabilities ambiguous.

This change adds Devin as its own host while following Devin's existing stdio MCP configuration contract. It targets the PR #707 redesign branch so the integration lands on the new host architecture rather than the legacy implementation.

What Changed

Independent Devin host

  • Adds HostKindV1::Devin, the devin stable identifier, and the Devin display name.
  • Registers Devin through the host descriptor, catalog, capability admission, component registration, and V2 host-bundle paths.
  • Appends Devin after Copilot in the stock capability table so every established host keeps its existing position.

User and project MCP lifecycle

  • tracedecay install --agent devin manages the user registry at ~/.config/devin/mcp_config.json.
  • tracedecay install --agent devin --local manages the shared project registry at .devin/mcp_config.json.
  • Installs TraceDecay as an stdio MCP server with the resolved TraceDecay executable, args: ["serve"], and an empty environment map.
  • Supports install, doctor, repair, reinstall, and uninstall through the normal host lifecycle.
  • Preserves unrelated MCP servers and other Devin settings during install and uninstall.
  • Treats an omitted disabled field as enabled, matching Devin's documented entry shape.
  • Leaves .devin/mcp_config.local.json and Devin permission modes unchanged.
  • Avoids warning about a missing optional project registry until the project registry exists.

Documentation

  • Adds Devin to the README integration and quick-install guidance.
  • Adds user-guide installation, project-scope, verification, and uninstall instructions.
  • Adds docs/DEVIN-INTEGRATION.md with the supported scopes, native Devin CLI equivalents, ownership boundaries, and permission behavior.

Devin Contract Checks

The adapter was checked against Devin's local MCP behavior:

  • User registry: ~/.config/devin/mcp_config.json
  • Shared project registry: .devin/mcp_config.json
  • Personal project registry: .devin/mcp_config.local.json (intentionally unmanaged)
  • Registration object: command, args, env, and stdio transport
  • Native CLI scopes: user and project

The native CLI round trip was also exercised with:

devin mcp add --scope project --env TRACEDECAY_TEST=1 tracedecay -- /usr/bin/true serve
devin mcp get tracedecay

The returned registration preserved the executable, serve argument, environment entry, and transport: "stdio" shape expected by the adapter.

Test Coverage Added

  • Devin user and project paths remain distinct.
  • A documented server entry without disabled is recognized as current.
  • Project install and uninstall preserve sibling MCP servers and unrelated Devin settings.
  • The production CLI reaches Devin project installation through --local without touching sibling configuration.
  • Host descriptors and catalog entries expose Devin under its independent stable identity.
  • Stock host ordering preserves every existing row and appends Devin after Copilot.

Validation

Completed:

  • Native Devin CLI add/get round trip described above.
  • cargo test -p tracedecay-agent-hosts devin --lib — 4 passed, 0 failed.
  • cargo test -p tracedecay-domain --test integration_catalog_contract stock_host_order_preserves_existing_rows_and_appends_devin -- --exact — 1 passed, 0 failed. This assertion was completed through an intentional red/green TDD cycle.
  • cargo test -p tracedecay-domain --test host_descriptor_contract — 5 passed, 0 failed.
  • cargo test -p tracedecay-cli --features test-transport --test host_lifecycle_cli_acceptance production_cli_installs_devin_project_mcp_without_touching_siblings -- --exact — 1 passed, 0 failed.
  • git diff --check.
  • Independent review findings around optional disabled, project lifecycle reachability, project doctor behavior, and configuration preservation were addressed.

Reviewer Notes

  • Devin is an independent integration, not a Cursor alias and not a separate product named "Devin Local" or "DevinAI".
  • The adapter owns only mcpServers.tracedecay; it does not replace the registry or mutate Devin's permission policy.
  • Missing project configuration remains a valid state because project registration is opt-in.
  • This is a draft against codex/tracedecay-total-redesign-plan-reopened; it should land with the PR feat: consolidate TraceDecay V2 PR8-PR13 delivery #707 architecture and is not a standalone release or runtime activation.

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1045503

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@HashemKhalifa HashemKhalifa changed the title feat(agents): add Devin Local integration feat(agents): add Devin integration Sep 2, 2026
@HashemKhalifa
HashemKhalifa marked this pull request as ready for review September 2, 2026 15:08
@HashemKhalifa

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T15:17:47.286955Z e4bb218 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: e4bb218670

ℹ️ 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 on lines +190 to +193
let command_is_present = server
.get("command")
.and_then(serde_json::Value::as_str)
.is_some_and(|command| !command.is_empty());

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 Validate the executable before declaring Devin current

When an existing mcpServers.tracedecay entry contains any non-empty command and a serve argument, this returns Current without comparing the command to InstallContext.tracedecay_bin. The canonical Install preflight skips activation when every component is current, so reinstalling after the binary moves—or over an entry such as other-program serve—can report success while Devin continues launching the wrong executable. Add lifecycle-aware validation against the resolved TraceDecay path.

AGENTS.md reference: AGENTS.md:L9-L12

Useful? React with 👍 / 👎.

_ctx: &InstallContext,
project_path: &Path,
) -> Result<()> {
uninstall_mcp_if_selected(components, &devin_project_mcp_config_path(project_path))

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 Guard project containment before Devin uninstall

For a repository whose .devin directory is a symlink to a directory outside the project, the install path rejects the escape, but this uninstall path omits the same containment check. The shared config transaction follows a symlinked parent after canonicalizing it, so uninstall --local --agent devin can remove mcpServers.tracedecay from an external configuration; apply ensure_project_local_safe_paths before deactivation as the activation path does.

Useful? React with 👍 / 👎.

Comment on lines +54 to +58
doctor_check_mcp_registration(
dc,
&devin_mcp_config_path(&ctx.home),
"mcpServers",
load_json_file,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate runnable entries in Devin doctor checks

doctor_check_mcp_registration only verifies that mcpServers.tracedecay is an object, so configurations with disabled: true, no usable command, or arguments that omit serve receive a green “MCP server registered” result even though Devin cannot start TraceDecay. Use the Devin-specific registration-state validation for both user and project checks rather than reporting object presence as health.

AGENTS.md reference: AGENTS.md:L9-L12

Useful? React with 👍 / 👎.

Comment on lines +172 to +174
fn has_tracedecay(&self, home: &Path) -> bool {
super::mcp_config_has_tracedecay(&devin_mcp_config_path(home), "mcpServers", load_json_file)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make project-only Devin installs visible to doctor

When a user installs only .devin/mcp_config.json, this user-scoped has_tracedecay returns false. Doctor gates calls to healthcheck on that method (or reports_absence_to_doctor), and Devin overrides neither the latter nor detected_host_surface, so the project-health branch above is never executed and the local integration is omitted entirely from diagnostics. The doctor admission probe must account for the current project's registry.

AGENTS.md reference: AGENTS.md:L9-L12

Useful? React with 👍 / 👎.

"cursor_desktop",
"cursor_cloud",
"codex",
"devin",

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 Append Devin in the expected host-order array

HostKindV1::ALL appends Devin after Copilot to preserve established row positions, but this assertion inserts "devin" immediately after Codex. Consequently stock_host_kinds_project_only_fixture_backed_observation_integrations fails unconditionally at index 4 whenever the integration catalog test suite runs; move this expected value to the end.

Useful? React with 👍 / 👎.

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.

1 participant