Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand Down Expand Up @@ -67,10 +67,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20'
cache: npm
Expand All @@ -93,10 +93,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand All @@ -108,7 +108,7 @@ jobs:
python -m pip install -e '.[dev]'

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20'
cache: npm
Expand Down Expand Up @@ -140,10 +140,10 @@ jobs:
github.event_name == 'push'
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:

- name: Upload AI merchant failure evidence
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ai-merchant-evidence
path: tests/integration/evidence/
Expand Down
17 changes: 15 additions & 2 deletions tests/integration/b2_loopback_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

from vocalize.dialogue.state import ReadinessVerdict, TaskPhase, TaskState
from vocalize.dialogue.state import (
DialogueOrchestratorError,
ReadinessVerdict,
TaskPhase,
TaskState,
)
from vocalize.server.health import register_health_routes
from vocalize.server.sessions import register_session_routes
from vocalize.server.state import Session, SessionRegistry
Expand Down Expand Up @@ -191,7 +196,15 @@ async def _transition(
) -> None:
previous = state.phase
if previous != phase:
state.transition(phase, reason="loopback-e2e")
try:
state.transition(phase, reason="loopback-e2e")
except DialogueOrchestratorError:
# Loopback is a test driver: it may replay phase markers
# across WS reconnects or after the production state machine
# has already advanced past the target. Skipping the call
# keeps the client UI moving without weakening the production
# invariant.
pass
await channel.push_event({
"event": "phase_change",
"previous": previous.value,
Expand Down
8 changes: 6 additions & 2 deletions tests/test_dialogue_user_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ async def send_json(frame: dict[str, Any]) -> None:
out = await channel.dispatch_one_input()

assert out is None
assert takeover_q.get_nowait() == ("yes please", "en")
text, lang, passthrough_id = takeover_q.get_nowait()
assert (text, lang) == ("yes please", "en")
assert isinstance(passthrough_id, str) and passthrough_id
assert hint_q.empty()


Expand Down Expand Up @@ -541,7 +543,9 @@ async def send_json(frame: dict[str, Any]) -> None:

await channel.dispatch_one_input()

assert takeover_q.get_nowait() == ("yes please", "en")
text, lang, passthrough_id = takeover_q.get_nowait()
assert (text, lang) == ("yes please", "en")
assert isinstance(passthrough_id, str) and passthrough_id
assert any(
frame["type"] == "transcript_update"
and frame["role"] == "user_takeover_passthrough"
Expand Down
5 changes: 4 additions & 1 deletion tests/test_server_ws_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ def test_user_takeover_text_reaches_runner_takeover_queue() -> None:
"mode": "user_takeover",
}))
_wait_until(lambda: bool(runner.takeover_inputs))
assert runner.takeover_inputs == [("yes", "en")]
assert len(runner.takeover_inputs) == 1
text, lang, passthrough_id = runner.takeover_inputs[0]
assert (text, lang) == ("yes", "en")
assert isinstance(passthrough_id, str) and passthrough_id
assert runner.merchant_hints == []


Expand Down