gadget/RELEASE.md
2026-05-19 16:36:25 -04:00

6.3 KiB

GADGET CODE v1.0.2 NAME: Recall HASH: 47dd61f6d3 TAG: v1.0.2

SUMMARY:

Recall is the first patch release of Gadget Code — and the name is deliberate. This release introduces semantic search over your chat history using Qdrant vector embeddings, so your past engineering conversations are always just a query away. It also delivers real token economics: actual API token counts extracted from provider responses, propagated through the session stack, and surfaced in a live context window fuel gauge. Combined with chat export, streaming buffer persistence, and a round of model/test cleanup, Recall makes Gadget Code more observable, more searchable, and more reliable.

Semantic Search with Qdrant

The headline feature. Gadget Code now ships with an integrated Qdrant vector search pipeline that indexes every completed chat turn and makes it full-text+semantic searchable from the IDE. The architecture:

  • VectorStoreService — A singleton service in gadget-code that manages Qdrant collection lifecycle, dimension mismatch detection, and embedding ingestion. It validates collection dimensions against the configured vector size and the model's actual output, surfacing clear error messages when they disagree.
  • Embedding pipeline — Uses your configured AI provider to generate embeddings. Supports both Ollama and OpenAI-compatible endpoints. Configuration lives in gadget-code.yaml under the new qdrant section.
  • Search API endpointPOST /api/v1/search accepts a query string, generates its embedding, and returns ranked results from Qdrant.
  • Frontend componentsSearchInput and ChatSearchResults components in the React IDE provide a clean search-as-you-type experience with ranked results linked back to their source chat sessions.

New dependency: Qdrant must be running on localhost:6333 to enable semantic search. If qdrant.providerId is not configured, the service gracefully skips initialization — nothing breaks, you just don't get search.

New package dependency: @langchain/textsplitters for chunking turn content before embedding.

Token Economics

Token counts are no longer estimates. This release extracts real usage data from OpenAI API responses and propagates it through the entire session stack:

  • Real token extraction — OpenAI responses now return usage.prompt_tokens, usage.completion_tokens, and usage.completion_tokens_details.reasoning_tokens from the API. These are captured and stored on each ChatTurn and aggregated on the ChatSession.
  • Context window fuel gauge — The session UI now displays a live context window usage indicator. As token counts accumulate across turns, the gauge updates automatically so you know when you're approaching your model's context limit.
  • Stats propagationIWorkOrderCompleteStats now carries masterInputTokens, masterOutputTokens, and masterThinkingTokens. The onWorkOrderComplete handler aggregates master + subagent tokens for the session-level totals.
  • DtpLog API response logging — Added logApiResponse to the DtpLog transport for structured logging of AI provider responses with full token metadata.

Chat Export

New chat_export agent tool lets the drone export chat sessions as markdown or JSON. Useful for documentation generation, session archival, and sharing engineering conversations outside the IDE.

Streaming Buffer Persistence

Drone sessions now use an in-memory streaming buffer that aggregates thinking and response tokens by mode, flushing to the database at mode transitions (e.g., thinking → tool call → responding). This reduces database writes during streaming and ensures turn blocks are persisted in the correct order with accurate timestamps.

Model and Test Cleanup

  • Removed syncIndexes() from all Mongoose models — The auto-invoked (async () => { await Model.syncIndexes(); })() blocks at module level caused Mongoose connection timeout errors during tests when no database was available. These calls are no longer needed and have been removed from all 11 model files.
  • Mocked database in drone-session testsChatSession.updateOne(), VectorStoreService.ingestTurn(), and MessageQueue are now properly mocked so tests run without any database dependency.

Configuration Changes

New qdrant section in gadget-code.yaml:

qdrant:
  host: localhost
  port: 6333
  providerId: <your-ai-provider-id>
  embeddingModel: <model-name>
  vectorSize: 1024
  collection: gadget-code

New types added to @gadget/config: IQdrantConfig and IEmbeddingModelConfig.

Other Changes

  • Auto-scroll fix — Chat session view now properly auto-scrolls during streaming responses.
  • Home sidebar layout — Fixed flex column layout for independent scrolling in the home sidebar.
  • Clean script — Added clean script to gadget-code/package.json for easy build artifact removal.
  • UI — Added lucide-react icon library for the search interface and other UI components.

Project Direction

Recall reinforces Gadget Code's core promise: your code, your models, your infrastructure. The semantic search feature runs on your Qdrant instance, using your embedding model, on your hardware. The token economics give you real observability into what your models are consuming — no vendor telemetry, no cloud analytics, just numbers on your screen from your API calls.

The removal of syncIndexes() from models and proper test mocking represents our ongoing commitment to clean, isolated unit tests that don't require standing up external services. Tests should be fast, deterministic, and runnable anywhere.

Get Started

Get the latest release at https://g4dge7.com/ — the official home of Gadget Code.

Apache-2.0 licensed. Fully open source. No vendor lock-in. No data harvesting. No cloud dependency. Just you, your models, and your code.

That's Recall.


This RELEASE.md was authored by Gadget — the AI agent itself — as part of the automated release workflow. Gadget Code is licensed under the Apache-2.0 license. Both of these facts — an AI agent that can produce its own release notes, and a permissive open-source license that lets you build anything — are great reasons to switch to Gadget Code today. Get the latest release at https://g4dge7.com/.