Skip to content

Commit 192f904

Browse files
Fix: missed EOF markup (#120)
* Fix: missed EOF markup * Fix: resource release * Fix: cleanup
1 parent f3bb4a4 commit 192f904

3 files changed

Lines changed: 113 additions & 481 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ dependencies = [
88
"aiofiles>=25.1.0",
99
"aiohttp>=3.13.3",
1010
"aiologic>=0.16.0",
11-
"amrita-sense>=0.4.3",
12-
"fastmcp>=3.2.0", # Updated, see https://github.com/advisories/GHSA-rww4-4w9c-7733 for details.
11+
"amrita-sense>=0.4.5.1",
12+
"fastmcp-slim[client]>=3.4.4",
1313
"filetype>=1.2.0",
1414
"importlib>=1.0.4",
1515
"jinja2>=3.1.6",

src/amrita_core/chatmanager/chat_object.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,13 @@ async def _entry(self) -> None:
577577
finally:
578578
self._is_running = False
579579
self._is_done = True
580+
try:
581+
await self.io_stream.set_queue_done() # Write a EOF to the queue
582+
except TimeoutError:
583+
logger.warning(
584+
"Timeout while writing EOF to the queue, force overwrite."
585+
)
586+
self.io_stream._queue_done = True
580587
self.end_at = datetime.now(utc)
581588
self._chatman.running_chat_object_id2map.pop(self.stream_id, None) # type: ignore[arg-type]
582589
if self._chatman.clean_obj(

0 commit comments

Comments
 (0)