DevAgent — Terminal Coding Agent Kernel
2026.06 – 2026.10
Python 3.11 · asyncio · SSE · Anthropic and OpenAI protocols · MCP · Git worktree · pytest
- Agent loop Built the request → stream → tool → result cycle. Termination depends on whether the turn produced tool calls, with an iteration cap against runaway loops and support for resuming an interrupted turn.
- Streaming Hand-wrote SSE parsing and normalized vendor events into one internal model, adapting both Anthropic and OpenAI protocols. Tool arguments arrive as fragmented JSON, so they are accumulated across events and validated before execution.
- Tool system Abstracted 20+ tools behind a single registry with parameter models, permission categories and concurrency-safety flags, plus uniform validation, output truncation and batched dispatch.
- Context Compacts automatically against a token budget while reserving an output allowance and a safety margin, so compaction cannot immediately re-trigger. A recovery note is injected afterwards to keep the task continuous, drawing on project instructions, session history and auto-memory.
- Isolation Layered permission rules — path matching plus dangerous-command detection — across several execution modes, with Git worktrees giving parallel subtasks separate working directories over a shared object store.
- Collaboration Multi-agent coordination through a file-locked mailbox, a shared task board and a name registry, so teammates can claim work and report results back to the lead.
Garmin Coach — Training Data Aggregation and AI Coach
2026.07 – 2026.10
Garmin Coach pulls training data from Garmin and COROS watches into a single record,
then lets you interrogate it: an AI coach that decides which queries to run instead of
receiving the entire dataset in its prompt. Behind it is a FastAPI and SQLAlchemy REST
service of roughly 40 endpoints, serving both Android and web clients with per-user JWT
isolation.
Python 3.11 · FastAPI · SQLAlchemy · DeepSeek · JWT · SQLite / MySQL · Kotlin / Compose
Live demo
demo.lvyou777777.space
- Agent loop The model decides which of the 9 data-query tools to call based on the question, fetches only what it needs, then answers. The conversation API contract stayed stable, so clients needed no changes.
- Unified LLM client Vendor-specific SSE streams are normalized into 7 internal event types, so nothing above the client knows which vendor produced them. Fragmented tool arguments are accumulated by index and parsed once complete; a parse failure becomes an error event the model can react to.
- Tool layer Tool errors come back as structured results the model can correct against. Blocking ORM calls run on a thread pool, so a slow query cannot stall the event loop, and every tool is bound to a user_id so internal calls cannot bypass authorization.
- Safety Training-intensity ceilings are computed server-side as five hard bands, and the prompt requires a query before any recommendation, so the model cannot advise above the band.
Port Equipment Gateway — MQTT to Redis / MySQL
2026.03 – 2026.06
C# / .NET · MQTT (EMQX) · Redis · MySQL · producer-consumer queue · unit tests
- Payload integrity Identified UTF-8 decoding inside the MQTT SDK as the source of payload corruption. Payloads are kept as raw bytes from receipt to storage, so all 592 hex characters match the device byte for byte.
- Decoupling Put a producer-consumer queue between the callback and persistence, so slow writes could no longer back up the broker and drop packets.
- Cache and ledger Redis holds a rolling 300-packet window per device with a TTL while MySQL is the authoritative ledger — cache failures raise an alert, ledger failures raise immediately.
- Edge cases Implemented millisecond timestamps guaranteed to increase within a device, defended five scenarios that lose data silently, and wrote 13 unit tests covering concurrent writes and timestamp ordering.