Skip to content

test(agent-service): cover prompt composition - #7190

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test/agent-prompts
Aug 1, 2026
Merged

test(agent-service): cover prompt composition#7190
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test/agent-prompts

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

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 typecheck
  • bunx prettier --check "src/**/*.{ts,js,json}"

Mutation proof (each production change was reverted):

Production mutation Focused test result
Inverted non-empty allowlist selection 3 failed
Omitted operator descriptions 1 failed
Changed the no-operators fallback message 1 failed

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5)

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.65%. Comparing base (348fa88) to head (4095152).
⚠️ Report is 6 commits behind head on main.

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              
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 66afe8d
agent-service 78.49% <ø> (+1.07%) ⬆️
amber 75.59% <ø> (ø) Carriedforward from 66afe8d
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 66afe8d
config-service 65.97% <ø> (ø) Carriedforward from 66afe8d
file-service 66.80% <ø> (ø) Carriedforward from 66afe8d
frontend 83.22% <ø> (ø) Carriedforward from 66afe8d
notebook-migration-service 78.89% <ø> (ø) Carriedforward from 66afe8d
pyamber 97.36% <ø> (ø) Carriedforward from 66afe8d
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from 66afe8d

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan
aglinxinyuan requested a review from mengw15 July 31, 2026 23:55
@aglinxinyuan
aglinxinyuan marked this pull request as ready for review July 31, 2026 23:56
@mengw15
mengw15 requested a review from Copilot August 1, 2026 00:22

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 buildSystemPrompt coverage 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.

Comment thread agent-service/src/agent/prompts.spec.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
@aglinxinyuan
aglinxinyuan enabled auto-merge August 1, 2026 05:33
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 1, 2026
Merged via the queue into apache:main with commit 050c226 Aug 1, 2026
21 checks passed
@aglinxinyuan
aglinxinyuan deleted the test/agent-prompts branch August 1, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for agent prompt composition

4 participants