Skip to content

Conversation

@Jeong-Ryeol
Copy link
Contributor

@Jeong-Ryeol Jeong-Ryeol commented Dec 5, 2025

Following up on @0xallam's comment on #157:

"I think we need to add even more unit tests now, especially to the most critical parts of the agent."

This PR adds tests for llm/utils.py - the core LLM response parsing logic.

Addresses #158

What's included

Test Class Coverage Tests
TestParseToolInvocations XML tool invocation parsing 8
TestFixStopword Incomplete function tag handling 4
TestFormatToolCall Tool call XML formatting 4
TestCleanContent Content cleaning and XML removal 6
TestTruncateToFirstFunction First function truncation 4

Total: 26 tests, all passing.

Test plan

  • All 26 tests pass locally
  • Follows existing test patterns from test_argument_parser.py
  • Covers edge cases (empty content, HTML entities, multiline values, etc.)

Next steps (if this direction looks good)

I'm planning to continue adding tests for other critical modules:

Module Why it's critical
agents/state.py Agent execution state management
llm/memory_compressor.py Context window optimization
tools/executor.py Tool execution logic

Happy to adjust priorities based on your feedback!

Following up on @0xallam's comment on usestrix#157:
> "I think we need to add even more unit tests now, especially to the most critical parts of the agent."

This PR adds tests for `llm/utils.py` - the core LLM response parsing logic.

Addresses usestrix#158

What's included:
- TestParseToolInvocations: XML tool invocation parsing (8 tests)
- TestFixStopword: Incomplete function tag handling (4 tests)
- TestFormatToolCall: Tool call XML formatting (4 tests)
- TestCleanContent: Content cleaning and XML removal (6 tests)
- TestTruncateToFirstFunction: First function truncation (4 tests)

Total: 26 tests, all passing.
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.

1 participant