Skip to content

feat(clients): register Factory Droid during setup - #2309

Merged
morluto merged 1 commit into
morluto:mainfrom
0xRafie:feat/setup-factory-droid
Oct 13, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
0xRafie:feat/setup-factory-droid

Conversation

@0xRafie

@0xRafie 0xRafie commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Registers Factory Droid (the droid CLI) as a supported client during npx rea-agents setup, following the Qoder registration (#1572). After this change, Droid users can install REA with one command: setup writes the rea MCP server into the user-level ~/.factory/mcp.json and installs the skill copy into ~/.factory/skills. No linked issue; I found no existing issue or PR for Droid support.

Problem and expected behavior

Factory Droid is not among the clients setup recognizes, so Droid users have to hand-edit ~/.factory/mcp.json and copy the skill themselves. Expected: after rea setup --client droid, mcpServers.rea exists in ~/.factory/mcp.json, the skill is installed under ~/.factory/skills/reverse-engineer-anything, doctor reports the registration as aligned, and uninstall removes exactly the rea entry and the skill copy.

Droid's configuration, per the official docs (MCP, skills):

  • User-level MCP servers live under the top-level mcpServers key of ~/.factory/mcp.json. A project-level .factory/mcp.json also exists; it is out of scope here.
  • Droid's own entries usually carry type (stdio or http), command, args, env and disabled. REA's existing json format writes command/args (plus env when needed) without type. With the real Droid CLI, such an entry is listed as a stdio server and connects (see Evidence).
  • Personal skills are discovered from ~/.factory/skills/<name>/SKILL.md.

Change and scope

  • SupportedClients: droid definition (display name "Factory Droid"): config path ~/.factory/mcp.json, marker ~/.factory, skills ~/.factory/skills, format json. No new dialect or code path.
  • Tests: new tests/boundary/filesystem/droidClientConfiguration.test.ts (6 cases); the clientLifecycle.test.ts expected detection list includes droid.
  • Docs: a row in the Supported agents table, a "Factory Droid" section in docs/client-configuration.md, and the client id in the skill's references/connection-and-recovery.md.
  • Intentionally out of scope: the project-level .factory/mcp.json, and a home-directory override variable (I found none documented by Factory, so none is honored).
  • The client id droid matches the CLI name; happy to rename it (for example factory_droid) if you prefer.

Contribution scope: a setup registration within existing boundaries, following the Qoder (#1572) and Qwen Code (#1415) registrations; maintainer scope decision not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: application-layer setup client registration (SupportedClients).
  • Contribution scope fit and linked maintainer decision: not applicable (see above).
  • CLI and MCP/tool-catalog contract: no tools added or changed; --client droid becomes a valid value.
  • Provider, bridge, target-format, or platform compatibility: adds the droid client, reusing the existing json configuration format.
  • Evidence, artifact, provenance, or reconstruction contract: not applicable.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): setup writes only mcpServers.rea; unrelated servers and Droid's top-level persistentPermissions are preserved. Uninstall removes only the rea entry and the skill copy.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none authored; generated catalogs stay CI-owned.

Expected effects (check known effects; use documentation-only on its own).

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

The two checked effects are setup's existing behavior (reading and writing the client's MCP config with a backup), now applied to ~/.factory/mcp.json.

Evidence and regression coverage

  • Tests added or updated: droidClientConfiguration.test.ts covers config path resolution on linux/darwin/win32; the skill destination; an upsert that preserves an unrelated mcpServers entry and a Droid-shaped top-level persistentPermissions object; an idempotent re-run that reports unchanged with registration status aligned; creating mcpServers in an existing file without servers; an empty file; and uninstall removing only rea. clientLifecycle.test.ts now expects droid in the detected list.
  • Base reproduction or other evidence: end-to-end with the real Droid CLI 0.235.0 on macOS 26.7.1, in a throwaway HOME that contained only an empty .factory directory, using the CLI built from this branch:
    • rea setup --client droid --yes wrote mcpServers.rea = {"command": "<checkout>/scripts/rea.mjs", "args": ["mcp"]} (no type) and installed .factory/skills/reverse-engineer-anything.
    • rea doctor --json: the droid registration reports state: "aligned" and remediation: null. doctor itself exits 1 in such an empty HOME; it does the same in an empty HOME without .factory, so that status comes from the other unconfigured checks, not from this client.
    • droid mcp list: rea stdio connected [user].
    • rea uninstall removed the Droid registration and the skill copy; mcp.json became {"mcpServers": {}}.
  • User-visible CLI/MCP output (if applicable): setup, doctor and uninstall list "Factory Droid" / droid.
  • Remaining proof gaps: only macOS was run (path resolution for Linux and Windows is covered by the boundary test). The project-level .factory/mcp.json is not handled. The test fixture matches the real persistentPermissions shape by key and type only, with fake values.

For evidence-bearing changes: not applicable (setup registration; no Evidence contract change).

Validation performed

  • npx vitest run tests/boundary/filesystem/droidClientConfiguration.test.ts tests/boundary/filesystem/clientLifecycle.test.ts — 2 files, 59 tests passed
  • npm run check — passed (architecture guards across 1227 source files)
  • npm run check:fast — typecheck and lint passed
  • npm run verify:test-discovery — all 963 test files discovered exactly once
  • npm run docs:check — passed
  • npm run verify:package — passed (skill and its 6 references installed with Skills 1.7.2; setup planned-then-idempotent; 185 MCP tools)
  • npm pack --dry-run — passed (1473 files)
  • The end-to-end run under Evidence, with the real Droid CLI
  • Fetched https://docs.factory.com/harness/mcp and https://docs.factory.com/harness/skills (both HTTP 200); they document ~/.factory/mcp.json and ~/.factory/skills/<skill-name>/SKILL.md
  • Toolchain: Node 26.9.0 and npm 11.19.1 on main 0365454 (.nvmrc pins 24.18.0, so CI covers the pinned toolchain)

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable. macOS 26.7.1 with Droid CLI 0.235.0 for the end-to-end run; config I/O is covered by filesystem boundary tests.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: setup writes only the rea entry into ~/.factory/mcp.json, preserving all unrelated content; no network access or process execution added.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

This PR is set for a Plus review. TREX isn't supported with Plus or Apex reviews yet, so Greptile reviews this PR at Base while TREX is on.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Adds Factory Droid to setup through the existing JSON client support.

  • Factory Droid setup installs REA’s server and skill in its user folders.

No actionable defects or new security issues were found. Local history showed no separate superseding Droid registration. GitHub status and discussion could not be checked because authentication was unavailable.

Reviews (1) · Last reviewed commit: "feat(clients): register Factory Droid du..." · Reviewed by Greptile

@morluto
morluto merged commit 9e019ad into morluto:main Oct 13, 2026
35 checks passed
@morluto morluto added enhancement New feature or request area: cli CLI adapter and one-shot commands labels Oct 14, 2026
@morluto morluto added the area: setup Setup, packaging, upgrade, install, Doctor, and client registration label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands area: setup Setup, packaging, upgrade, install, Doctor, and client registration enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants