Skip to content

test: add coverage for follow-up messages and stream fallback - #56

Merged
xfgong merged 1 commit into
mainfrom
test/loop-coverage
May 10, 2026
Merged

test: add coverage for follow-up messages and stream fallback#56
xfgong merged 1 commit into
mainfrom
test/loop-coverage

Conversation

@xfgong

@xfgong xfgong commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add test for get_follow_up_messages callback (lines 238-244): verifies follow-up messages are injected after the inner loop completes and trigger an additional assistant turn
  • Add test for async convert_to_llm (line 266): verifies coroutine-returning converters are properly awaited
  • Add tests for stream fallback path (lines 328-335): two custom minimal providers test the fallback when a stream ends without pushing a done or error event, covering both the added_partial=True and added_partial=False branches

Closes #48

Test plan

  • pytest tests/ -q --ignore=tests/checkpointer -- 293 passed (4 new)
  • ruff check cubepi/ tests/ -- all checks passed
  • ruff format --check cubepi/ tests/ -- all formatted

…stream fallback

Cover previously uncovered lines in agent/loop.py:
- Lines 238-244: follow-up messages callback triggers additional turns
- Line 266: async convert_to_llm coroutine is properly awaited
- Lines 328-335: fallback path when stream ends without done/error event
@xfgong
xfgong merged commit 07463c2 into main May 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test coverage: agent loop follow-up messages and stream fallback

1 participant