Skip to content

feat(VM-523): Add --wait flag to service status for synchronous startup checking#220

Open
ai-cora wants to merge 3 commits intomasterfrom
feat/VM-523-add-wait-flag-to-service-status-for-synchronous
Open

feat(VM-523): Add --wait flag to service status for synchronous startup checking#220
ai-cora wants to merge 3 commits intomasterfrom
feat/VM-523-add-wait-flag-to-service-status-for-synchronous

Conversation

@ai-cora
Copy link
Copy Markdown
Collaborator

@ai-cora ai-cora commented Jan 25, 2026

Summary

Adds --wait and --timeout parameters to the VoiceMode service status MCP tool, allowing scripts and agents to block until a service is ready instead of implementing their own polling loops.

Key changes:

  • Added wait (bool, default: false) and timeout (int, default: 60s) params to service() MCP tool
  • New helper functions: get_service_port(), is_service_ready(), wait_for_service()
  • Progress indication with dots to stderr during wait
  • Status prefixes: ✅ success, ⏱️ timeout, ❌ error

Usage

# Wait for Kokoro to be ready (default 60s timeout)
service("kokoro", "status", wait=True)

# Custom timeout
service("whisper", "status", wait=True, timeout=120)

Test plan

  • Unit tests for get_service_port() - returns correct ports
  • Unit tests for is_service_ready() - handles all states
  • Unit tests for wait_for_service() - immediate/timeout/delayed
  • Unit tests for service() integration - params and defaults
  • Manual testing: Whisper/VoiceMode wait works
  • All 47 existing service tests pass

Documentation

  • Updated docs/reference/cli/service-commands.md
  • Updated .claude/skills/voicemode/SKILL.md

🤖 Generated with Claude Code

mbailey and others added 3 commits January 25, 2026 14:58
Add --wait and --timeout parameters to the service() MCP tool for
synchronous startup checking. When wait=True on status action, polls
until the service is ready or timeout is exceeded.

New functions:
- get_service_port(): centralized port lookup for services
- is_service_ready(): checks port accessibility + Kokoro startup status
- wait_for_service(): async polling loop with 1s interval, dot progress

Implementation follows design from SPEC.md:
- 1 second polling interval for fast local service detection
- Progress dots printed to stderr during wait
- Timeout returns message with ⏱️ prefix
- Kokoro readiness requires port listening AND model loading complete

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 13 unit tests for the wait flag feature in TestWaitFunctionality class:
- get_service_port() returns correct ports for all services
- is_service_ready() handles port not listening, port listening,
  kokoro loading, and kokoro ready states
- wait_for_service() handles immediate ready, timeout, and
  delayed ready scenarios
- service() integration tests for wait/timeout params including
  string conversion and default handling

All tests use mocking to isolate the wait functionality from
actual service state.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update service-commands.md with --wait and --timeout flag examples
- Add wait functionality to SKILL.md service management section
- Include example output showing wait progress and timeout behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants