Skip to content

ECHO-540 ECHO-539 add await for get transcript and summarize function calls#347

Merged
ussaama merged 2 commits intomainfrom
await-get-transcript-function
Oct 22, 2025
Merged

ECHO-540 ECHO-539 add await for get transcript and summarize function calls#347
ussaama merged 2 commits intomainfrom
await-get-transcript-function

Conversation

@ussaama
Copy link
Copy Markdown
Contributor

@ussaama ussaama commented Oct 22, 2025

Summary by CodeRabbit

  • Refactor
    • Transcript retrieval was converted to asynchronous processing, improving efficiency and enabling better handling of concurrent conversations.
  • Tests
    • Test suite updated to async tests to reflect the new asynchronous behavior.

@linear
Copy link
Copy Markdown

linear bot commented Oct 22, 2025

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

Converted synchronous get_conversation_transcript() calls to awaited async calls in chat and report utilities and updated tests to run asynchronously with awaited transcript/summarize calls. LGTM.

Changes

Cohort / File(s) Summary
Async transcript retrieval in core modules
echo/server/dembrane/chat_utils.py, echo/server/dembrane/report_utils.py
Replaced synchronous get_conversation_transcript(...) calls with await get_conversation_transcript(...) in chat utility functions (create_system_messages_for_chat, _process_single_batch) and in report utilities; control flow otherwise unchanged.
Test suite async conversion
echo/server/tests/api/test_conversation.py
Converted two tests to async (@pytest.mark.asyncio, async def) and updated calls to await get_conversation_transcript(...) and await summarize_conversation(...); added pytest import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

bug

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "ECHO-539 add await for get transcript and summarize function calls" is specific, concise, and directly reflects the primary change in the changeset. It clearly indicates that the PR adds await statements to async function calls for transcript retrieval and summarization, which aligns with the actual modifications across chat_utils.py, report_utils.py, and test_conversation.py. The title includes the issue reference (ECHO-539) and accurately summarizes what a teammate scanning the history would understand as the main change.
Linked Issues Check ✅ Passed The PR directly addresses the root cause of issue ECHO-539 by converting synchronous handling of the asynchronous get_conversation_transcript() function to proper async/await patterns across three files [ECHO-539]. The changes add await statements in chat_utils.py (two locations), report_utils.py (one location), and update corresponding tests to be async-compatible. This fixes the issue where chat was failing to retrieve transcripts because the coroutine object was being returned instead of the actual transcript data, thus restoring transcript retrieval functionality for summarize prompts and user queries requesting conversation summaries [ECHO-539].
Out of Scope Changes Check ✅ Passed All modifications in this PR are narrowly scoped to fixing the transcript retrieval issue by properly awaiting async calls. The changes include adding await statements to get_conversation_transcript() invocations in chat_utils.py and report_utils.py, and converting associated tests to async with corresponding await calls. No unrelated refactoring, feature additions, logic changes, error handling modifications, or data structure alterations are present. Each change is directly necessary to resolve the async/await handling issue described in ECHO-539.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch await-get-transcript-function

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bdff567 and 8848361.

📒 Files selected for processing (1)
  • echo/server/tests/api/test_conversation.py (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
echo/server/tests/api/test_conversation.py (2)
echo/server/tests/common.py (2)
  • create_conversation (26-35)
  • create_conversation_chunk (43-57)
echo/server/dembrane/api/conversation.py (2)
  • get_conversation_transcript (411-443)
  • summarize_conversation (512-565)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci-check-server
🔇 Additional comments (3)
echo/server/tests/api/test_conversation.py (3)

3-3: Ship it! Pytest import looking crisp.

Clean addition for the asyncio marker. Zero bloat, maximum impact.


20-32: Beautiful async refactor! 100x approved.

The decorator, async def, and await dance is perfectly choreographed. This is exactly what the doctor ordered to fix the transcript retrieval bug. The test now properly exercises the async API flow.


41-57: Async game strong! This is the way.

Both summarize_conversation calls are properly awaited. The test now correctly validates the async flow for both empty and populated transcripts. Your future self will thank you.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ussaama ussaama changed the title ECHO-541 add await for get transcript and summarize function calls ECHO-539 add await for get transcript and summarize function calls Oct 22, 2025
@linear
Copy link
Copy Markdown

linear bot commented Oct 22, 2025

@ussaama ussaama requested a review from spashii October 22, 2025 10:54
@coderabbitai coderabbitai bot added the bug Something isn't working label Oct 22, 2025
@ussaama ussaama added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit 1231cbf Oct 22, 2025
11 checks passed
@ussaama ussaama deleted the await-get-transcript-function branch October 22, 2025 11:03
@ussaama ussaama changed the title ECHO-539 add await for get transcript and summarize function calls ECHO-540 ECHO-539 add await for get transcript and summarize function calls Oct 22, 2025
@linear
Copy link
Copy Markdown

linear bot commented Oct 22, 2025

spashii pushed a commit that referenced this pull request Nov 18, 2025
)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Transcript retrieval was converted to asynchronous processing,
improving efficiency and enabling better handling of concurrent
conversations.
* **Tests**
* Test suite updated to async tests to reflect the new asynchronous
behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants