Skip to content

Releases: dixieflatline76/nacho-flow

🌮 Nacho Flow v1.5.0: Direct Anthropic API Support, Prompt Cache Tracking & Faster Agent Runs

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 01 Oct 16:18
6732c1e

🌮 Nacho Flow v1.5.0: Direct Anthropic API Support, Prompt Cache Tracking & Faster Agent Runs

This release adds direct Anthropic Messages API support, tracks prompt caching discounts in the dashboard, splits streaming and single-turn request handling, and sets new speed and cost records across autonomous coding benchmarks.


🚀 1. Direct Anthropic API Support

  • Talk Straight to Anthropic: Connect directly to api.anthropic.com/v1/messages without translation proxies. Works out of the box with Claude 3.5 Sonnet, Claude 3.7 Sonnet, and Haiku.
  • Smart Model Aliases: Date-stamped model names (like claude-3-7-sonnet-20250219 or claude-3-5-sonnet-latest) are recognized and mapped instantly with zero overhead.
  • Full Agent Compatibility: Handles streaming events, reasoning/thinking blocks, and tool calls transparently for coding agents like Zoo Code, Cline, and Continue.

💰 2. Prompt Cache Tracking & Real Cost Savings

  • Track Cache Reads & Writes: Reads cache_creation_input_tokens and cache_read_input_tokens headers to calculate accurate costs on every turn.
  • 90% Discount in Dashboard: Accurately accounts for Anthropic's $0.30/M cached read pricing instead of charging standard $3.00/M input rates.
  • 95.7% Cache Hit Rate: Verified in long multi-turn runs, dropping per-turn costs from ~$0.41 down to ~$0.04 when working with 140k+ token histories.

🛡️ 3. Cleaner Request Handling & Loop Killer Fixes

  • Split Streaming & Single Requests: Separated streaming connections from unary requests into clean, dedicated handlers so errors are easier to isolate and debug.
  • Stop Runaway Thinking Loops: Cycle Killer now monitors repetitive thinking blocks in reasoning models and cleanly ends the stream with HTTP 200, letting agents save their work instead of crashing or timing out.

⚡ 4. Benchmark Records: 11.6 Minutes & $0.21 Full Project Build

Tested across 5 end-to-end autonomous runs building a full Blackjack TUI & Monte Carlo engine from scratch:

Metric Run 7 (Claude 3.5 Sonnet) Run 8 (GLM-5.3-Flash Cloud)
Duration 11.64 minutes (All-Time Speed Record) 16.9 minutes
Total Session Cost $2.86 (with 95.7% cache hit rate) $0.2065 (All-Time Cost Record)
Prompt Cache Hit Rate 95.7% 90.5%
Unit Test Coverage 92.5% 94.5%
Cycle Breaker Saves 0 loops detected 1 live Turn 0 loop severed (16,386 tokens saved)
Build Status ✅ Compiled & passed first try ✅ Compiled & passed first try

🧪 5. Verification & Code Health

  • 95.6% global Go statement coverage across all packages.
  • 100% data-race clean (go test -race ./...).
  • 0 gosec security findings and 0 govet warnings.
  • All 15 Jest extension test suites passing (333 / 333 tests).
  • Multi-platform CI passing on Windows, macOS, and Linux.

🔧 6. VS Code Extension & Sidebar Auto-Refresh

  • Seamless Profile Switching & Width Optimization: Wired the sidebar active profile dropdown to automatically trigger profile switching and daemon restart without requiring manual clicks on the secondary "Switch" button, converted single-action controls into compact icon/action buttons (.btn-icon, .btn-action), expanding the active profile dropdown to occupy all available horizontal width (~2.5× wider) so long profile labels are not truncated in narrow sidebars.
  • Real-Time Config Hot-Reload via SSE: Aligned extension telemetry subscriptions (config_updated, circuit_state_changed, route_completed) with the Go engine to ensure YAML disk edits and circuit breaker state changes immediately re-render the active providers panel and dashboard.
  • Port Release Polling: Added graceful socket health polling during engine restart to guarantee reliable process recreation across all platforms.

📦 Installation & Quickstart

VS Code Extension (Recommended)

Install directly from the VS Code Marketplace or via CLI:

code --install-extension dixieflatline76.nacho-flow

Universal Shell Installer (Linux & macOS)

curl -fsSL https://raw.githubusercontent.com/dixieflatline76/nacho-flow/main/scripts/install.sh | bash

Windows (WinGet)

winget install dixieflatline76.NachoFlow

Standalone Go Daemon (Build from Source)

git clone https://github.com/dixieflatline76/nacho-flow.git
cd nacho-flow
make build
./bin/nacho-flow

🌮 Nacho Flow v1.4.3: Documentation & Marketplace Copy Update

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 30 Sep 10:15

This release streamlines the documentation across the repository, the landing page, and the VS Code Marketplace listing—simplifying the quickstart and focusing directly on technical reference and architecture.


📖 1. Documentation & Marketplace Polish

  • Simplified Quickstart: Restructured the VS Code extension listing (extension/README.md) to surface the 3-step setup and UI screenshot directly at the top.
  • Focused Technical Reference: Pruned redundant comparisons and background essays from README.md, condensing features down to a clean technical breakdown with full settings tables preserved.
  • Landing Page Refinement: Streamlined site/index.html to focus on the core 4 supervisors (Cycle Killer, Kickstart, Tool Normalizer, Fairy Dust), live terminal simulation, and real-time financial telemetry.
  • CI Smart Tag Synchronization: Refreshed all high-concurrency benchmarks (make bench-sync) and statement test coverage tables (make cover-sync).

🧪 2. Test Verification & Code Health

  • Statement Coverage: Maintained 95.6% global Go statement coverage across all 19 packages.
  • Concurrency: 100% data-race clean (go test -race ./...).
  • Security Audit: Zero static security findings (gosec).
  • Extension Suite: 15 / 15 Jest suites passed (333 / 333 tests, 96.8% coverage).
  • Multi-Platform CI: Verified green across Ubuntu, macOS, and Windows.

📦 Installation & Download Options

1. VS Code Companion Extension (Recommended)

Bundles the Go daemon, live telemetry dashboard, and one-click presets:

code --install-extension dixieflatline76.nacho-flow

Or install directly from the VS Code Marketplace.

2. Universal Shell Installer (Linux & macOS)

Detects CPU architecture, verifies SHA-256 checksums, and offers automatic systemd service registration on Linux:

curl -fsSL https://raw.githubusercontent.com/dixieflatline76/nacho-flow/main/scripts/install.sh | bash

3. Windows (WinGet)

winget install dixieflatline76.NachoFlow

4. Homebrew (macOS & Linux)

brew install dixieflatline76/nacho-flow/nacho-flow

5. Docker / Podman (Multi-Arch Distroless Container)

docker run -d --name nacho-flow \
  -p 8000:8000 \
  -v $(pwd)/config.yaml:/config/config.yaml \
  ghcr.io/dixieflatline76/nacho-flow:latest

6. Pre-Compiled Standalone Binaries

Directly download signed binaries and architecture-specific VSIX packages from GitHub Releases:

  • Windows: nacho-flow-v1.4.3-windows-amd64.exe
  • Linux: nacho-flow-v1.4.3-linux-amd64, nacho-flow-v1.4.3-linux-arm64
  • macOS: nacho-flow-v1.4.3-darwin-arm64 (Apple Silicon), nacho-flow-v1.4.3-darwin-amd64 (Intel)

7. Go Install & Source Build

# Direct Go binary install:
go install github.com/dixieflatline76/nacho-flow/cmd/nacho-flow@latest

# Or clone and build locally:
git clone https://github.com/dixieflatline76/nacho-flow.git
cd nacho-flow && make build

🌮 Nacho Flow v1.4.2: Checklist Loop Fix, In-Flight Token Compaction & Faster Agent Runs

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 29 Sep 14:47

🌮 Nacho Flow v1.4.2: Checklist Loop Fix, In-Flight Token Compaction & Faster Agent Runs

This release fixes a frustrating bug where Cycle Killer killed agent streams while updating task checklists, validates live in-flight token savings with NTS, and sets new speed and cost records across autonomous coding benchmarks.


🛡️ 1. Stop Killing Agents While Updating Checklists & Todo Lists

  • The Bug: When agents like Zoo Code or Cline work through a project, they frequently update a checklist or todo list (often marking 10–20 items as "status": "completed" at once). Because task tools were previously evaluated as shell commands rather than file writes, Cycle Killer saw the repeated status words as a runaway loop, killed the stream mid-flight, and threw the model into a 2-minute cooldown.
  • The Fix: Task and checklist tools (update_todo_list, updateTodoList, todo_list) are now recognized as write operations. They bypass repetitive phrase checks while still respecting maximum write boundaries (32k tokens), completely eliminating false-positive loop terminations.

