Factory Droid 0.233.0 support: adapter ready and live injection verified

Abierto
#143 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@thezelium ya está trabajando en esto.

Desde el 6/11/2026.

  • #159 de @thezelium — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

The issue describes a local adapter tested against Factory Droid 0.233.0, but it does not name the repository files or tests to change. Read the related issue #85 and the adapter description, then identify the project’s host integration and session import entry points. Done means a reviewed PR adds the adapter and its tests, with the stated live injection behavior and platform limits documented.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

I built a Factory Droid adapter for TokenEconomizer on top of main (519c65f) and tested it on Droid 0.233.0 (macOS). It adds a Droid session-log reader, a host adapter for Droid's Claude-shaped hooks, history import, per-session cost from the tokenUsage Droid writes beside each log, an opt-in droid_sidecall switch, and a .factory-plugin bundle.

The last hop that was previously unverified on Droid, a learned fact reaching a live model, is now verified: a fresh session received the learned block as hookSpecificOutput.additionalContext, and the model repeated it verbatim.

This is related to #85. I can submit the adapter as a PR; I am posting this to check whether a PR would be welcome.

Environment

  • TokenEconomizer main at 519c65f plus a local Droid adapter
  • Factory Droid 0.233.0, macOS
  • Droid session logs under ~/.factory/sessions; cost from <session id>.settings.json
  • Plugin suite: 732 tests, exit 0 (17 skipped)

What the adapter covers

  • Micro-skills: SessionStart returns the block in hookSpecificOutput.additionalContext.
  • Loop guard: PostToolUse redirects and notices on Droid payloads.
  • Session cost: reads tokenUsage (inputTokens, outputTokens, cacheCreationTokens, cacheReadTokens, thinkingTokens, factoryCredits); only tokenUsage, because inclusiveTokenUsage also counts child sessions.
  • History import: te --host droid history import reads earlier Droid sessions; no model call; only before a repository has folded sessions.
  • Commands: /tokeneconomizer-* from the Droid bundle.
  • Settings: droid_sidecall (or TE_DROID_SIDECALL=1) allows the plugin's own droid exec calls; off by default.

Verification

  • Plugin suite: pytest tests -> 732 tests, exit 0 (17 skipped).
  • Live, 2026-11-05, Droid 0.233.0, macOS: a fresh session received a 793-character block as hookSpecificOutput.additionalContext; the session record has injected_chars: 793; the model repeated the block verbatim.
  • The block was three facts at that moment; a fourth was added by the next fold.

Limits

  • Tool pruning is not available: Droid's TUI has no persistent per-tool setting (Factory's issue #65). droid exec --only-tools is exec-only.
  • droid exec as a pure completion is not documented: no flag set strips tools, hooks and the session log, so the plugin's own calls stay opt-in.
  • The adapter is macOS-tested only; Windows CI has not been run locally.
  • experiments/tests was not run; the adapter does not touch the benchmark code.

Question

Would a PR adding this adapter be welcome? I have the branch ready locally and have not pushed it.

AI disclosure: the adapter and tests were produced with Factory Droid (an AI coding agent) at my direction.

Lenguaje dominante
Python
Estrellas
5.6k
Forks
344
Merge medio
14 h 41 min
PR fusionados (30 d)
54

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/TokenEconomizer

Todos los issues de microsoft/TokenEconomizer

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.