Skip to content

Commit 5716def

Browse files
wip
1 parent 3b0fef9 commit 5716def

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "solana-agent"
3-
version = "31.2.2"
3+
version = "31.2.2-dev1"
44
description = "AI Agents for Solana"
55
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
66
license = "MIT"

solana_agent/adapters/openai_realtime_ws.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,10 +1043,16 @@ async def append_audio(self, pcm16_bytes: bytes) -> None: # pragma: no cover
10431043

10441044
async def commit_input(self) -> None: # pragma: no cover
10451045
try:
1046-
# Skip commits while a response is active to avoid server errors
1046+
# If a previous response is still marked active, wait briefly, then proceed.
1047+
# Skipping commits here can cause new turns to reference old audio and repeat answers.
10471048
if bool(getattr(self, "_response_active", False)):
1048-
logger.warning("Realtime WS: skipping commit; response active")
1049-
return
1049+
logger.warning(
1050+
"Realtime WS: response active at commit; waiting briefly before proceeding"
1051+
)
1052+
for _ in range(5): # up to ~0.5s
1053+
await asyncio.sleep(0.1)
1054+
if not bool(getattr(self, "_response_active", False)):
1055+
break
10501056
# Avoid overlapping commits while awaiting server ack
10511057
if bool(getattr(self, "_commit_inflight", False)):
10521058
logger.warning("Realtime WS: skipping commit; commit in-flight")

0 commit comments

Comments
 (0)