Skip to content

WIP: Add Droid SDK provider#2689

Draft
0xSero wants to merge 3 commits into
pingdotgg:mainfrom
0xSero:ai/droid-sdk-provider
Draft

WIP: Add Droid SDK provider#2689
0xSero wants to merge 3 commits into
pingdotgg:mainfrom
0xSero:ai/droid-sdk-provider

Conversation

@0xSero
Copy link
Copy Markdown

@0xSero 0xSero commented May 14, 2026

Intention

Draft/WIP implementation for adding Droid as a first-class T3 Code provider using Factory's TypeScript SDK: https://github.com/Factory-AI/droid-sdk-typescript

This PR contains the actual provider runtime path, kept behind Droid's disabled-by-default settings while we continue validating real Droid sessions and payloads.

Implemented

  • Adds droid to shared provider/model/settings contracts.
  • Registers a managed Droid provider driver and provider inventory probe.
  • Wraps createSession / resumeSession from @factory/droid-sdk in a T3 provider adapter.
  • Starts/resumes/stops Droid sessions, interrupts active turns, and supports in-session model/reasoning setting updates.
  • Streams Droid assistant/reasoning text, tool use/progress/result, session state, token usage, title updates, MCP status/auth events, turn completion, and runtime errors into canonical T3 runtime events.
  • Routes Droid permission callbacks through T3 Code approval requests instead of auto-approving.
  • Routes Droid ask-user callbacks through the existing structured user-input flow.
  • Sends supported image attachments (gif, jpeg, png, webp) as base64 SDK image sources resolved from T3's attachment store.
  • Discovers Droid's SDK-reported models from createSession().initResult.availableModels, including user/custom models.
  • Preserves custom Droid model IDs so multiple user models backed by the same underlying model are all selectable.
  • Uses a temp cwd for the short-lived SDK discovery probe so model loading does not scan the current repo.
  • Adds focused mocked-SDK adapter/provider tests for stream mapping, SDK options, permission approval routing, rollback/read failures, and SDK model mapping.
  • Adds Droid UI presence in the model picker and Provider Settings with a WIP badge.
  • Replaces the Droid icon with the provided favicon path.

Security / safety notes

  • Droid remains disabled by default.
  • The PR is draft/WIP until validated against more real Droid permission, file, MCP, and auth flows.
  • No SDK secrets, pairing tokens, or provider auth payloads are intentionally logged by this implementation.
  • Permission requests are mediated through T3 Code approval events and default to cancellation on missing/stale sessions.
  • Attachment paths are resolved through the existing attachment store helper; unsupported MIME types fail before SDK submission.
  • The Droid binary path is configurable but defaults to droid; prompt content is sent through the SDK rather than shell interpolation.
  • Model discovery uses a short-lived SDK session and closes it immediately after reading init metadata.

Validation

  • Real Droid CLI query: droid exec --model glm-5.1 --cwd /tmp ... returned droid-pong.
  • Live SDK model discovery returned 67 models, including 38 user/custom models.
  • Local T3 model picker showed custom Droid models such as HomeLab - GLM-5.1, HomeLab - Trinity-Large-Thinking, Direct - GPT-5.5-Fast-xHigh, and Direct - GPT-5.5-Low.
  • Review comments addressed: missing-session reads now fail; Droid rollback now honors numTurns.
  • bun fmt
  • bun lint (passes with existing unrelated warnings)
  • bun typecheck
  • bun run test

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d5613fa9-56c6-41be-8e25-b6c1110a77f4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 14, 2026
Comment thread apps/server/src/provider/Layers/DroidAdapter.ts Outdated
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels May 14, 2026
Comment thread apps/server/src/provider/Layers/DroidAdapter.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant