Add Droid SDK provider#2689
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Latest Droid follow-up fixes pushed in c72f19b:
Validation: |
|
Addressed the unresolved Droid cleanup review thread in b1dabf8. Added a regression test covering two resumed Droid sessions where one Validation:
Note: the first full-suite run hit a timeout in |
ApprovabilityVerdict: Needs human review This PR introduces a complete new provider integration (Droid SDK) with new runtime capabilities, settings, and UI changes. New features adding external integrations and user-facing workflows require human review. You can customize Macroscope's approvability policy. Learn more. |
|
Split the Droid adapter by responsibility in af7ffb0:
The Droid implementation is now 989 lines total across focused modules instead of one nearly 900-line adapter file. Validation:
|
|
Addressed the two remaining Cursor Bugbot review threads in 8939e57:
Validation:
|
|
Addressed the remaining token-usage review thread in 742ab64:
Validation after this fix:
Earlier in this pass, full |
|
Resolved the latest Cursor Bugbot comments in
Validation:
|
|
Resolved the latest Macroscope/Cursor comments in
Validation:
|
|
Resolved the latest Cursor Bugbot review in
Validation:
|
|
Resolved the latest Cursor Bugbot comments in c1ad5f0.
Validation:
|
|
Resolved the newest Cursor Bugbot comments in 0e5d6af.
Validation:
|
|
Resolved the latest Cursor Bugbot comments in 7bc4e12.
Validation:
|
|
Resolved the latest Cursor Bugbot comment in d7b895e.
Validation:
|
|
Resolved the latest Cursor Bugbot comments in e6e7338.
Validation:
|
|
Resolved the latest duplicate abort-signal comments in d5a6bf3.
Validation:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d5a6bf3. Configure here.
|
Resolved the latest Droid environment compaction comment in 87453f2.
Validation:
|

Intention
Add Droid as a first-class T3 Code provider using Factory's TypeScript SDK: https://github.com/Factory-AI/droid-sdk-typescript
This is still WIP while we validate more real Droid permission, file, MCP, auth, and long-running streaming flows.
What this adds
droidto the shared provider, model, settings, runtime source, and driver contracts.createSession/resumeSessionfrom@factory/droid-sdkin a T3 provider adapter.gif,jpeg,png,webp) as base64 SDK image sources resolved through the existing attachment store.initResult.availableModels, including user/custom models, while preserving custom model ids so duplicate underlying models remain selectable.Implementation shape
The Droid adapter has been split by responsibility instead of keeping one large file:
DroidAdapter.ts: session lifecycle and adapter orchestration.provider/droid/DroidRuntimeEvents.ts: SDK message to T3 runtime event projection.provider/droid/DroidSdkMappings.ts: SDK model, access, reasoning, usage, approval, and user-input mappings.provider/droid/DroidAttachmentResolver.ts: attachment MIME validation and image loading.provider/droid/DroidAdapterTypes.ts: shared Droid adapter types.Security / safety notes
droid; prompt content is sent through the SDK rather than shell interpolation.Validation
droid exec --model glm-5.1 --cwd /tmp ...returneddroid-pong.HomeLab - GLM-5.1,HomeLab - Trinity-Large-Thinking,Direct - GPT-5.5-Fast-xHigh, andDirect - GPT-5.5-Low.numTurns; streaming, thinking, access-mode mapping, and custom model discovery were updated.bun fmtpassed.bun lintpassed with existing unrelated web warnings.bun typecheckpassed.cd apps/server && bun run test src/provider/Layers/DroidAdapter.test.ts src/provider/Layers/DroidProvider.test.ts.bun run testpreviously passed; after rebasing, one full parallel run hit three unrelated web timeout failures, and rerunning those exact files in isolation passed.Note
Add Droid SDK provider with full session, streaming, and runtime mode support
DroidDriverandmakeDroidAdapterto integrate the@factory/droid-sdkas a first-class provider, supporting session lifecycle, turn streaming, permission/user-input mediation, and interrupts.checkDroidProviderStatusfor health checks including CLI version detection and timed model discovery; models are mapped toServerProviderModelwith reasoning capability descriptors.'medium-access'value to theRuntimeModeunion, mapped toAutonomyLevel.Mediumfor Droid and treated as equivalent toauto-accept-editsin non-Droid contexts.runtimeModePresentation.tswith provider-aware runtime mode config/options and anormalizeRuntimeModeForProviderhelper;ChatViewand composer components now normalize and persist runtime mode based on the resolved provider.resolveProviderDriverKindForInstanceSelectionto exclude disabled or unavailable provider instances.DroidDrivertext generation operations (commit messages, PR content, branch names, thread titles) always fail with aTextGenerationError; rollback is explicitly unsupported.Macroscope summarized 87453f2.
Note
Medium Risk
Adds a new first-class provider plus a new
RuntimeModevalue, touching provider registry, runtime event mapping, and chat composer behavior; regressions could affect session lifecycle and access-mode handling across providers.Overview
Introduces Droid as a new managed provider backed by
@factory/droid-sdk, including aDroidDriver, provider health/model discovery, and an adapter that starts/resumes sessions, streams SDK messages into canonical runtime events, mediates permission + ask-user callbacks, supports image attachments, and handles interrupts/stop-all.Extends shared contracts and defaults to include
DroidSettings,droidruntime raw sources, and a newRuntimeMode(medium-access) with provider-specific mappings (also wired into Codex runtime sandbox mapping).Updates the web UI to surface Droid (settings + icons + provider picker) and to make runtime-mode selection provider-aware: runtime mode options/labels vary per provider, unsupported modes are normalized when switching providers, and instance selection resolution now ignores disabled/unavailable instances.
Reviewed by Cursor Bugbot for commit 87453f2. Bugbot is set up for automated code reviews on this repo. Configure here.