Skip to content

🧪 Add tests for AI Gateway Service Context Compilation - #67

Open
MarsLuay wants to merge 4 commits into
mainfrom
testing-ai-gateway-context-17735905048087851539
Open

🧪 Add tests for AI Gateway Service Context Compilation#67
MarsLuay wants to merge 4 commits into
mainfrom
testing-ai-gateway-context-17735905048087851539

Conversation

@MarsLuay

Copy link
Copy Markdown
Owner

🎯 What:
Addressed missing tests for AI Gateway Service Context compilation inside ai-gateway.service.ts specifically buildSystemPrompt.
Also defined the typing boundaries (AIContext) missing in the issue description natively inside the service along with wiring it inside the gateway.

📊 Coverage:
Created comprehensive tests executing the logic (indirect extraction to bypass module transpilation conflicts natively impacting Node test runner):

  • Context with no profile or preferences
  • Context with profile major but no preferences
  • Context with preferences location but no profile
  • Full combinations context with both profile and preferences
  • Empty string attributes to prevent hanging spacing

Result:
The contextual builder within ai-gateway is now fully tested executing natively against the implemented string templates without failures. Full suite verified no regressions across other app sections.


PR created automatically by Jules for task 17735905048087851539 started by @MarsLuay

- Implemented `buildSystemPrompt` method in `AiGatewayService` alongside a supporting `AIContext` type definition.
- Modified `chatAssistant` inside `ai-gateway.service.ts` to properly identify context structures and utilize `buildSystemPrompt` to compile correct user prompts context details.
- Addressed testing gap by introducing `ai-gateway.service.test.cjs` which directly compiles and executes tests for `buildSystemPrompt` logic across all context permutation scenarios (no profile, single profile element, full combinations, and empty strings), bypassing complex ESM TypeScript stripping restrictions within experimental runtime.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings August 27, 2026 01:53
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gator-guide Ready Ready Preview Aug 27, 2026 2:27am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

- Implemented `buildSystemPrompt` method in `AiGatewayService` alongside a supporting `AIContext` type definition.
- Modified `chatAssistant` inside `ai-gateway.service.ts` to properly identify context structures and utilize `buildSystemPrompt` to compile correct user prompts context details.
- Addressed testing gap by introducing `ai-gateway.service.test.cjs` which directly compiles and executes tests for `buildSystemPrompt` logic across all context permutation scenarios (no profile, single profile element, full combinations, and empty strings), bypassing complex ESM TypeScript stripping restrictions within experimental runtime.
- Implemented `buildSystemPrompt` method in `AiGatewayService` alongside a supporting `AIContext` type definition.
- Modified `chatAssistant` inside `ai-gateway.service.ts` to properly identify context structures and utilize `buildSystemPrompt` to compile correct user prompts context details.
- Addressed testing gap by introducing `ai-gateway.service.test.cjs` which directly compiles and executes tests for `buildSystemPrompt` logic across all context permutation scenarios (no profile, single profile element, full combinations, and empty strings), bypassing complex ESM TypeScript stripping restrictions within experimental runtime.
- Implemented `buildSystemPrompt` method in `AiGatewayService` alongside a supporting `AIContext` type definition.
- Modified `chatAssistant` inside `ai-gateway.service.ts` to properly identify context structures and utilize `buildSystemPrompt` to compile correct user prompts context details.
- Addressed testing gap by introducing `ai-gateway.service.test.cjs` which directly compiles and executes tests for `buildSystemPrompt` logic across all context permutation scenarios (no profile, single profile element, full combinations, and empty strings), bypassing complex ESM TypeScript stripping restrictions within experimental runtime.
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.

2 participants