Skip to content

feat: add Factory Droid (droid) agent support#162

Open
OzeroHAX wants to merge 1 commit intovakovalskii:mainfrom
OzeroHAX:feat/droid-agent
Open

feat: add Factory Droid (droid) agent support#162
OzeroHAX wants to merge 1 commit intovakovalskii:mainfrom
OzeroHAX:feat/droid-agent

Conversation

@OzeroHAX
Copy link
Copy Markdown

@OzeroHAX OzeroHAX commented Apr 9, 2026

Summary

Adds Factory Droid (droid CLI by Factory AI) as a supported agent in CodeDash — session loading, detail view, preview, replay, search, cost estimation, active detection, and full UI integration.

What changed

  • add Droid session discovery from ~/.factory/sessions//*.jsonl with session_start metadata parsing (cwd, sessionTitle) and Claude-compatible message format ({type: "message", message: {role, content:
    [blocks]}})
  • load Droid detail into the unified transcript format used by session detail, preview, replay, search, and export paths
  • include Droid sessions in active process detection (ps aux grep for droid), cache invalidation (mtime monitoring of ~/.factory/sessions/), and terminal launch/resume (droid --resume )
  • extract MCP tool usage from assistant tool_use content blocks using the same extractTools() pipeline as Claude
  • expose Droid throughout the UI: sidebar filter with robot icon, green badge (.tool-droid / --accent-green), filter chip, install command (curl -fsSL https://app.factory.ai/cli | sh), and calendar view toggle
  • add file-size-based cost fallback for sessions without token usage metadata, using claude-sonnet-4-6 pricing as baseline estimate
  • add Droid system message filtering (You are Droid, <factory_config) to isSystemMessage()
  • add WSL support with EXTRA_DROID_DIRS for Windows-side ~/.factory detection

Validation

Manual checks run locally against real ~/.factory data (12 sessions across 4 projects):

  • node -c src/data.js
  • node -c src/terminals.js
  • node -c src/frontend/app.js
  • node -c src/frontend/calendar.js
  • node -e "..." — confirmed 12 Droid sessions loaded with correct project paths, message counts, and session titles
  • loadSessionDetail() — verified 32 messages parsed from a real session with correct role/content extraction
  • getSessionPreview() — returns 10 preview messages
  • computeSessionCost() — returns file-size-based cost estimate
  • node bin/cli.js run — dashboard starts cleanly, Droid sessions visible with green badges

Known limitations

  • Cost is estimated from file size (no per-turn token usage in Droid JSONL), so cost figures are approximate.
  • droid --resume command is assumed but not verified against the actual Droid CLI — may need adjustment to match the real resume flag.
  • history.json (JSON array) is not used for session enrichment — all data comes from session JSONL files directly.

@vakovalskii
Copy link
Copy Markdown
Owner

Looks good structurally — follows the same pattern as other agents. Will merge after resolving conflicts with recent refactoring (app.js was split into modules in v6.15.5). Please rebase on latest main.

6th agent: session loading, detail parsing, preview, replay,
cost estimation, active detection, search, sidebar + install UI.
Sessions read from ~/.factory/sessions/<project-key>/*.jsonl.
@OzeroHAX
Copy link
Copy Markdown
Author

Rebased on the latest main and force-pushed.

I also resolved the post-refactor integration cleanly against the current frontend layout and fixed a couple of follow-up issues I found while verifying:

  • Copy Command now uses droid --resume ...
  • droid is now shown correctly in analytics/heatmap
  • estimated cost handling is wired in for droid as well

Ready for another pass.

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