feat: Let the AI hold the line (New Wait Tool with Music & Interrupts) - #572
feat: Let the AI hold the line (New Wait Tool with Music & Interrupts)#572arnofrxdd wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="api/schemas/tool.py">
<violation number="1" location="api/schemas/tool.py:28">
P0: Cannot create WaitToolDefinition through the API — ToolCategory enum in api/enums.py is missing a WAIT = "wait" member. The validate_category validator, DB CheckConstraint, and route-level validation all check category against ToolCategory values, so any request with category="wait" will be rejected before reaching the DB. Add `WAIT = "wait"` to the ToolCategory enum to match the new ToolCategoryValue literal and WaitToolDefinition.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| "end_call", | ||
| "transfer_call", | ||
| "calculator", | ||
| "wait", |
There was a problem hiding this comment.
P0: Cannot create WaitToolDefinition through the API — ToolCategory enum in api/enums.py is missing a WAIT = "wait" member. The validate_category validator, DB CheckConstraint, and route-level validation all check category against ToolCategory values, so any request with category="wait" will be rejected before reaching the DB. Add WAIT = "wait" to the ToolCategory enum to match the new ToolCategoryValue literal and WaitToolDefinition.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At api/schemas/tool.py, line 28:
<comment>Cannot create WaitToolDefinition through the API — ToolCategory enum in api/enums.py is missing a WAIT = "wait" member. The validate_category validator, DB CheckConstraint, and route-level validation all check category against ToolCategory values, so any request with category="wait" will be rejected before reaching the DB. Add `WAIT = "wait"` to the ToolCategory enum to match the new ToolCategoryValue literal and WaitToolDefinition.</comment>
<file context>
@@ -25,6 +25,7 @@
"end_call",
"transfer_call",
"calculator",
+ "wait",
"native",
"integration",
</file context>
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
feat: complete wait_for_user tool implementation
Description
This PR adds a built-in
wait_for_usertool that allows the AI agent to dynamically pause and wait on the line when the user asks for a moment (e.g., "Hold on", "Give me 20 seconds").Key Features:
_WaitInterruptObserver) that listens for user speech. If the user returns early and says "I'm back", the wait loop instantly cancels and the AI immediately responds.TTSStoppedFrameobserver to ensure the AI finishes speaking its acknowledgment message ("Sure, I'll wait...") before the wait loop and interrupt observer actually begin, preventing stale transcription frames from accidentally cancelling the wait early.Changes Made
wait_music_8000.wavandwait_music_16000.wavtoapi/assets.api/schemas/tool.pyto support the newwaittool category.play_audio_loopinaudio_playback.pyto chunk audio into 500ms segments for instant cancellation.wait_for_userlogic inpipecat_engine_custom_tools.py.page.tsxandconfig.tsx.Summary by cubic
Adds a built-in
wait_for_usertool so the agent can hold the line when asked, with instant speech interrupts and hold music. Enforces a hard 5-minute cap (defaults to 60s; min 15s), adds awaitcategory, TTS-safe sync, LLM schema exposure, and UI support.New Features
waittool category andwait_for_userfunction exposed to the LLM (default 60s, min 15s, max 300s).calculator) with simple name/description and create/edit support.Migration
waitto thetool_categoryenum; down revision updated. Run DB migrations.Written for commit ddb9eda. Summary will update on new commits.
Greptile Summary
This PR adds a built-in tool that lets the agent wait for a caller. The main changes are:
Confidence Score: 5/5
This looks safe to merge.
The wait category now passes backend validation. The wait function schema is exposed to the LLM. The transfer mapping and HTTP test editor paths are present in the updated code. No blocking issues were found in the changed code.
What T-Rex did
Important Files Changed
Reviews (4): Last reviewed commit: "fixes" | Re-trigger Greptile