Feat: more unit tests for tool output cap, guardrail and terminal exec tool - #362
Conversation
…//github.com/Arvo-AI/aurora into harryyang2005/dev-1095-unit-tests-design-doc
…ng2005/dev-1095-unit-tests-design-doc
…ng2005/dev-1095-unit-tests-design-doc
…ng2005/dev-1095-unit-tests-design-doc
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR adds comprehensive test coverage for chat tool output capping, security input rail verification, and terminal execution tool routing, along with CI configuration to install ChangesTest Coverage & CI Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/tests/security/test_input_rail.py`:
- Around line 36-37: The helper _run creates a new asyncio event loop but never
closes it, causing ResourceWarning leaks; modify the _run(coro) implementation
to create the loop (e.g., loop = asyncio.new_event_loop()), run the coroutine
with loop.run_until_complete(coro) inside a try block, and always call
loop.close() in a finally block (or replace with asyncio.run(coro) if
compatible) so the event loop is properly closed after execution.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: fe6d7892-35ca-4daa-aff9-ffc938127f5c
📒 Files selected for processing (6)
.github/workflows/linters.ymlserver/tests/chat/__init__.pyserver/tests/chat/test_tool_output_cap.pyserver/tests/security/__init__.pyserver/tests/security/test_input_rail.pyserver/tests/security/test_terminal_exec_tool.py
a023611 to
e3e312f
Compare
…ng2005/dev-1095-unit-tests-design-doc
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/tests/security/test_terminal_exec_tool.py`:
- Line 40: The exec call using compile — specifically the expression
exec(compile(module, str(_SOURCE_FILE), "exec"), namespace) — needs an inline
linter suppression so Ruff/flake8-bandit doesn't flag S102; update that
statement to append an inline noqa for S102 (e.g., add " # noqa: S102") to
explicitly suppress the rule for this test-only exec usage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 48290bbe-0f68-4ff1-8d2d-71563bfb9143
📒 Files selected for processing (3)
server/tests/chat/test_tool_output_cap.pyserver/tests/security/test_input_rail.pyserver/tests/security/test_terminal_exec_tool.py
|



Created more unit tests, added them to CI worklow
Summary by CodeRabbit
Tests
Chores