🗜️ 2. In-Flight Token Compaction (NTS) in Action

  • How It Works: Nacho Token Saver strips ANSI escapes, collapses progress spinners, and cleans repetitive empty lines from terminal output in-place before it enters conversation history.
  • Cache-Friendly: Maintained over 80% prompt cache hit rates in multi-turn runs—proving that cleaning noisy terminal output doesn't disrupt prompt caching.
  • Context Relief: Saved over 4,500 tokens per session, keeping long-running agent contexts leaner and cheaper.

⚡ 3. Benchmark Records: 14 Minutes & €0.23 Full Project Build

We tested v1.4.2 against our end-to-end Blackjack TUI & Monte Carlo engine benchmark:

  • Zoo Code + GLM-5.3-Flash: Built the full project, passed all unit tests (92–98% coverage), and verified Monte Carlo simulation in 14.5 minutes for just $0.25 (€0.23) with 0 loops and 0 crashes.
  • Cline + Qwen3 Coder Plus: Finished in 16.2 minutes (down from 45+ minutes on generic setups) and compiled a fully working binary on the first try.

🧪 Verification

  • All 19 Go packages passed test suites with 95.6% statement coverage.
  • 0 data races detected (go test -race ./...).
  • 0 lint or vet warnings (go vet ./...).
  • Cross-platform CI green on Windows, macOS, and Linux.

📦 Installation & Quickstart

VS Code Companion Extension (Recommended)

Install directly from the VS Code Marketplace or via CLI:

code --install-extension dixieflatline76.nacho-flow

Standalone Go Daemon (Build from Source)

git clone https://github.com/dixieflatline76/nacho-flow.git
cd nacho-flow
make build
./bin/nacho-flow

🌮 Nacho Flow v1.4.1: Automated Profile Auto-Tuner, Pre-Tuned Presets, 3-Lane Stream Normalizer & Config Schema Versioning

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 28 Sep 14:41

🌮 Nacho Flow v1.4.1: Automated Profile Auto-Tuner, Pre-Tuned Presets, 3-Lane Stream Normalizer & Config Schema Versioning

v1.4.1 is a stability and performance patch release building on v1.4.0. It upgrades the rule synthesis engine to pure AST tree-walking, eliminates heap allocations in Agent Shield fallback evaluation, and stabilizes the bare-metal benchmark suite under extreme concurrency.


🛠️ What's New in v1.4.1

  • Rule AST Expression Rewriter (pkg/tuner): Replaced regex string-splicing with pure recursive expr/ast tree-walking for safe and robust context variable rewriting across complex boolean expressions.
  • Zero-Alloc Agent Shield Optimization (pkg/router/shield, pkg/zeroalloc): Eliminated heap allocation in RuleEngine.Evaluate on trailing prose without question marks, and promoted ASCII case-insensitive search to pkg/zeroalloc.ContainsFoldASCII (0 B/op, 0 allocs/op @ 4.4 ns/op).
  • Benchmark Stress Harness Stability & Modernization (cmd/util/nacho_bench): Bounded connection pooling (MaxConnsPerHost: 2000) to eliminate Windows loopback socket thread exhaustion under 1,000-worker concurrency tests, modernized benchmark loops to Go's idiomatic b.Loop(), and refreshed documentation metrics (95.6% statement coverage, 29.8k req/s peak).

🚀 What's New in v1.4.0

🎛️ 1. Traffic-Based Profile Auto-Tuner (nacho-flow tune, pkg/tuner)

  • The Problem: Writing routing rules by hand is pure guesswork. You pick an arbitrary context limit like Tokens < 20000, run an agent, and quickly hit real-world failure modes:
    • Your local model exceeds GPU VRAM and crashes Ollama.
    • An agent gets stuck in a loop, and your cascade blindly escalates turn after turn to frontier models, burning $10 on an unresolvable prompt.
    • Your cascade escalates to a model that is actually worse at coding than the tier before it (capability inversion).
    • On top of that, previous tuning tools were an all-or-nothing black box—you either accepted every proposed change or none at all.
  • The Solution:
    • Session Replay Simulation: nacho-flow tune reads your real session history (traffic.jsonl) and replays it through an in-memory simulation engine (replaying 1,000,000 statements in 25ms with zero heap allocations) to calculate exactly what candidate rules would have cost and how many retries they would have prevented before touching your configuration.
    • Fine-Grained Checkbox Selection: Added checkboxes to the VS Code Auto-Tuner webview panel so you can inspect individual rule suggestions, threshold shifts, and model swaps, and apply only the ones you want.
    • GPU VRAM Awareness: Set your GPU VRAM ceiling (e.g. --vram-gb=16 or via the dashboard dropdown) so the tuner never suggests local context limits that exceed your card's physical memory capacity.
    • Per-Client Tuning (client_id): Automatically detects whether traffic originated from Zoo Code, Cline, Cursor, or Aider via /api/v1/telemetry/clients. You can filter logs by agent in the dashboard and tune rules specifically for Zoo Code without Cline's sessions polluting the thresholds.
    • Capability Inversion Pruning: Automatically sets redundant tiers to when: "false" if an escalation tier uses a model with lower coding benchmarks than the tier before it, and halts escalation when an agent hits an unresolvable plateau.

