Skip to content

Live-first runtime with tool system and stability pass#2

Merged
gabrimatic merged 4 commits intomasterfrom
feature/live-first-runtime
Mar 14, 2026
Merged

Live-first runtime with tool system and stability pass#2
gabrimatic merged 4 commits intomasterfrom
feature/live-first-runtime

Conversation

@gabrimatic
Copy link
Copy Markdown
Owner

@gabrimatic gabrimatic commented Mar 9, 2026

Summary

  • Redesigned as a voice-first on-device agent with 14 locally-dispatched tools
  • Concurrent input loops (typed + voice via Silero VAD + Local Whisper)
  • Deterministic complexity router (regex + weighted scoring, no ML deps)
  • Tool system: filesystem (sandboxed), browser (Playwright), screenshot, time, weather, clipboard, system info
  • First-run provider selector (Ollama, LM Studio, OpenRouter, Groq, OpenAI, custom)
  • Comprehensive stability pass: 40 issues found and fixed across all tools, streaming pipeline, and runtime
  • Full e2e test coverage: all 14 tools, all 9 commands, all edge cases verified

Key changes

  • src/runtime/ — New session orchestrator, preflight checks, voice input, speech controller, status presenter, first-run setup
  • src/tools/ — 14 tools with registry pattern, sandboxed filesystem, headless browser, 30s per-tool timeout
  • src/clients/ — Tool call history persistence via history parameter, text-format tool call recovery, 50-char buffer detection
  • src/chat/ — Deterministic complexity scorer with word-boundary regex, non-blocking screenshot capture
  • src/utils/ — Settings validation, isatty() theme support, zombie-free sound player, turn-aware message history
  • Docs updated: CHANGELOG, README, CONTRIBUTING, SECURITY

Test plan

  • 139 unit tests pass
  • Lint clean (ruff)
  • E2E: all 14 tools tested interactively
  • E2E: all 9 commands tested
  • E2E: edge cases (sandbox violation, non-existent files, binary files, bad .env values)
  • E2E: mock client path verified
  • E2E: box alignment, status card truncation, clean error messages verified

- Replace spaCy/CLIP-based ComplexityScorer with a lightweight, dependency-free
  pattern-matching router; remove words.py and all ML/NLP dependencies
- Add runtime/ layer (LiveSession, PreflightManager, ScreenObserver,
  SpeechController, StatusPresenter) for always-on live architecture
- Add session_state.py (QualityMode, InteractionStyle) to carry per-session
  context through message handling and model selection
- Rewrite main.py as a single live entry point; remove manual/voice mode menu
- Extend message_handler with interaction-style system prompts and quality-mode
  model overrides
- Add tests/ suite covering complexity scorer, session state, image history,
  and all mode runtimes
- Update setup.sh with preflight checks, update docs and lock file
- Implemented ToolRegistry for managing tool registration and execution.
- Added ScreenshotTool for capturing screenshots and reporting active applications.
- Created SystemInfoTool to report battery, disk, and memory status on macOS.
- Developed TimeTool to return the current date and time.
- Introduced WeatherTool to fetch current weather conditions using wttr.in.
- Added utility functions for ANSI color constants in terminal UI.
- Implemented comprehensive tests for browser, filesystem, and tool functionalities.
- Enhanced voice input module with tests for VAD and transcription processes.
- Added `_install_chromium` function to handle automatic installation of Playwright's Chromium binary if not found.
- Refactored `_launch_browser` to utilize the new installation function and retry launching the browser after installation.
- Updated error handling to provide clearer messages for installation failures.

style: Add DIM_ITALIC constant for italicized dim text in theme

- Introduced `DIM_ITALIC` escape sequence in `theme.py` for consistent styling.

test: Enhance PreflightResult tests for new wh_bin attribute

- Updated tests in `test_runtime.py` to assert the presence of `wh_bin` in various scenarios.
- Adjusted assertions related to microphone availability to reflect changes in PreflightResult structure.

test: Add tests for voice command functionality

- Created tests for `/voice on|off` commands in `test_runtime.py` to ensure proper enabling and disabling of voice features.
- Verified that the correct state is maintained when toggling voice commands.

test: Ensure CLI transcription uses resolved wh binary path

- Added test in `test_voice_input.py` to confirm that the correct `wh_bin` path is used during CLI transcription.

chore: Introduce startup.py for provider and model selection

- Created `startup.py` to manage the selection of AI providers and models when the backend is not configured or reachable.
- Implemented functions for setting up Ollama and LM Studio, including model fetching and environment configuration.
@gabrimatic gabrimatic changed the title Refactor to live-first runtime with deterministic complexity router Live-first runtime with tool system and stability pass Mar 14, 2026
@gabrimatic gabrimatic merged commit 43ff8e9 into master Mar 14, 2026
2 checks passed
@gabrimatic gabrimatic deleted the feature/live-first-runtime branch March 14, 2026 23:40
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.

1 participant