mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-26 02:05:31 +00:00
* fix(server): deliver an agent's messages in the order they were queued An agent's interrupt was dispatched alone, ahead of the steers queued before it. Those steers stayed queued and started a turn of their own after the interrupt's turn ended, so a stale instruction ran after the newer message that countermanded it. The queue now keeps one ordered list per recipient and only ever dispatches its front. An interrupt releases at admission and takes the older messages along in the same replacing prompt. A person's prompt takes the queue along the same way. Stop holds the queue for the recipient's next prompt instead of releasing it into a new turn, and does not drop it: the queue also carries finish notifications. A quiet window now closes after ten seconds at most, so steady arrivals cannot delay a waiting message without bound. * fix(server): keep a prompt's place in line until the provider admits it The queue removed a message when it handed the prompt to the agent manager, before the provider had admitted it. In that gap the order was no longer the queue's to decide: - a person's prompt or a later interrupt sent while the provider was still starting a turn could pass a prompt that was admitted first; - Stop during that start no longer saw the interrupt waiting to replace the turn, so the interrupt started a turn after the Stop; - queued messages that rode a person's prompt were settled when the prompt was handed over, so a turn the provider rejected dropped them. A message now stays in its recipient's list until the provider admits the prompt that carries it, fails it, or the message is withdrawn. Every prompt takes its place at admission, one operation acts on a recipient at a time, and each operation covers only what was admitted before it got in line. Stop holds every message still in the list and clears the interrupt's urgency, so a held interrupt waits like a steer. A prompt is a command only when it starts with a slash and a name with no second slash, matching how providers read it. A prompt that begins with a path now carries the queue like any other text. An interrupt the provider runs as a command beside the turn takes no queued message along, because it replaces nothing. Test wiring that builds the MCP catalog or stubs the agent manager now supplies the delivery module and the stop signal the server requires. * fix(server): keep queue decisions made before a Stop or shutdown from going stale Three races in the window where the provider is still starting or stopping a turn: - An interrupt admitted while a polling queue step was already in line got no step of its own. A person's steer sent next took the interrupt along and steered the turn the interrupt should have replaced. An interrupt now always reserves its place at admission. - A dispatch in flight when Stop arrived checked the queue's phase to learn it was void. A message admitted before the provider answered moved the queue out of `held`, so the old dispatch became valid again: an interrupt from before the Stop started a turn alone, and a batch whose starting turn Stop canceled was rejected instead of kept. Each dispatch now records the Stops its recipient had seen when it was decided and is void once that count changes. - Shutdown drained only what was queued when it began, so messages a rejected person's turn returned afterwards were left to the retry timer. The drain now runs after the operation in flight and reads the queue then. * fix(server): void queue steps that were reserved before a Stop A queue step that was already in line when Stop arrived checked for a Stop only from the moment it ran. When an interrupt arrived while the provider was still stopping, the queue left `held`, and the old step started a turn with the held messages. The new interrupt then replaced that turn in a second one. A step now watches for a Stop from the moment it reserves its place and does nothing once one has arrived. The held messages go with the next prompt admitted after the Stop, in one turn. The interleaving test gains a variant with a provider that is slow to answer. It checks, for every five-step sequence, that no queue dispatch after a Stop carries only messages from before it. * fix(server): hold the queue again when the message that reopened it is withdrawn After a Stop, a message admitted later reopens the queue and takes the held messages along. When that message was withdrawn before its quiet window closed, for example a change-request update whose watch was cancelled, the window still fired and the held messages started a turn on their own. A Stop now marks the messages it finds. When a withdrawal leaves only marked messages, the queue is held again and waits for the next prompt. * docs(server): state that cancel_agent with no turn to stop holds nothing Stop holds the queue only when it stops a running or starting turn. On an idle recipient cancel_agent reports that it canceled no run, and a queued steer keeps its quiet window. The lifecycle doc says so and a daemon-level test pins it. * docs(server): state when a queued message counts as delivered A message leaves the queue when the agent manager acknowledges the start of the turn that carries it. A turn that fails after that point is not delivered again, and a start that is not acknowledged within 60 seconds returns the messages a person's prompt carried.
Voice Assistant
A voice-controlled terminal assistant that runs as a single local service.
Quick Start
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env
# Edit .env and add your API keys (OpenAI, Deepgram)
# Run development servers
npm run dev
# Open browser to http://localhost:5173
Architecture
- Express Server (port 3000) - Serves API and built UI in production
- Vite Dev Server (port 5173) - Hot-reload React UI in development
- WebSocket (
/ws) - Real-time bidirectional communication - Agent - STT → LLM → TTS pipeline with terminal control
- Daemon - tmux-based terminal management (in-process)
Development
# Run both servers (recommended)
npm run dev
# Or run separately:
npm run dev:server # Express on port 3000
npm run dev:ui # Vite on port 5173
# Type checking
npm run typecheck
# Build for production
npm run build
# Start production server
npm start
Project Status
✅ Completed (Phases 1-2):
- Package setup and configuration
- Express server with WebSocket
- React UI with Vite
- WebSocket client with ping/pong testing
⏳ In Progress (Phase 3):
- Terminal control (tmux integration)
📋 Planned (Phases 4-9):
- LLM integration (OpenAI GPT-4)
- Agent orchestrator
- Speech-to-Text (Deepgram)
- Text-to-Speech (OpenAI)
- Audio streaming
- UI polish
See IMPLEMENTATION_PLAN.md for complete details.
Environment Variables
OPENAI_API_KEY=your-openai-key-here # GPT-4 and TTS
DEEPGRAM_API_KEY=your-deepgram-key-here # Streaming STT
STT_MODEL=whisper-1 # Optional: override to gpt-4o-transcribe, etc.
STT_CONFIDENCE_THRESHOLD=-3.0 # Optional: reject low-confidence clips
STT_DEBUG_AUDIO_DIR=.stt-debug # Optional: persist raw dictation audio for debugging
PASEO_HOME=~/.paseo # Runtime state directory (agents/, etc.)
PASEO_LISTEN=127.0.0.1:6767 # Listen address (host:port or /path/to/socket)
PASEO_HOME defaults to ~/.paseo and isolates runtime artifacts like agents/. PASEO_LISTEN controls the daemon listen address. For blue/green testing you can run a parallel server without touching production state:
PASEO_HOME=~/.paseo-blue PASEO_LISTEN=127.0.0.1:7777 npm run dev
Tech Stack
- Server: Express, TypeScript, ws (WebSocket)
- Client: React 18, Vite, TypeScript
- Terminal: tmux (via child_process)
- AI: OpenAI (LLM + TTS), Deepgram (STT)
Testing
Currently manual testing via:
- Start servers:
npm run dev - Open http://localhost:5173
- Test WebSocket connection (green status indicator)
- Click "Send Ping" button to test communication
More testing guidance as features are implemented.
License
MIT