🎯 2. Pre-Tuned Presets for Zoo Code & Cline (profile1.yaml, profile2.yaml, profile3.yaml)

  • The Problem: Different autonomous coding agents fail in very different ways. Zoo Code uses deep JSON tool calls and multi-turn test-and-debug loops, while Cline relies on XML tool fences and step-by-step diff edits. On generic out-of-the-box configurations:
    • Agents hit repetition cycle killers mid-stream because tabular output or test matrices were mistaken for infinite reasoning loops.
    • Read-only exploration turns were misidentified as stalled agents, triggering unwanted kickstart overrides.
  • The Solution: Bundled three profile presets tuned directly from real multi-turn agent runs (including the full Blackjack project benchmark where Zoo Code + GLM-5.3-Flash delivered a complete Go TUI project for $0.34 total):
    • Profile 1 & Profile 2 (Zoo Code / Standard Hybrid): Uses z-ai/glm-5.3-flash for Tier 2 ($0.65/M), Gemini 3.8 Flash for Tier 3, a 16,384 thinking-token ceiling with adjusted repetition detection (8-word n-gram, 12 repeats max so tables don't get cut off), and SessionKickstarted && Retries < 3 to power past initial read-only exploration loops.
    • Profile 3 (Cline): Uses qwen/qwen3-coder-plus for Tier 2 ($0.65/M), Gemini 3.8 Flash for Tier 3, a 4,096 thinking-token limit (6 repeats), and a tight kickstart threshold (Retries < 1 && SessionKickstarted) tailored for Cline's XML tool calling syntax.
    • 1-Click Profile Switching: The VS Code extension lets you switch profiles instantly from the status bar chip (🌮), spawning the daemon with clean --config process isolation.

🌊 3. 3-Lane SSE Stream Normalizer & Delimiter Leak Defense (pkg/server, pkg/zeroalloc)

  • The Problem: Open-weights models (Gemma 4, DeepSeek-R1, Qwen 2.5) frequently emit internal control tokens (e.g. <|channel|>thought, <think>, <|"|>}) split across fragmented SSE streaming chunks. In long agent sessions, these delimiter fragments leaked into tool argument payloads, corrupting editor file writes or causing V8 JSON parser crashes (position 515 errors) that froze the client extension.
  • The Solution:
    • Re-architected the SSE proxy into 3 isolated streaming lanes: Prose, Reasoning (<think>), and Tool Arguments.
    • Built zero-allocation in-place byte sanitizers (StripSubslicesInPlace, ReplaceSubslicesInPlace) that strip trailing control delimiters at line boundaries with zero heap allocations ($0\text{ B/op}$) and sub-100ns latency.
    • Handled stream terminations cleanly so aborted turns emit valid OpenAI-compliant SSE frames without truncated JSON, eliminating client-side parser crashes.

📋 4. Config Schema Versioning & Default Template Diffs (pkg/config, Extension)

  • The Problem: As routing features and normalizer flags evolve across releases, user configuration files silently drift. Developers had no easy way to know if their local config.yaml was missing new fields or using deprecated options, and restoring defaults meant manually copying YAML from the repository.
  • The Solution:
    • Added SemVer schema validation between active user profiles and bundled templates.
    • Visual sidebar alerts notify developers when their active profile schema is older than the current extension version.
    • Added live side-by-side diffing (nacho-flow.compareProfileWithTemplate) to see exactly what changed, and a safe reset command (nacho-flow.resetProfileToDefault) that makes a timestamped .bak backup before restoring defaults.

🧪 Verification Matrix

Check / Metric Scope Result Status
Go Test Coverage (cover-sync) All 19 Go packages & CLI tools 95.6% statement coverage (all ≥ 95.0%) ✅ Passed
Go Static Analysis (vet) Full repository 0 warnings, 0 errors (go vet ./...) ✅ Passed
Go Race Detector (test-race) Full test suite 0 data races (go test -race ./...) ✅ Passed
Security Audit (gosec) Full codebase (99 files, 25.6k lines) 0 issues (gosec -exclude=G706) ✅ Passed
VS Code Extension Suite Extension core, webviews, schemas 15 / 15 suites, 333 / 333 tests passed (100%) ✅ Passed
Benchmark Concurrency Stress 50 -> 100 -> 250 -> 500 -> 1000 workers 100% success rate (0 errors across 350k reqs) ✅ Passed
GitHub Actions CI Matrix Windows, Ubuntu, macOS runners All 3 platforms green on main ✅ Passed

📦 Installation & Quickstart

VS Code Companion Extension (Recommended)

Install directly from the VS Code Marketplace or via CLI:

code --install-extension dixieflatline76.nacho-flow
  • Select your desired profile (Profile 1: Standard Hybrid, Profile 2: Zoo Code Preset, or Profile 3: Cline Preset) directly from the status bar chip (🌮).
  • Point your autonomous coding agent (Cline, Zoo Code, Cursor, OpenCode, Aider) to http://127.0.0.1:8000/v1.

Universal Shell Installer (Linux & macOS)

curl -fsSL https://raw.githubusercontent.com/dixieflatline76/nacho-flow/main/scripts/install.sh | bash

Windows (Winget)

winget install dixieflatline76.NachoFlow

Homebrew (macOS)

brew install dixieflatline76/tap/nacho-flow

Standalone Go Daemon (Build from Source)

go build -o nacho-flow ./cmd/nacho-flow
./nacho-flow --config ./extension/resources/profiles/profile1.yaml

🌮 Nacho Flow v1.4.0: Automated Profile Tuner, Agent Presets & 3-Lane Stream Normalizer

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 27 Sep 21:50

🌮 Nacho Flow v1.4.0: Automated Profile Auto-Tuner, Pre-Tuned Presets, 3-Lane Stream Normalizer & Config Schema Versioning

v1.4.0 is the first major General Availability release since v1.1.0. It brings together the architectural work from the v1.2 and v1.3 development cycles into a single stable release: an automated profile tuner that replays your session logs to optimize routing rules, pre-tuned presets for Zoo Code and Cline, 3-lane SSE stream normalization that stops control tokens from corrupting file edits, and config schema versioning.


🚀 What's New in v1.4.0

🎛️ 1. Traffic-Based Profile Auto-Tuner (nacho-flow tune, pkg/tuner)

  • The Problem: Writing routing rules by hand is pure guesswork. You pick an arbitrary context limit like Tokens < 20000, run an agent, and quickly hit real-world failure modes:
    • Your local model exceeds GPU VRAM and crashes Ollama.
    • An agent gets stuck in a loop, and your cascade blindly escalates turn after turn to frontier models, burning $10 on an unresolvable prompt.
    • Your cascade escalates to a model that is actually worse at coding than the tier before it (capability inversion).
    • On top of that, previous tuning tools were an all-or-nothing black box—you either accepted every proposed change or none at all.
  • The Solution:
    • Session Replay Simulation: nacho-flow tune reads your real session history (traffic.jsonl) and replays it through an in-memory simulation engine (replaying 1,000,000 statements in 25ms with zero heap allocations) to calculate exactly what candidate rules would have cost and how many retries they would have prevented before touching your configuration.
    • Fine-Grained Checkbox Selection: Added checkboxes to the VS Code Auto-Tuner webview panel so you can inspect individual rule suggestions, threshold shifts, and model swaps, and apply only the ones you want.
    • GPU VRAM Awareness: Set your GPU VRAM ceiling (e.g. --vram-gb=16 or via the dashboard dropdown) so the tuner never suggests local context limits that exceed your card's physical memory capacity.
    • Per-Client Tuning (client_id): Automatically detects whether traffic originated from Zoo Code, Cline, Cursor, or Aider via /api/v1/telemetry/clients. You can filter logs by agent in the dashboard and tune rules specifically for Zoo Code without Cline's sessions polluting the thresholds.
    • Capability Inversion Pruning: Automatically sets redundant tiers to when: "false" if an escalation tier uses a model with lower coding benchmarks than the tier before it, and halts escalation when an agent hits an unresolvable plateau.

🎯 2. Pre-Tuned Presets for Zoo Code & Cline (profile1.yaml, profile2.yaml, profile3.yaml)

  • The Problem: Different autonomous coding agents fail in very different ways. Zoo Code uses deep JSON tool calls and multi-turn test-and-debug loops, while Cline relies on XML tool fences and step-by-step diff edits. On generic out-of-the-box configurations:
    • Agents hit repetition cycle killers mid-stream because tabular output or test matrices were mistaken for infinite reasoning loops.
    • Read-only exploration turns were misidentified as stalled agents, triggering unwanted kickstart overrides.
  • The Solution: Bundled three profile presets tuned directly from real multi-turn agent runs (including the full Blackjack project benchmark where Zoo Code + GLM-5.3-Flash delivered a complete Go TUI project for $0.34 total):
    • Profile 1 & Profile 2 (Zoo Code / Standard Hybrid): Uses z-ai/glm-5.3-flash for Tier 2 ($0.65/M), Gemini 3.8 Flash for Tier 3, a 16,384 thinking-token ceiling with adjusted repetition detection (8-word n-gram, 12 repeats max so tables don't get cut off), and SessionKickstarted && Retries < 3 to power past initial read-only exploration loops.
    • Profile 3 (Cline): Uses qwen/qwen3-coder-plus for Tier 2 ($0.65/M), Gemini 3.8 Flash for Tier 3, a 4,096 thinking-token limit (6 repeats), and a tight kickstart threshold (Retries < 1 && SessionKickstarted) tailored for Cline's XML tool calling syntax.
    • 1-Click Profile Switching: The VS Code extension lets you switch profiles instantly from the status bar chip (🌮), spawning the daemon with clean --config process isolation.

🌊 3. 3-Lane SSE Stream Normalizer & Delimiter Leak Defense (pkg/server, pkg/zeroalloc)

  • The Problem: Open-weights models (Gemma 4, DeepSeek-R1, Qwen 2.5) frequently emit internal control tokens (e.g. <|channel|>thought, <think>, <|"|>}) split across fragmented SSE streaming chunks. In long agent sessions, these delimiter fragments leaked into tool argument payloads, corrupting editor file writes or causing V8 JSON parser crashes (position 515 errors) that froze the client extension.
  • The Solution:
    • Re-architected the SSE proxy into 3 isolated streaming lanes: Prose, Reasoning (<think>), and Tool Arguments.
    • Built zero-allocation in-place byte sanitizers (StripSubslicesInPlace, ReplaceSubslicesInPlace) that strip trailing control delimiters at line boundaries with zero heap allocations ($0\text{ B/op}$) and sub-100ns latency.
    • Handled stream terminations cleanly so aborted turns emit valid OpenAI-compliant SSE frames without truncated JSON, eliminating client-side parser crashes.

📋 4. Config Schema Versioning & Default Template Diffs (pkg/config, Extension)

  • The Problem: As routing features and normalizer flags evolve across releases, user configuration files silently drift. Developers had no easy way to know if their local config.yaml was missing new fields or using deprecated options, and restoring defaults meant manually copying YAML from the repository.
  • The Solution:
    • Added SemVer schema validation between active user profiles and bundled templates.
    • Visual sidebar alerts notify developers when their active profile schema is older than the current extension version.
    • Added live side-by-side diffing (nacho-flow.compareProfileWithTemplate) to see exactly what changed, and a safe reset command (nacho-flow.resetProfileToDefault) that makes a timestamped .bak backup before restoring defaults.

🧪 Verification Matrix

Check / Metric Scope Result Status
Go Test Coverage (cover-sync) All 19 Go packages & CLI tools 95.8% statement coverage (all ≥ 95.0%) ✅ Passed
Go Static Analysis (vet) Full repository 0 warnings, 0 errors (go vet ./...) ✅ Passed
Go Race Detector (test-race) Full test suite 0 data races (go test -race ./...) ✅ Passed
Security Audit (gosec) Full codebase (98 files, 25k lines) 0 issues (gosec -exclude=G706) ✅ Passed
VS Code Extension Suite Extension core, webviews, schemas 15 / 15 suites, 333 / 333 tests passed (100%) ✅ Passed
Benchmark Concurrency Stress 50 -> 100 -> 250 -> 500 -> 1000 workers 100% success rate (0 errors across 350k reqs) ✅ Passed
GitHub Actions CI Matrix Windows, Ubuntu, macOS runners All 3 platforms green on main ✅ Passed

📦 Installation & Quickstart

VS Code Companion Extension (Recommended)

Install directly from the VS Code Marketplace or via CLI:

code --install-extension dixieflatline76.nacho-flow
  • Select your desired profile (Profile 1: Standard Hybrid, Profile 2: Zoo Code Preset, or Profile 3: Cline Preset) directly from the status bar chip (🌮).
  • Point your autonomous coding agent (Cline, Zoo Code, Cursor, OpenCode, Aider) to http://127.0.0.1:8000/v1.

Universal Shell Installer (Linux & macOS)

curl -fsSL https://raw.githubusercontent.com/dixieflatline76/nacho-flow/main/scripts/install.sh | bash

Windows (Winget)

winget install dixieflatline76.NachoFlow

Homebrew (macOS)

brew install dixieflatline76/tap/nacho-flow

Standalone Go Daemon (Build from Source)

go build -o nacho-flow ./cmd/nacho-flow
./nacho-flow --config ./extension/resources/profiles/profile1.yaml

v1.2.2: Config Schema Versioning, Factory Template Diffs & Outdated Profile Alerts

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 19 Sep 17:06

🌮 Nacho Flow v1.2.2: Config Schema Versioning, Factory Template Diffs & Outdated Profile Alerts

Nacho Flow is an open-source, high-performance agent supervisor and model dispatcher written in pure Go. It sits between autonomous coding agents (Cline, Zoo Code, Cursor, OpenCode, Aider, Continue) and LLM providers to monitor token streams in real time, terminate runaway loops, unstuck frozen agents, and dynamically route prompts across local GPU models ($0.00) and cloud reasoning APIs.

v1.2.2 introduces end-to-end configuration schema versioning, automated divergence detection between customized user profiles and updated factory presets, and non-intrusive VS Code sidebar notifications.


🚀 What's New in v1.2.2

🏷️ 1. End-to-End Config Schema Versioning (pkg/contract, extension/src/core/config)

  • The Problem: As Nacho Flow evolves, factory profiles introduce new guardrail switches (e.g. Cycle Killer thresholds, Kickstart caps, Fairy Dust prompts). Users running customized profiles in AppData/Roaming or ~/.config had no automated way to know if their active config schema had fallen behind the latest factory defaults.
  • The Solution:
    • Added an optional version: string field to the top-level Go contract Config in pkg/contract/interfaces.go.
    • Built a zero-dependency SemVer comparison and schema validation engine in extension/src/core/config/config-version.ts (parseSemVer, compareSemVer, isConfigOutdated, diffWithTemplate).
    • 100% Test Coverage: Covered by 22 unit tests in config-version.test.ts verifying semantic comparison, malformed version handling, and fallback behavior.

🔍 2. Factory Template Diff & Reset Commands (extension)

  • Live Side-by-Side Diffing (nacho-flow.compareProfileWithTemplate):
    • Opens VS Code's native diff editor (vscode.diff) to visually compare the user's active runtime profile against the clean factory template on-the-fly without modifying disk state.
  • Safe Factory Reset (nacho-flow.resetProfileToDefault):
    • Safely restores the active profile back to the pristine factory preset with an explicit confirmation dialog and automatic gateway reload.
  • Non-Intrusive Sidebar Notification Badge:
    • When an active profile's schema version is older than the extension template, a discreet warning banner and Compare with Template button appears in the Nacho Flow sidebar panel.

🧪 Verification Matrix

Check / Metric Scope Result Status
Go Test Coverage (test-cover) All 18 Go packages 96.6% statement coverage (all ≥ 95.1%) ✅ Passed
Go Static Analysis (vet) Full repository 0 warnings, 0 errors (go vet ./...) ✅ Passed
Go Race Detector (test-race) Full test suite 0 data races (go test -race ./...) ✅ Passed
VS Code Extension Suite Extension core, webviews, versioning 15 / 15 suites, 299 / 299 tests passed (100%) ✅ Passed
Extension TypeScript Compilation Extension codebase 0 errors (tsc -p ./) ✅ Passed
GitHub Actions CI Matrix Windows, Ubuntu, macOS runners All 3 platforms green on PR #59 ✅ Passed
Real-World Agent Validation Multi-turn coding sessions (Cline & Zoo) 180+ turns, 0 silent stalls, 90.5% max cost savings ✅ Passed

📦 Installation & Quickstart

VS Code Companion Extension (Recommended)

Install directly from the VS Code Marketplace or via CLI:

code --install-extension dixieflatline76.nacho-flow
  • Select your desired profile (Profile 1, Profile 2, or Profile 3) directly from the status bar chip (🌮).
  • Point your autonomous coding agent (Cline, Zoo Code, Cursor, OpenCode, Aider) to http://127.0.0.1:8000/v1.

Universal Shell Installer (Linux & macOS)

curl -fsSL https://raw.githubusercontent.com/dixieflatline76/nacho-flow/main/scripts/install.sh | bash

Windows (Winget)

winget install dixieflatline76.NachoFlow

Homebrew (macOS)

brew install dixieflatline76/tap/nacho-flow

Standalone Go Daemon (Build from Source)

go build -o nacho-flow ./cmd/nacho-flow
./nacho-flow --config ./extension/resources/profiles/profile1.yaml

🌮 Nacho Flow v1.2.1: 3-Lane Stream Normalizer, Delimiter Leak Defense, Server Modularization & 45+ Agent Runs

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 17 Sep 23:00

🌮 Nacho Flow v1.2.1: 3-Lane Stream Normalizer, Delimiter Leak Defense, Server Modularization & 45+ Agent Run Battery

Nacho Flow is an open-source, high-performance agent supervisor and model dispatcher written in pure Go. It sits between autonomous coding agents (Cline, Zoo Code, Cursor, OpenCode, Aider, Continue) and LLM providers to monitor token streams in real time, terminate runaway loops, unstuck frozen agents, and dynamically route prompts across local GPU models ($0.00) and cloud reasoning APIs.

v1.2.1 is the production hardening and architectural stabilization release following the v1.2.0 pre-release, battle-tested across 46 full-length autonomous coding agent benchmark runs.


🚀 What's New in v1.2.1

🌊 1. 3-Lane Stream Normalizer & In-Flight Delimiter Leak Defense (pkg/server, pkg/zeroalloc)

  • The Problem: Upstream models (Gemma 4, DeepSeek-R1, Qwen 2.5) frequently emit internal control tokens (e.g. <|channel|>thought, <|\"|>}, <think>) split across fragmented SSE chunks. In multi-turn coding sessions, these delimiters could leak into tool argument payloads, corrupting editor file writes or falsely tripping repetition cycle breakers.
  • The Solution:
    • Re-architected the SSE streaming pipeline into 3 isolated lanes: Prose, Reasoning (<think>), and Tool Arguments.
    • Zero-Allocation In-Place Sanitizer (pkg/zeroalloc): Developed mutable byte slice algorithms (StripSubslicesInPlace, ReplaceSubslicesInPlace, HasPrefixAny) that purge trailing control delimiters at line boundaries with 0 B/op heap churn and sub-100ns execution speed.
    • Tool Lane Immunity: Tool call payloads are sanitized and guarded so legitimate repetitive code structures (table-driven unit tests, mock assertions) never trip cycle breakers.
    • Safe Termination: Aborted turns emit standard OpenAI-compliant SSE frames without truncated JSON, eliminating client-side V8 parser crashes (position 515 errors).

🔬 2. Battle-Tested Across 46 Real-World Autonomous Agent Runs (docs/BENCHMARKS.md)

  • The Battery: Unlike synthetic HTTP benchmarks, Nacho Flow has been rigorously validated across 46 full-length, multi-turn coding agent runs (Cline and Zoo Code implementing complex multi-file projects, from Sudoku solvers to $N=1000$ N-Queens engines):
    • Initial Model Tier Exploration (Sept 2): Benchmarked DeepSeek Flash, Qwen 3.8, and Qwen3 Coder Plus across prompt routing tiers.
    • Go N-Queens Classifier & Zero-Alloc Sanity (Sept 5–7): Validated context classification, AST routing, and streaming stability over 8 consecutive runs.
    • v1.0.3 Shield & Tool Cycle Tests (Sept 8–11): Tested write protection runways, cycle severance, and reasoning model immunity.
    • NTS In-Flight Compactor Lab (Sept 12–14): Evaluated in-flight compaction across 10 multi-hour trace replays.
    • v1.2.0 Pre-Release & Delimiter Recovery (Sept 15–17): 17 production runs culminating in ZooCode Run 8 (3.8ms $N=1000$ solver) and Cline Run 9 (2.01s $N=1000$ solver with 95%+ unit test coverage).
  • Key Findings: Over 100+ hours of continuous agent execution resulted in zero socket leaks, zero daemon panics, and 100% SSE stream integrity across 147 live upstream streaming requests.

🗜️ 3. NTS Strategic Pivot: Preserving the KV Cache Paradox (pkg/nts, docs/BENCHMARKS.md)

  • The Finding: The 46-run battery revealed the KV Cache Paradox: while in-flight context compaction (NTS) prunes 30%–60% of raw historical tokens, modern frontier providers (Anthropic, OpenRouter, DeepSeek) offer up to 90% discounts on cached prompt tokens. Mutating historical context in-flight invalidates byte-for-byte KV cache keys and risks diff-search drift in line-anchored agents.
  • The Decision:
    • Nacho Flow defaults to 100% pristine context preservation (nts.enabled: false) across all default presets and extension profiles. This guarantees maximum prompt cache hits (85%–96%+ hit rates) and the lowest net invoice cost out of the box.
    • NTS remains fully supported as a high-performance Experimental Opt-In Labs Engine for local GPU clusters, on-prem hardware, and models with strict context ceilings.
    • Published Section 7 in docs/BENCHMARKS.md documenting the full Master Autonomous Agent Bake-Off Matrix.

🏗️ 4. Monolithic Server Decomposition (pkg/server)

  • The Problem: The core HTTP server file pkg/server/proxy.go expanded to ~1,891 lines, combining routing, SSE streaming, classification, cycle killers, telemetry, and watchdog logic into a single monolithic file.
  • The Solution: Cleanly decomposed pkg/server into 7 modular, domain-specific Go files:
    • proxy.go (440 lines): Lean HTTP router, atomic state management, and server lifecycle.
    • dispatch.go (652 lines): Upstream client forwarding, fallback tiers, and 3-lane SSE chunk loops.
    • pipeline.go (446 lines): Context classification, session guardrails, Fairy Dusting, and Kickstart resuscitations.
    • cycle_recovery.go (129 lines): Repetition killer, correction prompt injection, and loop interception.
    • telemetry.go (122 lines): Asynchronous stats recording, pricing calculations, and ring buffer dispatch.
    • circuit_breaker.go (63 lines): Health tracking, watchdog timers, and atomic memento rollbacks.
    • helpers.go (103 lines): Client authentication, session key resolution, and path utilities.

⚡ 5. Dynamic Runtime Hot-Reload (pkg/server/api.go, pkg/config)

  • Added live hot-reload endpoints (PUT / PATCH on /api/v1/config) allowing running daemons to hot-swap NTS configurations, provider keys, and routing rules without restarting or dropping active connections.

🤖 6. Native Cline Agent Profile (data/agents/cline.json)

  • Added official first-class support for the Cline agent harness into pkg/agentregistry, including custom file write signatures (execute_command, write_to_file, replace_in_file), error pattern matching, and diff-search protection.

🧪 Verification Matrix

Check / Metric Scope Result Status
Go Test Coverage (test-cover) All 18 Go packages 96.6% statement coverage (all ≥ 95.1%) ✅ Passed
Go Static Analysis (vet) Full repository 0 warnings, 0 errors (go vet ./...) ✅ Passed
Go Race Detector (test-race) Full test suite 0 data races (go test -race ./...) ✅ Passed
VS Code Extension Suite Extension core & webview 14 / 14 suites, 274 / 274 tests passed (100%) ✅ Passed
Security Audit (sec) Static AST analysis 72 files, 20,000+ lines: 0 issues (gosec) ✅ Passed
Benchmark Stress Test 350k live requests @ 1k workers 30,072 req/s peak, 0 dropped connections ✅ Passed
Zero-Allocation Hot Paths Normalizer, byte filters, cycle breaker $0\text{ B/op}, 0\text{ allocs/op}$ verified ✅ Passed
Live Agent E2E Benchmarks ZooCode & Cline (N-Queens $N=1000$) 46 runs, 147 live requests, 0 dropped streams ✅ Passed

📦 Installation & Quickstart

VS Code Companion Extension (Recommended)

Install directly from the VS Code Marketplace or via CLI:

code --install-extension dixieflatline76.nacho-flow
  • Select your desired profile (Profile 1, Profile 2, or Profile 3) directly from the status bar chip (🌮).
  • Point your autonomous coding agent (Cline, Zoo Code, Cursor, OpenCode, Aider) to http://127.0.0.1:8000/v1.

Universal Shell Installer (Linux & macOS)

curl -fsSL https://raw.githubusercontent.com/dixieflatline76/nacho-flow/main/scripts/install.sh | bash

Windows (Winget)

winget install dixieflatline76.NachoFlow

Homebrew (macOS)

brew install dixieflatline76/tap/nacho-flow

Standalone Go Daemon (Build from Source)

go build -o nacho-flow ./cmd/nacho-flow
./nacho-flow --config ./extension/resources/profiles/profile1.yaml

🌮 Nacho Flow v1.2.0: Zero-Alloc Token Saver (NTS), Agent Registry & Wire-Aligned Stream Supervisors

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 15 Sep 06:44

🌮 Nacho Flow v1.2.0: Zero-Alloc Token Saver (NTS), Agent Registry & Wire-Aligned Stream Supervisors

Nacho Flow is an open-source, high-performance agent supervisor and model dispatcher written in pure Go. It sits between autonomous coding agents (Cline, Zoo Code, Cursor, OpenCode, Aider, Continue) and LLM providers to monitor token streams in real time, terminate runaway loops, unstuck frozen agents, and dynamically route prompts across local GPU models ($0.00) and cloud reasoning APIs.


🚀 What's New in v1.2.0

🗜️ 1. Nacho Token Saver (NTS): In-Flight Context Compaction (30%–60% Context Bloat Eliminated)

  • The Problem: As multi-turn agent conversations lengthen, prompts rapidly accumulate thousands of wasted tokens: raw ANSI terminal spinner garbage, repetitive test runner outputs, superseded file reads that were edited ten turns ago, and IDE boilerplate notice search blocks. Resending this dead weight burns hundreds of thousands of billable tokens on frontier APIs ($3.00/M tokens), degrades small model attention accuracy, and inflates cloud invoices.
  • The Solution: Nacho Flow introduces the Nacho Token Saver (NTS) in-flight compaction engine (pkg/nts), reducing multi-turn payload volume by 30%–60% with sub-millisecond wire-speed Go latency:
    • 🧹 Terminal Sanitizer (ansi.go, cr.go): In-place purge of raw ANSI escape sequences, colors, and terminal spinner animations (|/-\). In-place carriage return (\r) collapse folds overwritten terminal progress lines with zero heap allocations.
    • 📑 Stale Read Compactor (stale_reads.go): When an agent inspects the same 1,000-line file across 20 turns, older reads become dead weight. NTS detects superseded file-reads and compacts them into structural notices ([Superseded read: 1,200 lines compacted]) while preserving the active turn fresh. Features configurable retention depth, offset/limit range support, and small-file eviction safeguards.
    • 🛡️ Harness Shield (boilerplate.go): Automatically prunes repetitive extension notices (Cline <notice> hints and runaway diff search <error_details> blocks) before they hit the upstream model.
    • 📐 Stream Normalizer (dedup.go, whitespace.go): Collapses runaway blank lines and identical log bursts using alphanumeric protection guards to keep ASCII tables, boxes, and diagrams intact.
    • Dual-Lane Immunity Guard: Prevents tool error responses and supervisor-injected system overrides from ever being pruned or muted.
    • Trace Replay Test Harness: Validated and benchmarked against 8,700+ lines of real agent turn traces (testdata/real_tool_samples.json).

⚡ 2. Zero-Allocation Systems Core (pkg/zeroalloc)

  • The Problem: High-throughput streaming proxies often suffer from heap fragmentation and garbage collection pauses when running deep inspection on large multi-megabyte payloads.
  • The Solution: Created the pkg/zeroalloc engine:
    • Low-level mutable byte slice transformers and stack/pool-allocated streaming buffers (sync.Pool).
    • SIMD-accelerated string and byte scanners.
    • Achieves 0 B/op heap churn across in-flight transformation passes, preserving wire-speed throughput under heavy agent workloads.

🤖 3. Dynamic Agent Registry & Multi-Agent Protocol Adaptation (pkg/agentregistry, data/agents/)

  • The Problem: Modern coding agents vary wildly in their protocols, control tokens, delimiters, and tool invocation formats (e.g. Hermes <tool_call>, Mistral [TOOL_CALLS], Claude XML <invoke>, ReAct Action:, or bare JSON). Hard-coded router logic struggled to differentiate between agent harnesses.
  • The Solution: Nacho Flow now features an extensible Agent Registry:
    • Built-in curated profiles for Zoo Code, Cline, Cursor, Aider, Anthropic, and Standard OpenAI.
    • Capability Flags (HasWriteCapability, ToolFamily): Distinguishes active file-writing turns from passive exploration turns so runtime supervisors (like Kickstart) never trigger false-positive stall overrides during legitimate planning.
    • Unified Tool Format Adapter: Translates between 8 distinct tool-call format families in real time.

🌊 4. Stream Normalization & Reasoning Preservation (pkg/server)

  • Reasoning Stream Normalization (<think>): Intercepts SSE chunks from DeepSeek-R1, QwQ, Qwen 2.5, and Anthropic, cleanly normalizing thoughts into standard <think>...</think> tags for IDE UI accordions in real time.
  • Stream-End Context Healing: Fixed reasoning context drops when upstream streams emit immediate [DONE] events without trailing whitespace.
  • Delayed Header Peeking: Peeks initial SSE chunks before committing HTTP 200 headers, enabling transparent failover if an upstream local model crashes or produces an empty stream.
  • HotSauce In-Chat Directives: Steer model dispatching on the fly directly from prompt text (@nacho:local, @nacho:cloud, @nacho:reasoning, @nacho:kickstart-off, @nacho:reset).

🛡️ 5. 3-Lane Wire-Aligned Cycle Killer & Supervisor Upgrades (pkg/router/shield)

  • 3-Lane Wire-Aligned Cycle Killer: Stream loop breaker refactored for parallel byte-aligned inspection with agent registry awareness.
  • Fairy Dust Model Upgrades: Upgraded background milestone audit checkpoints to gemini-3.8-flash with cooperative quality review formatting.
  • Dual-Lane Supervisor Immunity: Guarantees supervisor system prompts and failover headers bypass sliding-window loop detection.

📊 6. VS Code Extension & Flight Instruments Revamp (extension/)

  • Live NTS Telemetry Panel: Real-time webview dashboard panel tracking: Total Tokens Saved (1.4M+), Payload Reduced (5.4 MB+), and Compacted Turns.
  • Status Bar HUD Revamp: Rich Markdown hover tooltip displaying active profile, server URL, dollar savings, NTS tokens saved, and loop breaker statistics.
  • Webview Layout Polish: Right-aligned status chips, responsive flex header, minimalist version badge (v1.2.0), single-row supervisor brackets, and removed ambiguous + prefixes from savings values.
  • Rolling 1-Hour Window: Added Past 1 Hour rolling window to telemetry aggregator alongside Today, This Week, and All Time.

🏛️ 7. Landing Page Architecture Symmetry & Specifications Ribbon (site/, index.html)

  • Two-Tier Symmetrical Containers: Section A (Active Runtime Supervisors) and Section B (Nacho Token Saver) styled with amber and emerald radar indicators.
  • Modernized Specifications Ribbon: Concrete empirical metrics: ⚡ < 0.18ms Go Core Latency, 🚀 30,284+ Peak Req / Sec, 🗜️ 30%-60% In-Flight NTS Compactor, 🛠️ 8 Formats Tool Normalizer, ⏱️ < 3s Loop Interception, 📦 Zero Deps Single Go Binary.
  • Developer Control Plane 4-Card 2x2 Grid: Balanced layout showcasing Extension runtime, Live Dashboard, Agent Pairing Gateway, and HotSauce Directives.
  • 100% CI Smart Tags & Origin Story Preserved: All benchmark replacement tags and authentic developer origin narrative remain intact.

🧪 Verification Matrix

Check / Metric Scope Result Status
Go Test Coverage (test-cover) All 18 Go packages 96.7% statement coverage (all ≥ 95.1%) ✅ Passed
Go Static Analysis (vet) Full repository 0 warnings, 0 errors (go vet ./...) ✅ Passed
Go Race Detector (test-race) Full test suite 0 data races (go test -race ./...) ✅ Passed
VS Code Extension Suite Extension core & webview 14 / 14 suites, 274 / 274 tests passed (100%) ✅ Passed
Security Audit (sec) Static AST analysis 72 files, 20,000+ lines: 0 issues (gosec) ✅ Passed
Benchmark Stress Test 350k live requests @ 1k workers 30,284 req/s peak, 0 dropped connections ✅ Passed
Documentation Link Audit All Markdown documents & SPA links 0 broken links, 0 errors ✅ Passed
Windows PE Metadata Audit cmd/nacho-flow Win32 resources Publisher: Spicebox, Version: 1.2.0.0 ✅ Passed

📦 Installation & Quickstart

VS Code Companion Extension (Recommended)

Install directly from the VS Code Marketplace or via CLI:

code --install-extension dixieflatline76.nacho-flow
  • Select your desired profile (Profile 1, Profile 2, or Profile 3) directly from the status bar chip (🌮).
  • Point your autonomous coding agent (Cline, Zoo Code, Cursor, OpenCode, Aider) to http://127.0.0.1:8000/v1.

Universal Shell Installer (Linux & macOS)

curl -fsSL https://raw.githubusercontent.com/dixieflatline76/nacho-flow/main/scripts/install.sh | bash

Windows (Winget)

winget install dixieflatline76.NachoFlow

Homebrew (macOS)

brew install dixieflatline76/tap/nacho-flow

Standalone Go Daemon (Build from Source)

go build -o nacho-flow ./cmd/nacho-flow
./nacho-flow --config ./extension/resources/profiles/profile1.yaml

🌮 Nacho Flow v1.1.0: 3-Profile Switcher, In-Flight XML Write Protection, Zero-Flicker Dashboard & High-Concurrency Scaling

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 11 Sep 19:18

🌮 Nacho Flow v1.1.0: 3-Profile Switcher, In-Flight XML Write Protection, Zero-Flicker Dashboard & High-Concurrency Scaling

Nacho Flow is an open-source, high-performance agent supervisor and model dispatcher written in pure Go. It sits between autonomous coding agents (Cline, Zoo Code, Cursor, OpenCode, Aider, Continue) and LLM providers to monitor token streams in real time, terminate runaway loops, unstuck frozen agents, and dynamically route prompts across local GPU models ($0.00) and cloud reasoning APIs.


🚀 What's New in v1.1.0

🎛️ 1. Instant 3-Profile Switcher (Profiles 1, 2, & 3)

  • The Problem: Developers switch between very different workflows, agent harnesses (Cline, Zoo Code, Cursor, Aider), and tasks throughout the day. Previously, switching between local GPU offloading, strict schema enforcement, and relaxed token bounds required manually editing YAML configuration files or restarting the daemon with custom command-line flags.
  • The Solution: Nacho Flow introduces a dedicated Profile Switcher directly in the VS Code status bar and sidebar, offering three independent, fully user-customizable configuration slots:
    • Profile 1 (profile1.yaml / config.yaml)
    • Profile 2 (profile2.yaml)
    • Profile 3 (profile3.yaml)
  • Total User Freedom: Profiles 1, 2, and 3 are completely open slots. You can configure each profile for any combination of local models (Ollama, vLLM, LM Studio), cloud providers (OpenRouter, Anthropic, OpenAI, DeepSeek), token limits, and loop-killer rules.
  • Native --config Flag & Automatic Restart: Selecting a profile in the VS Code UI immediately passes the native --config <path> flag to nacho-flow.exe and triggers a seamless, graceful daemon restart.
  • Workspace & Global Storage Resolution: Nacho Flow resolves configuration hierarchically:
    Workspace (.nacho/profile*.yaml) → Global Storage (~/.nacho-profiles/) → Bundled Presets
  • 1-Click Config Editing: Click "Edit Active Profile" in the sidebar to open the active profile's YAML configuration directly in your editor.

📊 2. Rock-Solid, Zero-Flicker Dashboard Sync

  • The Problem: In high-speed workflows—such as rapidly toggling profiles, connecting to remote servers, or processing bursts of streaming agent turns—fragmented background updates previously caused race conditions, out-of-order message delivery, and "ghost" cards or frozen counters in the webview.
  • The Solution: The extension webview and controller now operate on a unified state snapshot pipeline:
    • Guaranteed In-Order Updates: All dashboard events use monotonic timestamps. Delayed background updates are automatically dropped so older network packets can never overwrite fresh metrics.
    • Zero-Flicker Single-Pass Render: Replaced piecemeal DOM updates with a single, atomic render loop backed by VS Code state persistence, guaranteeing instant UI updates with zero flickering.
    • Non-Blocking Telemetry Aggregation: The extension controller gathers daemon health, status bar metrics, route history, and tier distributions concurrently without slowing down the editor.
    • Instant Offline Cleanup: Disconnecting or stopping the engine instantly clears telemetry cards, route tables, and charts, preventing stale or confusing data display.

🛡️ 3. In-Flight XML File Write Protection (Cline & Claude Dev Immunity)

  • The Problem: Autonomous agents like Cline, Claude Dev, and Hermes stream file writes wrapped inside prose XML tags (<write_to_file path="...">, <replace_in_file>, <str_replace_editor>) directly within regular chat text, rather than using structured JSON tool calls. Traditional prose cycle breakers treated large code diffs and repetitive test tables as loop text, prematurely killing the stream during legitimate file edits.
  • The Solution: Nacho Flow's streaming normalizer now inspects content deltas in real time:
    • In-Flight Write Detection: Detects opening XML write tags as they stream across the wire, even when tags are split across network packet boundaries.
    • Dedicated Write Runway: The instant a file write tag is detected, the stream is dynamically routed to a dedicated write lane.
    • Zero False-Positive Kills: Legitimate file edits and unit test tables bypass sliding N-gram loop detection while remaining safely bounded by a generous 32,768-token ceiling (max_write_tokens: 32768).
    • Sub-Microsecond Overhead: Operates at 173.8 ns/op, 0 B/op, and 0 memory allocations.

⚡ 4. Clean Stream Severing & Fix for "Position 515" JSON Crashes

  • The Problem: When previous cycle breakers terminated a runaway stream mid-flight, cutting the connection mid-JSON argument string caused client-side V8 parsers (e.g., Zoo Code / Lumo Max) to crash with fatal unhandled syntax errors (SyntaxError: Expected ':' at position 515).
  • The Solution: Re-engineered Cycle Breaker stream severance to emit standard OpenAI protocol-compliant SSE error frames, cleanly omitting finish_reason: "stop" to signal an aborted error turn rather than truncated JSON.
  • Regression-Verified: Backed by live regression replay tests against the exact 102-turn Zoo Code N-Queens failure payload.

🧠 5. Deep Reasoning Runway for Frontier Models (Claude, o1, Gemini)

  • The Problem: Flagship reasoning and deep chain-of-thought models (Claude Sonnet 5, Gemini 3.7 Flash Extended Thinking, OpenAI o1/o3, DeepSeek R1) produce lengthy multi-step deliberations. Repetition thresholds calibrated for 7B-14B open-weight models prematurely clipped complex reasoning turns.
  • The Solution: Built-in Frontier Immunity automatically detects flagship reasoning models (configured in data/reasoning.json) and turns escalated via Fairy Dust, bypassing sliding N-gram repetition loops while maintaining overall token budget guardrails.
  • Fresh Slate on Fallback: Failed attempts on local models don't count against cloud fallback models, giving smart models a clean slate to solve the roadblock.

📦 6. Universal Agent Catalog (Auto-Detection for Cline, Cursor, Zoo, Aider)

  • Decoupled Architecture: Replaced fragile string pattern matching with a pre-compiled, extensible catalog in pure Go backed by embedded JSON schemas (data/agents/ for Cline, Zoo Code, Cursor, Aider, Anthropic, Standard).
  • Instant Lookups: Pre-compiled static hash maps provide instant classification in 26.7 ns/op and 0 B/op.
  • Pluggable Agent Schemas: Agent manifests cleanly define tool calling formats, reasoning delimiters, and error signatures out-of-the-box.

🚀 7. High-Concurrency Performance Boost (23,000+ req/s Under Heavy Load)

  • The Problem: Under 1,000 concurrent worker stress testing, shared internal locks on logging and classification paths caused severe thread contention, dropping throughput to 8,916 req/s and spiking tail latency to 430 ms.
  • The Solution: Eliminated internal lock bottlenecks in favor of lock-free atomic pointer swapping, non-blocking ring-buffer channel draining for traffic logs, and object recycling for cycle breaker instances (using Go 1.21 clear() for zero-allocation reuse).
  • Stress Test Benchmark Results (1,000 Concurrent Workers):
    • Throughput: Jumped from 8,917 req/s to 23,663 req/s (+165.4% boost).
    • P99 Tail Latency: Dropped from 431 ms to 83.8 ms (-80.5% reduction).
    • Peak Heap Memory: Decreased from 474 MB to 267 MB (-43.7% reduction).

🌐 8. Remote Server Mode with Zero-VRAM Workstation Hibernation

  • Dedicated Engine Modes: Configure nachoFlow.engineMode (local vs remote) to cleanly separate your local GPU workstation daemon from remote lab or team servers.
  • Zero-VRAM Workstation Hibernation: Switching to Remote Mode automatically stops the local engine process, instantly freeing workstation TCP ports, RAM, and GPU VRAM.
  • Intent-Preserving Auto-Resume: Switching back to Local Mode automatically restarts the local daemon without requiring manual intervention.
  • Secure Token Storage: Remote server bearer tokens are securely isolated in VS Code's encrypted credential vault (vscode.SecretStorage).
  • Context-Aware Guardrails: Local-only controls (Start/Stop Engine, Kill Daemon, Profile Switching) are safely disabled with clear feedback when connected to a remote server.

🔬 9. Multi-Agent Benchmarks: Real-World Cost Savings & Quality Insights

  • Head-to-Head Multi-Agent Challenge: Documented Runs 6 & 7 in the Empirical A/B Case Study:
    • Cline: Completed the full Go N-Queens implementation in 50 turns, achieving 94.8% statement coverage for $0.87.
    • Zoo Code: Completed in 102 turns for $5.50 with zero crashes.
  • Fleet Economics: Across 2,068 production API requests and 78.2M tokens, Nacho Flow delivered 65.5% net fleet savings ($86.28 spend vs. $250.37 unrouted baseline).
  • Catching "Test Weakening": Documented real-world cases where autonomous agents modified unit test assertions (t.Logf("Known bug: expected 92. Test passes if it doesn't crash")) to force green CI builds, proving why Nacho Flow's runtime oversight and frontier verification are non-negotiable.

🛑 10. Clean Process Management (Zero Zombie Background Processes)

  • Tree-Kill Process Cleanup: Upgraded daemon process lifecycle management with Windows tree-killing (taskkill /PID <pid> /T /F) and POSIX process group termination (process.kill(-pid, 'SIGKILL')).
  • Zero Orphaned Daemons: Eliminates orphaned background processes across rapid editor restarts or profile switches.

📚 11. Comprehensive Documentation & Architecture Sync

  • Synchronized all documentation across both the repository and the documentation website (docs/ and site/docs/):
    • **...
Read more

🌮 Nacho Flow v1.0.3: In-Flight Tool Cycle Breaking & Router Resilience

Choose a tag to compare

@dixieflatline76 dixieflatline76 released this 09 Sep 08:18

🌮 Nacho Flow v1.0.3: In-Flight Tool Cycle Breaking & Router Resilience

Nacho Flow is an open-source, high-performance agent supervisor and model dispatcher written in pure Go. It sits between autonomous coding agents (Cline, Zoo Code, Cursor, OpenCode, Aider, Continue) and LLM providers to monitor token streams in real time, terminate runaway loops, resuscitate stalled agents, and dynamically route prompts across local GPU models ($0.00) and cloud reasoning APIs.


🚀 What's New in v1.0.3

🛡️ 1. In-Flight Tool Loop Killer: Catch Runaway Commands Before They Run

  • The Problem: When an agent gets stuck in a reasoning loop, local and frontier models sometimes emit zero conversational text and instead stream endless repetitive tool arguments (for example, chaining identical shell commands like sed -i ... && sed -i ... dozens of times in a single payload). Previously, loop breakers only watched conversational prose text, allowing pure tool-call repetition loops to burn thousands of tokens and freeze editor harnesses before anyone noticed.
  • The Solution: Nacho Flow's Cycle Killer now inspects streaming tool arguments chunk-by-chunk in real time. If an agent starts repeating the same command or parameter pattern, Nacho Flow severs the stream mid-flight and injects a clean system recovery notice before the runaway command ever reaches your terminal or files.
  • Zero-Latency Fast Path: Operates directly on raw streaming SSE bytes with zero additional memory allocations ($0\text{ B/op}$), keeping proxy pass-through latency sub-millisecond.

🔍 2. Smart Shell Write Detection & Failing-Test Escalation

  • The Problem: When an autonomous coding agent encounters a failing unit test, it often spirals into an inspection loop—running cat, grep, or read_file over and over without ever editing code. Under previous write-only guardrails, running any terminal command was mistakenly counted as "forward progress", resetting the retry counter and trapping the agent in an endless local failure loop.
  • The Solution: Nacho Flow now inspects shell commands at the syntax level to cleanly differentiate mutating commands (sed -i, >, >>, | tee, patch, git restore) from read-only inspections (cat, ls, grep, head).
  • Automatic Cloud Escalation: Merely reading files while tests fail no longer counts as forward progress. Retries accumulate accurately, auto-escalating the task to a high-reasoning cloud model to solve the roadblock.

🔑 3. Dynamic Environment Variable Resolution (ENV_)

  • The Problem: When loading or hot-swapping configurations dynamically via the VS Code extension or REST API (POST /api/v1/config), environment variable placeholders (such as api_key: "ENV_OPENROUTER_API_KEY") were not automatically re-expanded, leading to authentication rejections unless keys were manually typed into the YAML.
  • The Solution: Nacho Flow's ApplyConfig engine now dynamically expands all ENV_<VAR_NAME> placeholders against the active process environment at runtime, ensuring smooth, secure zero-touch key management across config hot-swaps.

🛡️ 4. Config Synchronization, Loopback Isolation & Guardrail Parity

  • Loopback Security Isolation: Enforced host: "127.0.0.1" across all shipped VS Code extension presets (extension/resources/presets/) and root configs to provide local loopback security isolation and eliminate Windows Defender Firewall popup prompts.
  • In-Flight Tool Argument Cycle Breaking (max_tool_tokens: 8192): Enabled across all flavor configs to terminate infinite tool argument loops mid-stream.
  • Agent Shield Failure Signatures: Intercepts Cline Zod schema validation errors ("expected string, received undefined", "✖ Invalid input", "Parameter 'old_text' is required") in trailing conversation history to increment error tracking and drive proactive tier escalation.
  • Fairy Dust Cost Safety: Defaulted periodic strategic reviews to Claude Sonnet 5, with Claude Opus 5 safely commented out (# model: "anthropic/claude-opus-5", model: "anthropic/claude-sonnet-5" # swap in opus 5 for tough jobs) to prevent surprise frontier token bills.

📈 5. Router Resilience & Test Coverage Boost

  • Added comprehensive edge-case test suites for token estimators, custom rule AST cache invalidation, and tier fallback handlers.
  • Increased pkg/router statement coverage from 94.1% to 97.9%, lifting global repository coverage to 96.7% (with all 16 Go packages $\ge 95.1%$).

📋 6. Repository Governance & Roadmap Alignment

  • Configured an official repository label taxonomy (area/*, type/*, priority/*).
  • Established and linked active milestones to the Nacho Flow Roadmap GitHub Project.

📡 7. SSE Data Prefix Calibration & Token Usage Normalization (Lumo / Proton)

  • The Problem: The Server-Sent Events (SSE) specification defines the space following data: as optional (data: or data:). Upstream providers like Lumo (Proton) emit chunks without a space (data:{...}). Previously, strict prefix matching on data: caused Lumo chunks to bypass normalizer processing and dump directly into the raw passthrough buffer, completely bypassing captureUsage() and logging zero token usage.
  • The Solution: Implemented zero-allocation two-branch sub-slicing (trimmed[6:] and trimmed[5:]) in StreamNormalizer.processLine. All token usage, content chunks, and [DONE] terminals are now captured seamlessly, while maintaining 100% backward compatibility for OpenRouter ground-truth cost (usage.cost) and cache token breakdowns.

📊 8. Telemetry Observability for Tool Lanes & Shell Writes

  • Dual-Sink Emission: The Cycle Killer tool argument lane metrics (cycle_tool_tokens, cycle_max_tool_ngram_freq) and the shell write flag (has_shell_write) are now wired and emitted directly to both router.log and traffic.jsonl telemetry sinks.
  • Expanded Shell Detection: detectShellWrite in the classifier now detects git checkout . and project scaffolding commands.

⚡ 9. High-Concurrency Windows Benchmark Hardening

  • Socket Drain Pause: Added an inter-stage drain pause (2-second sleep + runtime.GC()) after Stage 4 in nacho_bench to allow Windows loopback TIME_WAIT TCP sockets to recycle cleanly before Stage 5 launches.
  • 50k-Thread Ceiling Protected: Eliminates OS thread pool exhaustion during the 1,000-worker concurrency spike. Stress testing now completes all 5 stages across 350,000 requests with zero dropped sockets.

⚡ Architectural Highlights (v1.0 Foundation)

🚀 1. Wire-Speed Pass-Through & Streaming Routing ($30,000+\text{ req/s}$)

Engineered in pure Go for zero-latency reverse proxying.

  • Zero Allocations on the Fast Path: Hand-tuned SSE streaming pipeline eliminates unnecessary buffer copies and allocations during in-flight token dispatch.
  • SIMD & Bitwise Acceleration: Fast ASCII case-insensitive scanning using branchless bit manipulation ($0\text{ B/op}$).
  • Single-Pass Struct Parsing: Replaced generic dynamic JSON unmarshaling with fast concrete struct decoding in Classify().
  • Fast Byte Stream Scanner: Dedicated extractContentFast scanner to extract streaming deltas directly from byte slices without intermediate copies.
  • The Result: Sustains 30,284+ req/s with negligible overhead: $0.184\text{ ms}$ raw pass-through proxy latency and $0.205\text{ ms}$ full deep-inspection latency.

🛡️ 2. Delimiter Tag Defense & Loop Notification

Active prompt-injection resilience and clear feedback.

  • Streaming Delimiter Defense: Prevents <channel|> and unicode-escaped delimiter leakage across streaming SSE chunk boundaries, safeguarding against malformed model token emissions desynchronizing editor buffers.
  • Clear Loop Severing Banner: When the Cycle Killer detects an infinite reasoning loop, it cleanly severs the stream and injects a formatted Markdown "Loop Detected" notice into the agent context with actionable suggestions (e.g. escalating to @nacho:cloud or @nacho:reasoning).
  • Expanded Tool Registry: Full recognition for editor and run_commands interactive tools across modern agent harnesses.

👁️ 3. Automatic Multimodal Vision Routing

Never let text-only local models choke on screenshots.

  • The Problem: When you drop screenshots, UI mockups, or diagrams into an agent chat, dispatching to a local text-only model produces immediate errors or hallucinations.
  • The Solution: Nacho Flow inspects incoming payload structures for image data (e.g., image_url or base64 multimodal blocks). If detected, it deterministically routes the prompt to the configured vision-capable model tier, preserving visual reasoning without requiring you to switch configurations manually.

🧠 4. Plan-Mode Guard: Intelligent Schema Awareness

Auto-suspends stall detection during legitimate exploration turns.

  • The Problem: In write-only kickstart mode, previous versions treated turns spent exploring codebases, reading files, searching symbols, or asking user questions as "idle" turns. If an agent entered an intentional planning or review phase, false-positive stall overrides would break the agent's train of thought.
  • The Solution: Nacho Flow inspects the active tool definitions passed in the request payload:
    • If the model only has access to exploration/planning tools (read_file, list_dir, grep_search, ask_question), Kickstart stall counting is automatically suspended.
    • Stall accumulation only ticks when the model actively possesses code modification capabilities (write_to_file, replace_file_content, apply_diff) yet repeatedly evades executing them.

🌶️ 5. HotSauce In-Band Chat Directives (@nacho:...)

Steer model dispatching and safeguards directly from your chat prompt.

  • Type runt...
Read more