feat(voice): specialize prompt for Isfahan Industrial Parks, emit source excerpts, and bound generation

- Specialize voice assistant identity and agent system prompt for «شرکت شهرک‌های صنعتی اصفهان» (English instructions with Persian proper names)
- Emit bounded chunk text excerpts (up to 2000 chars) and identify primary_source in realtime sources events
- Bound OpenAI output generation via OPENAI_REALTIME_MAX_OUTPUT_TOKENS and add answer_limited event
- Handle old-turn search cancellation safely on turn supersession
- Add end-to-end search tracing pipeline and diagnostic CLI
- Add database organization title and settings update script
This commit is contained in:
amirhosein mazaheri
2026-10-12 17:35:28 +03:30
parent f14166a89f
commit 117fda7cc9
29 changed files with 1476 additions and 67 deletions
+5 -4
View File
@@ -94,11 +94,11 @@ def test_two_calls_cannot_share_function_item(runner, persisted):
await response(runtime, transport)
first = call()
await runtime.handle(first)
await until(lambda: runtime.calls["c1"][1]["result"] is not None)
assert runtime.calls["c1"][1]["result"] is None
await runtime.handle(dict(first, call_id="c2"))
assert runtime.failure == "LIVE_PROVIDER_PROTOCOL_ERROR"
assert set(runtime.calls) == {"c1"}
assert len(searches) == 1
assert searches == []
assert not commands(transport, "conversation.item.create")
finally:
await runtime.close()
@@ -159,9 +159,10 @@ def test_four_full_persian_results_fit_actual_wire_budget(settings, monkeypatch,
transport.send = blocked
for n in range(4):
await runtime.handle(call(call_id="c" + str(n)))
await until(lambda: len(runtime.calls) == 4 and
all(c["result"] is not None for _, c in runtime.calls.values()))
assert len(runtime.calls) == 4
assert all(c["result"] is None for _, c in runtime.calls.values())
await done(runtime)
await until(lambda: all(c["result"] is not None for _, c in runtime.calls.values()))
await until(lambda: entered.is_set() or not runtime.usable)
assert runtime.usable
reserved = {cmd.event["event_id"]: cmd.size for cmd in runtime.pending_commands.values()}