test(agent-service): cover prompt composition - #7190
Conversation
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7190 +/- ##
============================================
+ Coverage 80.58% 80.65% +0.07%
Complexity 3890 3890
============================================
Files 1162 1162
Lines 46264 46259 -5
Branches 5153 5153
============================================
+ Hits 37280 37309 +29
+ Misses 7319 7285 -34
Partials 1665 1665
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds Bun unit tests in the agent-service to validate how the system prompt is composed from workflow operator metadata, including allowlist filtering, compact schema rendering, UDF guidance sections, and the “no operators available” fallback. This fits into the agent-service prompt layer by locking in expected prompt composition behavior independent of backend availability.
Changes:
- Add isolated
buildSystemPromptcoverage for allowlist vs. default-all operator selection. - Verify language-specific UDF guidance inclusion/exclusion behavior.
- Cover the missing-operator allowlist fallback (“No operators available.”).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
What changes were proposed in this PR?
Adds isolated unit coverage for agent system-prompt composition from workflow metadata. The tests exercise allowlist filtering, language-specific UDF guidance, the default all-operator path, and the missing-operator fallback.
Any related issues, documentation, discussions?
Closes #7187
How was this PR tested?
bun test src/agent/prompts.spec.ts— 4 passed.bun run typecheckbunx prettier --check "src/**/*.{ts,js,json}"Mutation proof (each production change was reverted):
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-5)