Skip to content

Conversation

@frontegg-david
Copy link
Contributor

@frontegg-david frontegg-david commented Dec 28, 2025

Summary by CodeRabbit

  • New Features

    • CI now produces merged unit+E2E coverage reports and enforces a 95% check on main; CLI gains a --coverage flag.
  • Tests

    • Large expansion of unit and E2E test suites across adapters, plugins, SDK, OpenAPI tooling, and utilities.
  • Chores

    • Coverage tooling and presets, nyc configuration, and merge scripts added.
  • Bug Fixes

    • Certain error instances are now immutable.
  • Revert

    • MCP Apps module and its public exports removed from the SDK.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 28, 2025

📝 Walkthrough

Walkthrough

Adds centralized coverage tooling and CI reporting (nyc, Jest presets, merge script, GitHub Actions job), wires a CLI coverage flag, updates many Jest configs and Nx targets to emit per-package/e2e coverage, adds extensive unit/e2e tests, introduces a transport-recreation e2e app, and removes the entire MCP Apps module and its exports.

Changes

Cohort / File(s) Summary
CI workflow & merge script
\.github/workflows/push.yml, scripts/merge-coverage.mjs
New "Coverage Report" job; downloads test artifacts, runs scripts/merge-coverage.mjs to merge coverage outputs, generates reports, and uploads to Codecov.
NYC & global Jest presets
\.nycrc.json, jest.coverage.preset.js, jest.e2e.coverage.preset.js, jest.preset.js, \.gitignore
Add NYC config with 95% thresholds, new shared Jest coverage presets, merge coverage preset into jest.preset.js, and ignore .nyc_output.
E2E Jest configs
apps/e2e/.../jest.e2e.config.ts (multiple files, e.g., demo-e2e-*)
Each e2e config now requires jest.e2e.coverage.preset.js, sets coverageDirectory under coverage/e2e/<app>, and spreads the preset into the config.
Per-package Jest updates & Nx targets
libs/*/jest.config.ts, libs/*/project.json (examples: libs/adapters, libs/plugins, libs/sdk, libs/cli, libs/testing, libs/ui, libs/uipack, libs/json-schema-to-zod-v3, libs/mcp-from-openapi)
Relocated coverage directories to coverage/unit/<lib>, added collectCoverageFrom and coverageThreshold for several libs, and added test targets for some projects.
Coverage merge tooling & scripts
scripts/merge-coverage.mjs, package.json
New merge script collects coverage-final.json from unit/e2e runs into .nyc_output, runs nyc merge + nyc report; package.json adds coverage scripts and nyc devDependency.
CLI coverage flag & runtime
libs/cli/src/args.ts, libs/cli/src/cli.ts, libs/cli/src/commands/test.ts, libs/cli/jest.config.ts
Adds --coverage/-c flag (ParsedArgs.coverage), updates help text, and toggles Jest coverage options and diagnostics when enabled.
Extensive test additions
libs/adapters/src/openapi/__tests__/*, libs/mcp-from-openapi/src/__tests__/*, libs/plugins/src/**/__tests__/*, libs/json-schema-to-zod-v3/src/__tests__/*, many libs/*/src/**/__tests__/*
Large suites of new unit/e2e tests across adapters, mcp-from-openapi, plugins, schema conversion, cache providers, sanitizers, transports, and more.
Shared E2E coverage preset usage
jest.e2e.coverage.preset.js, apps/e2e/...
New E2E preset exports collectCoverageFrom (targeting selected libs) and coverageReporters: ['json']; consumed by e2e configs to produce JSON coverage artifacts.
MCP Apps removal
libs/sdk/src/mcp-apps/index.ts, libs/sdk/src/mcp-apps/types.ts, libs/sdk/src/mcp-apps/schemas.ts, libs/sdk/src/mcp-apps/csp.ts, libs/sdk/src/mcp-apps/template.ts, libs/sdk/src/mcp-apps/__tests__/mcp-apps.test.ts, libs/sdk/package.json, libs/sdk/project.json
Entire MCP Apps module deleted: types, schemas, CSP/template utilities, barrel index, tests removed; SDK package exports and additionalEntryPoints for mcp-apps removed.
Transport pending-init & handleRequest changes
libs/sdk/src/transport/adapters/streamable-http-transport.ts, related transport tests
Add pending initialization state support, hasPendingInitState getter, _applyInitState helper, and override handleRequest to apply pending state on first request.
New e2e app: transport-recreation
apps/e2e/demo-e2e-transport-recreation/**
New Nx e2e project with Jest config, tests, app/tools (session/counter), webpack config, and tsconfigs.
Minor code tweaks
libs/sdk/src/notification/notification.service.ts, libs/plugins/src/codecall/errors/tool-call.errors.ts
Consolidated imports in notification service; frozen error instances (Object.freeze(this)) in some error classes for immutability.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    rect rgb(240,248,255)
    participant CI as GitHub Actions
    participant Unit as Unit Tests (nx / Jest)
    participant E2E as E2E Tests (Jest)
    participant Art as Artifact Storage
    end
    rect rgb(245,255,240)
    participant Merge as scripts/merge-coverage.mjs
    participant NYC as nyc CLI
    participant Codecov as Codecov
    end

    CI->>Unit: run test:unit:coverage (produces coverage/unit/*/coverage-final.json)
    Unit-->>Art: upload unit coverage artifact
    CI->>E2E: run test:e2e:coverage (produces coverage/e2e/*/coverage-final.json)
    E2E-->>Art: upload e2e coverage artifact
    CI->>Art: download coverage artifacts
    CI->>Merge: run scripts/merge-coverage.mjs (collect into .nyc_output)
    Merge->>NYC: nyc merge -> coverage/merged/coverage-final.json
    Merge->>NYC: nyc report -> generate lcov/html/json in coverage/merged
    Merge-->>CI: merged reports ready
    CI->>Codecov: upload merged coverage JSON
    Codecov-->>CI: processing complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 I hopped through tests and gathered every thread,

Merged coverage crumbs from where the reports were spread.
NYC stitched the numbers, presets humbly tune,
Sessions and transports danced beneath the moon.
A rabbit cheers: coverage sprouts by noon.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main objective of the PR: adding coverage reporting and merging capabilities for unit and E2E tests.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa97dbe and 39cf738.

📒 Files selected for processing (5)
  • apps/e2e/demo-e2e-transport-recreation/project.json
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts
  • apps/e2e/demo-e2e-transport-recreation/src/main.ts
  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/e2e/demo-e2e-transport-recreation/src/main.ts
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts
  • apps/e2e/demo-e2e-transport-recreation/project.json
  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
🧰 Additional context used
📓 Path-based instructions (1)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead

Files:

  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Use Nx for build system with commands like `nx build sdk`, `nx test`, `nx run-many -t test`
🧬 Code graph analysis (1)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts (2)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts (1)
  • Tool (15-38)
libs/testing/src/client/mcp-test-client.ts (1)
  • sessionId (207-209)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Libraries
  • GitHub Check: Lint & Format Checks
🔇 Additional comments (1)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts (1)

1-47: LGTM! Well-structured tool implementation for e2e testing.

The implementation is clean and follows best practices:

  • Proper use of Zod 4 features (.default() correctly short-circuits for undefined input)
  • Type-safe implementation with constrained generics
  • Consistent session handling pattern matching GetSessionInfoTool
  • Safe default values for both input (amount: 1) and state (previousValue: 0)
  • Complies with coding guidelines (no any, no non-null assertions, uses ?? for defaults, no input mutation)

The module-level sessionCounters Map appropriately simulates persistent session state for e2e transport recreation tests, which is the intended use case per the PR objectives.


Comment @coderabbitai help to get the list of available commands and usage tips.

@frontegg-david
Copy link
Contributor Author

frontegg-david commented Dec 28, 2025

⚠️ Snyk checks are incomplete.

Status Scanner Critical High Medium Low Total (0)
⚠️ Open Source Security 0 0 0 0 See details

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

♻️ Duplicate comments (4)
apps/e2e/demo-e2e-transparent/jest.e2e.config.ts (1)

36-45: Duplicate coverage configuration pattern.

This file has the same coverage configuration and DRY concerns already flagged in apps/e2e/demo-e2e-ui/jest.e2e.config.ts. Refer to that review comment for the recommended shared preset approach.

apps/e2e/demo-e2e-errors/jest.e2e.config.ts (1)

36-45: Duplicate coverage configuration pattern.

This file has the same coverage configuration and DRY concerns already flagged in apps/e2e/demo-e2e-ui/jest.e2e.config.ts. Refer to that review comment for the recommended shared preset approach.

apps/e2e/demo-e2e-notifications/jest.e2e.config.ts (1)

36-45: Duplicate coverage configuration pattern.

This file has the same coverage configuration and DRY concerns already flagged in apps/e2e/demo-e2e-ui/jest.e2e.config.ts. Refer to that review comment for the recommended shared preset approach.

apps/e2e/demo-e2e-public/jest.e2e.config.ts (1)

36-45: Duplicate coverage configuration pattern.

This file has the same coverage configuration and DRY concerns already flagged in apps/e2e/demo-e2e-ui/jest.e2e.config.ts. Refer to that review comment for the recommended shared preset approach.

🧹 Nitpick comments (11)
libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts (1)

107-324: Replace any type with proper typing.

Throughout the log method tests, event data is cast to any (lines 121, 149, 167, 191, 215, 227, 240, 249, 261, 274, 287, 299, 312, 321, 341, 350). This violates the strict TypeScript guideline requiring no any types without strong justification.

As per coding guidelines: Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults.

🔎 Proposed refactor to use proper typing

Since AuditEvent.data is typed as Record<string, unknown>, replace all instances of:

-const data = receivedEvents[0].data as any;
+const data = receivedEvents[0].data as Record<string, unknown>;

Alternatively, define specific event data interfaces for each event type to achieve full type safety:

interface ExecutionStartData {
  scriptHash: string;
  scriptLength: number;
}

interface ExecutionSuccessData {
  scriptHash: string;
  scriptLength: number;
  toolCallCount: number;
}

// ... etc for other event types

Then use:

const data = receivedEvents[0].data as ExecutionStartData;
expect(data.scriptHash).toMatch(/^sh_[0-9a-f]{8}$/);
expect(data.scriptLength).toBe(12);

This provides compile-time type checking and better IDE support.

apps/e2e/demo-e2e-ui/jest.e2e.config.ts (1)

36-45: Consider including index.ts files in coverage and extracting shared patterns.

Two observations:

  1. Index file exclusion: Line 44 excludes **/index.ts from coverage. While index files typically contain re-exports, they can include important logic like conditional exports, runtime checks, or initialization code. Consider whether this exclusion is intentional.

  2. Pattern duplication: The collectCoverageFrom configuration is identical across all E2E test configs (demo-e2e-ui, demo-e2e-transparent, demo-e2e-errors, demo-e2e-notifications, demo-e2e-public, etc.). This violates DRY principles and makes maintenance harder.

💡 Recommended approach: Extract to shared E2E preset

Create a shared E2E coverage configuration file (e.g., jest.e2e.coverage.preset.js):

module.exports = {
  coverageReporters: ['json'],
  collectCoverageFrom: [
    '<rootDir>/../../../libs/sdk/src/**/*.ts',
    '<rootDir>/../../../libs/adapters/src/**/*.ts',
    '<rootDir>/../../../libs/plugins/src/**/*.ts',
    '!**/*.test.ts',
    '!**/*.spec.ts',
    // Reconsider this exclusion:
    // '!**/index.ts',
  ],
};

Then reference it in each E2E config:

import e2eCoveragePreset from '../../../jest.e2e.coverage.preset';

const config: Config.InitialOptions = {
  // ... other config
  coverageDirectory: '../../../coverage/e2e/demo-e2e-ui',
  ...e2eCoveragePreset,
};
scripts/merge-coverage.mjs (1)

101-124: Consider preserving stderr in error messages.

The merge operation uses stdio: 'pipe' which suppresses output. If the merge fails, the error message at line 122 might not include helpful stderr details from nyc. Consider capturing stderr or using stdio: 'inherit' for better debugging when issues occur.

🔎 Optional improvement
 try {
   // Merge coverage using nyc
-  execSync(`npx nyc merge "${NYC_OUTPUT}" "${join(MERGED_DIR, 'coverage-final.json')}"`, {
+  execSync(`npx nyc merge "${NYC_OUTPUT}" "${join(MERGED_DIR, 'coverage-final.json')}"`, {
     cwd: ROOT,
-    stdio: 'pipe',
+    stdio: ['pipe', 'pipe', 'inherit'], // inherit stderr for error visibility
   });

   // Generate reports from merged coverage
   execSync(
     `npx nyc report --temp-dir="${MERGED_DIR}" --report-dir="${MERGED_DIR}" --reporter=lcov --reporter=html --reporter=text-summary`,
     {
       cwd: ROOT,
       stdio: 'inherit',
     }
   );

   console.log('\nCoverage reports generated successfully:');
   console.log(`  HTML:  ${MERGED_DIR}/index.html`);
   console.log(`  LCOV:  ${MERGED_DIR}/lcov.info`);
   console.log(`  JSON:  ${MERGED_DIR}/coverage-final.json`);
 } catch (error) {
-  console.error('\nError merging coverage:', error.message);
+  console.error('\nError merging coverage:', error.message);
+  if (error.stderr) console.error('stderr:', error.stderr.toString());
   process.exit(1);
 }
package.json (1)

13-20: Coverage scripts look good, but threshold alignment needed.

The test and coverage scripts are well-structured. However, the coverage:check script (line 20) relies on .nycrc.json thresholds, which are currently set to 80%. This is inconsistent with the 95%+ requirement from learnings and the 95% threshold enforced in the CI workflow.

Consider explicitly specifying thresholds in the coverage:check script to ensure consistency:

-    "coverage:check": "npx nyc check-coverage --temp-dir=coverage/merged"
+    "coverage:check": "npx nyc check-coverage --temp-dir=coverage/merged --statements 95 --branches 95 --functions 95 --lines 95"

Based on learnings, 95%+ test coverage is required.

jest.coverage.preset.js (1)

15-15: Consider adding .types.ts exclusion for consistency.

The collectCoverageFrom pattern excludes .d.ts files but not .types.ts files. The adapters package's jest.config.ts explicitly excludes !src/**/*.types.ts. For consistency across the codebase, consider adding this exclusion to the shared preset.

🔎 Suggested fix
-  collectCoverageFrom: ['src/**/*.ts', '!src/**/*.test.ts', '!src/**/*.spec.ts', '!src/**/index.ts', '!src/**/*.d.ts'],
+  collectCoverageFrom: ['src/**/*.ts', '!src/**/*.test.ts', '!src/**/*.spec.ts', '!src/**/index.ts', '!src/**/*.d.ts', '!src/**/*.types.ts'],
libs/mcp-from-openapi/src/__tests__/generator.spec.ts (2)

308-316: Use expect().rejects pattern instead of deprecated fail().

The fail() function is deprecated in Jest. Consider using the more idiomatic pattern.

🔎 Suggested refactor
-    it('should throw LoadError with context on file not found', async () => {
-      try {
-        await OpenAPIToolGenerator.fromFile('/nonexistent/path/api.yaml');
-        fail('Should have thrown');
-      } catch (e) {
-        expect(e).toBeInstanceOf(LoadError);
-        expect((e as LoadError).message).toContain('Failed to load OpenAPI spec from file');
-      }
-    });
+    it('should throw LoadError with context on file not found', async () => {
+      await expect(OpenAPIToolGenerator.fromFile('/nonexistent/path/api.yaml'))
+        .rejects
+        .toThrow(LoadError);
+      
+      await expect(OpenAPIToolGenerator.fromFile('/nonexistent/path/api.yaml'))
+        .rejects
+        .toThrow('Failed to load OpenAPI spec from file');
+    });

169-183: Add instanceof check to validate error class.

Per coding guidelines, error handling tests should include instanceof checks to validate the specific error class being thrown.

🔎 Suggested addition
     it('should throw LoadError on HTTP error', async () => {
       mockFetch.mockResolvedValue({
         ok: false,
         status: 404,
         statusText: 'Not Found',
       });

-      await expect(OpenAPIToolGenerator.fromURL('https://example.com/api.json')).rejects.toThrow(LoadError);
+      const error = await OpenAPIToolGenerator.fromURL('https://example.com/api.json').catch(e => e);
+      expect(error).toBeInstanceOf(LoadError);
+      expect(error.message).toContain('404');
     });

Based on coding guidelines, tests should include error class instanceof checks.

libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts (2)

77-83: Consider verifying the error message content.

The test validates that an error is thrown but could be more specific about the error message.

🔎 Suggested enhancement
     it('should throw for invalid type', () => {
       expect(() => {
         new CacheRedisProvider({
           type: 'invalid' as any,
         } as RedisCacheOptions);
-      }).toThrow('Invalid cache provider type');
+      }).toThrow(/Invalid cache provider type/);
+      
+      // Optionally verify the full error message includes the invalid type
+      expect(() => {
+        new CacheRedisProvider({ type: 'invalid' as any } as RedisCacheOptions);
+      }).toThrow(expect.stringContaining('invalid'));
     });

1-229: Consider adding Redis command failure tests.

The test suite covers happy paths well, but could benefit from testing failure scenarios like Redis command rejections to ensure proper error propagation.

// Example additional test for error handling
it('should propagate errors from Redis set command', async () => {
  mockClient.set.mockRejectedValue(new Error('Redis connection lost'));
  
  await expect(provider.setValue('key', 'value')).rejects.toThrow('Redis connection lost');
});
libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts (2)

67-107: Consider modernizing error property testing pattern.

The tests correctly validate SelfReferenceError is thrown for blocked tools and include proper instanceof checks per coding guidelines.

Lines 85-93 use a try-catch with fail() to test error properties. While functional, the fail() call is redundant since the subsequent expect statements would fail if the error isn't thrown. Consider a more modern pattern:

🔎 Suggested refactor for cleaner error property testing
-    it('should include tool name in error', () => {
-      try {
-        assertNotSelfReference('codecall:execute');
-        fail('Expected SelfReferenceError to be thrown');
-      } catch (error) {
-        expect(error).toBeInstanceOf(SelfReferenceError);
-        expect((error as SelfReferenceError).toolName).toBe('codecall:execute');
-      }
-    });
+    it('should include tool name in error', () => {
+      let error: SelfReferenceError | undefined;
+      try {
+        assertNotSelfReference('codecall:execute');
+      } catch (e) {
+        error = e as SelfReferenceError;
+      }
+      expect(error).toBeInstanceOf(SelfReferenceError);
+      expect(error?.toolName).toBe('codecall:execute');
+    });

128-131: Misleading test name: "readonly" is not actually tested.

The test name "should return readonly explicit array" suggests immutability testing, but line 130 only verifies Array.isArray(). TypeScript's readonly keyword is a compile-time type constraint and doesn't provide runtime immutability.

To accurately test the current behavior, either rename the test or add actual immutability verification.

🔎 Option 1: Rename test to match what it actually checks
-  it('should return readonly explicit array', () => {
+  it('should return explicit tools as an array', () => {
     const patterns = getBlockedPatterns();
     expect(Array.isArray(patterns.explicit)).toBe(true);
   });
🔎 Option 2: Test actual immutability if that's the intent
-  it('should return readonly explicit array', () => {
+  it('should return immutable explicit array', () => {
     const patterns = getBlockedPatterns();
-    expect(Array.isArray(patterns.explicit)).toBe(true);
+    expect(Array.isArray(patterns.explicit)).toBe(true);
+    expect(() => {
+      (patterns.explicit as string[]).push('new-tool');
+    }).toThrow();
   });

Note: This would require the implementation to return a truly immutable array (e.g., via Object.freeze).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4bdc9d7 and 76ac8bb.

⛔ Files ignored due to path filters (3)
  • libs/uipack/src/build/__tests__/build-universal.test.ts is excluded by !**/build/**
  • libs/uipack/src/build/index.ts is excluded by !**/build/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (61)
  • .github/workflows/push.yml
  • .gitignore
  • .nycrc.json
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • jest.coverage.preset.js
  • jest.preset.js
  • libs/adapters/jest.config.ts
  • libs/adapters/project.json
  • libs/adapters/src/openapi/__tests__/openapi-frontmcp-schema.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-security-unit.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-tool-execution.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-transforms.spec.ts
  • libs/cli/jest.config.ts
  • libs/json-schema-to-zod-v3/jest.config.ts
  • libs/json-schema-to-zod-v3/src/__tests__/handlers.spec.ts
  • libs/json-schema-to-zod-v3/src/__tests__/security.spec.ts
  • libs/mcp-from-openapi/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/errors.spec.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/mcp-from-openapi/src/__tests__/response-builder.spec.ts
  • libs/mcp-from-openapi/src/__tests__/schema-builder.spec.ts
  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/mcp-from-openapi/src/__tests__/validator.spec.ts
  • libs/plugins/jest.config.ts
  • libs/plugins/project.json
  • libs/plugins/src/cache/__tests__/cache-memory.provider.test.ts
  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/sdk/jest.config.ts
  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/src/mcp-apps/__tests__/mcp-apps.test.ts
  • libs/sdk/src/mcp-apps/csp.ts
  • libs/sdk/src/mcp-apps/index.ts
  • libs/sdk/src/mcp-apps/schemas.ts
  • libs/sdk/src/mcp-apps/template.ts
  • libs/sdk/src/mcp-apps/types.ts
  • libs/sdk/src/notification/notification.service.ts
  • libs/testing/jest.config.ts
  • libs/ui/jest.config.ts
  • libs/uipack/jest.config.ts
  • package.json
  • scripts/merge-coverage.mjs
💤 Files with no reviewable changes (8)
  • libs/sdk/project.json
  • libs/sdk/src/mcp-apps/index.ts
  • libs/sdk/src/mcp-apps/csp.ts
  • libs/sdk/src/mcp-apps/types.ts
  • libs/sdk/package.json
  • libs/sdk/src/mcp-apps/tests/mcp-apps.test.ts
  • libs/sdk/src/mcp-apps/template.ts
  • libs/sdk/src/mcp-apps/schemas.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead

Files:

  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts
  • libs/plugins/jest.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/uipack/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/errors.spec.ts
  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/mcp-from-openapi/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/response-builder.spec.ts
  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
  • libs/sdk/jest.config.ts
  • libs/ui/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-transforms.spec.ts
  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/adapters/jest.config.ts
  • libs/json-schema-to-zod-v3/src/__tests__/security.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-frontmcp-schema.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/plugins/src/cache/__tests__/cache-memory.provider.test.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • libs/testing/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/schema-builder.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-security-unit.spec.ts
  • libs/json-schema-to-zod-v3/src/__tests__/handlers.spec.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
  • libs/json-schema-to-zod-v3/jest.config.ts
  • libs/cli/jest.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • libs/sdk/src/notification/notification.service.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-tool-execution.spec.ts
  • libs/mcp-from-openapi/src/__tests__/validator.spec.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Test all code paths including error cases and constructor validation
Include error class instanceof checks in tests to validate error handling

Files:

  • libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts
  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/plugins/src/cache/__tests__/cache-memory.provider.test.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
libs/**

⚙️ CodeRabbit configuration file

libs/**: Contains publishable SDK libraries. Review for API correctness, breaking changes, and consistency with docs. When public APIs change, ensure there is a matching docs/draft/docs/** update (not direct edits under docs/docs/**).

Files:

  • libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts
  • libs/plugins/jest.config.ts
  • libs/uipack/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/errors.spec.ts
  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/mcp-from-openapi/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/response-builder.spec.ts
  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
  • libs/sdk/jest.config.ts
  • libs/ui/jest.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-transforms.spec.ts
  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/adapters/jest.config.ts
  • libs/json-schema-to-zod-v3/src/__tests__/security.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-frontmcp-schema.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/plugins/src/cache/__tests__/cache-memory.provider.test.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • libs/testing/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/schema-builder.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-security-unit.spec.ts
  • libs/json-schema-to-zod-v3/src/__tests__/handlers.spec.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
  • libs/json-schema-to-zod-v3/jest.config.ts
  • libs/cli/jest.config.ts
  • libs/adapters/project.json
  • libs/sdk/src/notification/notification.service.ts
  • libs/plugins/project.json
  • libs/adapters/src/openapi/__tests__/openapi-tool-execution.spec.ts
  • libs/mcp-from-openapi/src/__tests__/validator.spec.ts
libs/sdk/src/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

libs/sdk/src/**/*.ts: MCP response types should use strict MCP protocol types (GetPromptResult, ReadResourceResult) instead of unknown
Use specific error classes with MCP error codes instead of generic errors
Use getCapabilities() method for dynamic capability exposure instead of hardcoding capabilities
Use changeScope property instead of scope in change events to avoid confusion with Scope class
Validate URIs per RFC 3986 at metadata level using proper validation
Validate hook flows and fail fast on invalid hook configurations with specific error messages

Files:

  • libs/sdk/src/notification/notification.service.ts
🧠 Learnings (28)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Achieve 95%+ test coverage across statements, branches, functions, and lines
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Use React Testing Library for component tests and include SSR/hydration tests for all interactive components
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)

Applied to files:

  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • libs/plugins/jest.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/uipack/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/errors.spec.ts
  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/mcp-from-openapi/jest.config.ts
  • libs/sdk/jest.config.ts
  • libs/ui/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-transforms.spec.ts
  • libs/adapters/jest.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-frontmcp-schema.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • jest.coverage.preset.js
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • libs/testing/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/schema-builder.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-security-unit.spec.ts
  • libs/json-schema-to-zod-v3/src/__tests__/handlers.spec.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
  • libs/json-schema-to-zod-v3/jest.config.ts
  • libs/cli/jest.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • libs/adapters/project.json
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • libs/plugins/project.json
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-tool-execution.spec.ts
  • libs/mcp-from-openapi/src/__tests__/validator.spec.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)

Applied to files:

  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • scripts/merge-coverage.mjs
  • libs/plugins/jest.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/uipack/jest.config.ts
  • libs/mcp-from-openapi/jest.config.ts
  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/sdk/jest.config.ts
  • libs/ui/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • .github/workflows/push.yml
  • libs/adapters/jest.config.ts
  • .nycrc.json
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • jest.coverage.preset.js
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • libs/testing/jest.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
  • libs/json-schema-to-zod-v3/jest.config.ts
  • libs/cli/jest.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • package.json
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines

Applied to files:

  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • scripts/merge-coverage.mjs
  • libs/plugins/jest.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/uipack/jest.config.ts
  • libs/mcp-from-openapi/jest.config.ts
  • libs/sdk/jest.config.ts
  • libs/ui/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • libs/adapters/jest.config.ts
  • .nycrc.json
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • jest.coverage.preset.js
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • libs/testing/jest.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
  • libs/json-schema-to-zod-v3/jest.config.ts
  • libs/cli/jest.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • package.json
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation

Applied to files:

  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts
  • libs/plugins/jest.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/uipack/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/errors.spec.ts
  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/mcp-from-openapi/src/__tests__/response-builder.spec.ts
  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
  • libs/ui/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-transforms.spec.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/adapters/jest.config.ts
  • libs/json-schema-to-zod-v3/src/__tests__/security.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-frontmcp-schema.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/plugins/src/cache/__tests__/cache-memory.provider.test.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
  • jest.coverage.preset.js
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • libs/testing/jest.config.ts
  • libs/mcp-from-openapi/src/__tests__/schema-builder.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-security-unit.spec.ts
  • libs/json-schema-to-zod-v3/src/__tests__/handlers.spec.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
  • libs/json-schema-to-zod-v3/jest.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-tool-execution.spec.ts
  • libs/mcp-from-openapi/src/__tests__/validator.spec.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{renderers,utils,base-template,tool-template,runtime}/**/*.test.{ts,tsx,js,jsx} : Test HTML escaping for user-provided content in security-critical paths

Applied to files:

  • libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts
  • libs/plugins/jest.config.ts
  • libs/uipack/jest.config.ts
  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/sdk/jest.config.ts
  • libs/ui/jest.config.ts
  • libs/json-schema-to-zod-v3/src/__tests__/security.spec.ts
  • libs/testing/jest.config.ts
  • libs/adapters/src/openapi/__tests__/openapi-security-unit.spec.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/*/index.ts : Implement entry point re-exports in index.ts files for each module (adapters, build, bundler, etc.)

Applied to files:

  • libs/uipack/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{theme,build,bundler,base-template}/**/*.{ts,tsx,js,jsx} : Use theme.cdn configuration instead of hard-coding CDN URLs

Applied to files:

  • libs/uipack/jest.config.ts
  • libs/sdk/jest.config.ts
  • libs/ui/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/**/*.{ts,tsx,js,jsx} : No React dependency in frontmcp/uipack - use frontmcp/ui for React components and hooks

Applied to files:

  • libs/uipack/jest.config.ts
  • libs/sdk/jest.config.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/*.ts : Use specific error classes with MCP error codes instead of generic errors

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/errors.spec.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Include error class `instanceof` checks in tests to validate error handling

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/errors.spec.ts
  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • libs/testing/jest.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: FrontMCP is a TypeScript-first schema validation framework - all types should align with MCP protocol definitions

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-frontmcp-schema.spec.ts
  • libs/mcp-from-openapi/src/__tests__/schema-builder.spec.ts
  • libs/adapters/src/openapi/__tests__/openapi-security-unit.spec.ts
  • libs/sdk/src/notification/notification.service.ts
  • libs/mcp-from-openapi/src/__tests__/validator.spec.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/*.ts : MCP response types should use strict MCP protocol types (GetPromptResult, ReadResourceResult) instead of `unknown`

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Use React Testing Library for component tests and include SSR/hydration tests for all interactive components

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/ui/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • jest.coverage.preset.js
  • libs/testing/jest.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/**/*.{ts,tsx} : Use `.strict()` on all Zod schemas for validation

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/json-schema-to-zod-v3/src/__tests__/security.spec.ts
  • libs/json-schema-to-zod-v3/src/__tests__/handlers.spec.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : SSR components must be tested for correct HTML output and client-side hydration must be tested separately

Applied to files:

  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
  • libs/ui/jest.config.ts
  • libs/testing/jest.config.ts
  • libs/plugins/src/codecall/__tests__/describe.utils.test.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/**/*.{ts,tsx,js,jsx} : Do not expose internal error details to users - sanitize error messages

Applied to files:

  • libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : The bundler module must re-export utilities from frontmcp/uipack/bundler and provide SSR component bundling functionality

Applied to files:

  • libs/sdk/jest.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Never import React-free utilities from frontmcp/ui; use frontmcp/uipack for bundling, build tools, platform adapters, and theme utilities

Applied to files:

  • libs/sdk/jest.config.ts
  • libs/sdk/src/notification/notification.service.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Do not skip SSR/hydration testing for components; all interactive widgets must be tested in both rendering contexts

Applied to files:

  • libs/ui/jest.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Achieve 95%+ test coverage across statements, branches, functions, and lines

Applied to files:

  • .nycrc.json
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Ensure all builds complete without TypeScript warnings and 100% test pass rate is required

Applied to files:

  • .nycrc.json
  • libs/testing/jest.config.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/*.ts : Validate hook flows and fail fast on invalid hook configurations with specific error messages

Applied to files:

  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.ts : Avoid non-null assertions (`!`) - use proper error handling and throw specific errors instead

Applied to files:

  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Use Nx for build system with commands like `nx build sdk`, `nx test`, `nx run-many -t test`

Applied to files:

  • libs/adapters/project.json
  • package.json
  • libs/plugins/project.json
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/common/records/**/*.ts : Centralize record types in common/records directory and import from there instead of module-specific files

Applied to files:

  • libs/sdk/src/notification/notification.service.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • libs/sdk/src/notification/notification.service.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Test all components with invalid inputs to ensure proper validation

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/validator.spec.ts
🧬 Code graph analysis (9)
libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts (2)
libs/plugins/src/codecall/security/self-reference-guard.ts (3)
  • isBlockedSelfReference (33-48)
  • assertNotSelfReference (60-64)
  • getBlockedPatterns (70-75)
libs/plugins/src/codecall/errors/tool-call.errors.ts (1)
  • SelfReferenceError (121-131)
libs/plugins/src/codecall/__tests__/output-sanitizer.test.ts (1)
libs/plugins/src/codecall/services/output-sanitizer.ts (4)
  • DEFAULT_SANITIZER_CONFIG (68-76)
  • sanitizeOutput (97-133)
  • needsSanitization (354-370)
  • sanitizeLogMessage (375-395)
libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts (1)
libs/plugins/src/cache/cache.types.ts (1)
  • RedisCacheOptions (69-69)
libs/mcp-from-openapi/src/__tests__/generator.spec.ts (2)
libs/mcp-from-openapi/src/generator.ts (1)
  • OpenAPIToolGenerator (29-475)
libs/mcp-from-openapi/src/errors.ts (2)
  • LoadError (22-26)
  • ParseError (31-35)
libs/adapters/src/openapi/__tests__/openapi-frontmcp-schema.spec.ts (1)
libs/adapters/src/openapi/openapi.frontmcp-schema.ts (3)
  • validateFrontMcpExtension (171-215)
  • FRONTMCP_SCHEMA_VERSION (16-16)
  • SUPPORTED_VERSIONS (21-21)
libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts (1)
libs/plugins/src/codecall/errors/tool-call.errors.ts (4)
  • TOOL_CALL_ERROR_CODES (7-14)
  • createToolCallError (51-60)
  • SelfReferenceError (121-131)
  • ToolAccessDeniedError (137-148)
libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts (1)
libs/plugins/src/codecall/services/audit-logger.service.ts (2)
  • AUDIT_EVENT_TYPES (8-38)
  • AuditEvent (45-56)
libs/plugins/src/codecall/__tests__/describe.utils.test.ts (1)
libs/plugins/src/codecall/utils/describe.utils.ts (11)
  • jsonSchemaToSignature (73-78)
  • jsonSchemaToNaturalLanguage (163-200)
  • generateBasicExample (205-214)
  • generatePaginationExample (341-353)
  • generateFilterExample (358-364)
  • hasFilterParams (302-317)
  • getFilterProperties (322-336)
  • generateGetExample (399-420)
  • generateUpdateExample (438-464)
  • generateDeleteExample (469-489)
  • generateSearchExample (494-511)
libs/adapters/src/openapi/__tests__/openapi-tool-execution.spec.ts (2)
libs/adapters/src/openapi/openapi.tool.ts (1)
  • createOpenApiTool (27-203)
libs/adapters/src/openapi/__tests__/fixtures.ts (1)
  • basicOpenApiSpec (10-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build Libraries

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

♻️ Duplicate comments (1)
apps/e2e/demo-e2e-redis/jest.e2e.config.ts (1)

39-40: Coverage configuration follows established pattern.

The coverage directory and preset spreading are consistent with other e2e test configurations across the project, enabling centralized coverage reporting.

Note: The concern about !**/index.ts exclusion potentially missing SDK coverage (raised in past reviews) applies to the shared preset file (jest.e2e.coverage.preset.js), not this configuration file.

🧹 Nitpick comments (8)
libs/mcp-from-openapi/src/__tests__/generator.spec.ts (3)

84-93: Remove unused fake timers or add timeout testing.

The fake timers are initialized but never advanced in any test. The timeout test at line 195 doesn't actually verify timeout behavior—it only checks that the generator accepts a timeout option.

Either remove jest.useFakeTimers() / jest.useRealTimers() if timeout behavior isn't being tested, or add a proper timeout test that advances timers to trigger actual timeout scenarios.

🔎 Example timeout test with timer advancement
+    it('should timeout when fetch takes too long', async () => {
+      mockFetch.mockImplementation(
+        () => new Promise((resolve) => setTimeout(resolve, 10000))
+      );
+
+      const promise = OpenAPIToolGenerator.fromURL('https://example.com/api.json', {
+        timeout: 5000,
+      });
+
+      jest.advanceTimersByTime(5000);
+
+      await expect(promise).rejects.toThrow(LoadError);
+    });

109-113: Use Headers object instead of Map for mock fetch responses.

The mock returns headers: new Map([...]), but the real Fetch API returns a Headers object with a different API surface (e.g., get(), has(), entries()). While Map might work for basic operations, it doesn't accurately represent the runtime behavior.

🔎 Proposed fix using Headers
       mockFetch.mockResolvedValue({
         ok: true,
         text: () => Promise.resolve(jsonSpec),
-        headers: new Map([['content-type', 'application/json']]),
+        headers: new Headers([['content-type', 'application/json']]),
       });

Apply this pattern to all mock fetch responses in this test suite (lines 112, 137, 162, 212, 238, 270, 302).


195-219: Enhance timeout test to verify actual timeout behavior.

This test only confirms that the timeout option is accepted, but doesn't verify that it's actually enforced. Consider adding a test that simulates a delayed fetch response and advances fake timers to confirm the timeout triggers a LoadError.

See the example in the comment on lines 84-93 for how to properly test timeout behavior.

libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts (1)

103-125: Consider testing rawMessage behavior for TIMEOUT, ACCESS_DENIED, and SELF_REFERENCE.

While the current tests verify the default messages, consider adding tests to explicitly verify that these error codes ignore the rawMessage parameter (similar to the test for NOT_FOUND at lines 33-36). This would document the behavior more completely.

🔎 Example test additions
  describe('TIMEOUT error', () => {
    it('should create error with default message', () => {
      const error = createToolCallError('TIMEOUT', 'slow:operation');
      expect(error.code).toBe('TIMEOUT');
      expect(error.message).toBe('Tool "slow:operation" execution timed out');
    });
+
+   it('should ignore raw message for TIMEOUT', () => {
+     const error = createToolCallError('TIMEOUT', 'test:tool', 'internal error details');
+     expect(error.message).toBe('Tool "test:tool" execution timed out');
+   });
  });

  describe('ACCESS_DENIED error', () => {
    it('should create error with default message', () => {
      const error = createToolCallError('ACCESS_DENIED', 'admin:delete');
      expect(error.code).toBe('ACCESS_DENIED');
      expect(error.message).toBe('Access denied for tool "admin:delete"');
    });
+
+   it('should ignore raw message for ACCESS_DENIED', () => {
+     const error = createToolCallError('ACCESS_DENIED', 'test:tool', 'internal details');
+     expect(error.message).toBe('Access denied for tool "test:tool"');
+   });
  });

  describe('SELF_REFERENCE error', () => {
    it('should create error with default message', () => {
      const error = createToolCallError('SELF_REFERENCE', 'codecall:execute');
      expect(error.code).toBe('SELF_REFERENCE');
      expect(error.message).toBe('Cannot call CodeCall tools from within AgentScript');
    });
+
+   it('should ignore raw message for SELF_REFERENCE', () => {
+     const error = createToolCallError('SELF_REFERENCE', 'test:tool', 'internal details');
+     expect(error.message).toBe('Cannot call CodeCall tools from within AgentScript');
+   });
  });
libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts (4)

33-33: Fragile mock access pattern.

Accessing Redis.mock.results[0].value assumes the first mock call is the current provider. If tests or setup logic changes to create multiple instances, this will break.

🔎 Proposed fix
-    mockClient = Redis.mock.results[0].value;
+    mockClient = Redis.mock.results[Redis.mock.results.length - 1].value;

Or better yet, store a reference to the client during provider construction by exposing it for testing purposes.


77-87: Type assertions mask the test intent.

Using as any circumvents type safety, which is the very thing being tested here.

🔎 Alternative approach
     expect(() => {
       new CacheRedisProvider({
-        type: 'invalid' as any,
-      } as RedisCacheOptions);
+        type: 'invalid',
+      } as unknown as RedisCacheOptions);
     }).toThrow(

Using unknown is more explicit about bypassing type safety for testing purposes.


127-134: Consider testing edge cases for object serialization.

While the basic object serialization is tested, consider adding tests for edge cases like circular references, null, undefined, or objects with non-serializable properties.


171-177: Consider testing malformed JSON handling.

The test verifies plain strings are returned as-is, but doesn't test the behavior when Redis returns malformed JSON (e.g., "{invalid"). Consider adding a test to verify graceful handling of JSON parse errors.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76ac8bb and cf90823.

📒 Files selected for processing (30)
  • .github/workflows/push.yml
  • .nycrc.json
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • jest.coverage.preset.js
  • jest.e2e.coverage.preset.js
  • libs/adapters/project.json
  • libs/cli/src/__tests__/args.spec.ts
  • libs/cli/src/args.ts
  • libs/cli/src/cli.ts
  • libs/cli/src/commands/test.ts
  • libs/json-schema-to-zod-v3/src/__tests__/handlers.spec.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/mcp-from-openapi/src/__tests__/types.spec.ts
  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • libs/plugins/src/codecall/__tests__/self-reference-guard.test.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • libs/plugins/src/codecall/errors/tool-call.errors.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • libs/mcp-from-openapi/src/tests/types.spec.ts
  • libs/json-schema-to-zod-v3/src/tests/handlers.spec.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • libs/plugins/src/codecall/tests/self-reference-guard.test.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • libs/adapters/project.json
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • jest.coverage.preset.js
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead

Files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/plugins/src/codecall/errors/tool-call.errors.ts
  • libs/cli/src/commands/test.ts
  • libs/cli/src/args.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • libs/cli/src/cli.ts
  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/cli/src/__tests__/args.spec.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
libs/**

⚙️ CodeRabbit configuration file

libs/**: Contains publishable SDK libraries. Review for API correctness, breaking changes, and consistency with docs. When public APIs change, ensure there is a matching docs/draft/docs/** update (not direct edits under docs/docs/**).

Files:

  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/plugins/src/codecall/errors/tool-call.errors.ts
  • libs/cli/src/commands/test.ts
  • libs/cli/src/args.ts
  • libs/cli/src/cli.ts
  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • libs/cli/src/__tests__/args.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Test all code paths including error cases and constructor validation
Include error class instanceof checks in tests to validate error handling

Files:

  • libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • libs/cli/src/commands/test.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • libs/cli/src/cli.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/cli/src/__tests__/args.spec.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • jest.e2e.coverage.preset.js
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • .github/workflows/push.yml
  • .nycrc.json
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • libs/cli/src/commands/test.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/cli/src/__tests__/args.spec.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • jest.e2e.coverage.preset.js
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • .nycrc.json
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • libs/cli/src/commands/test.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • libs/cli/src/cli.ts
  • libs/cli/src/__tests__/args.spec.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • jest.e2e.coverage.preset.js
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • .github/workflows/push.yml
  • .nycrc.json
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/cli/src/commands/test.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • libs/cli/src/__tests__/args.spec.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • jest.e2e.coverage.preset.js
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
  • .nycrc.json
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/*/index.ts : Implement entry point re-exports in index.ts files for each module (adapters, build, bundler, etc.)

Applied to files:

  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • jest.e2e.coverage.preset.js
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • jest.e2e.coverage.preset.js
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.ts : Avoid non-null assertions (`!`) - use proper error handling and throw specific errors instead

Applied to files:

  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : The bundler module must re-export utilities from frontmcp/uipack/bundler and provide SSR component bundling functionality

Applied to files:

  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/*.ts : Use `getCapabilities()` method for dynamic capability exposure instead of hardcoding capabilities

Applied to files:

  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{renderers,utils,base-template,tool-template,runtime}/**/*.test.{ts,tsx,js,jsx} : Test HTML escaping for user-provided content in security-critical paths

Applied to files:

  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/**/*.{ts,tsx} : Avoid using `any` type without justification in TypeScript

Applied to files:

  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/*.ts : Use specific error classes with MCP error codes instead of generic errors

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/generator.spec.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Include error class `instanceof` checks in tests to validate error handling

Applied to files:

  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/common/records/**/*.ts : Centralize record types in common/records directory and import from there instead of module-specific files

Applied to files:

  • jest.e2e.coverage.preset.js
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Use React Testing Library for component tests and include SSR/hydration tests for all interactive components

Applied to files:

  • jest.e2e.coverage.preset.js
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/*.ts : Validate hook flows and fail fast on invalid hook configurations with specific error messages

Applied to files:

  • libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Achieve 95%+ test coverage across statements, branches, functions, and lines

Applied to files:

  • .github/workflows/push.yml
  • .nycrc.json
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Ensure all builds complete without TypeScript warnings and 100% test pass rate is required

Applied to files:

  • .github/workflows/push.yml
  • .nycrc.json
🧬 Code graph analysis (4)
libs/cli/src/commands/test.ts (1)
libs/cli/src/colors.ts (1)
  • c (13-13)
libs/plugins/src/cache/__tests__/cache-redis.provider.test.ts (1)
libs/plugins/src/cache/cache.types.ts (1)
  • RedisCacheOptions (69-69)
libs/cli/src/__tests__/args.spec.ts (1)
libs/cli/src/args.ts (1)
  • parseArgs (34-58)
libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts (1)
libs/plugins/src/codecall/errors/tool-call.errors.ts (5)
  • TOOL_CALL_ERROR_CODES (7-14)
  • createToolCallError (51-60)
  • SelfReferenceError (121-131)
  • ToolAccessDeniedError (137-149)
  • ToolNotFoundError (155-165)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Lint & Format Checks
  • GitHub Check: Build Libraries
🔇 Additional comments (30)
libs/mcp-from-openapi/src/__tests__/generator.spec.ts (1)

80-308: Excellent test coverage expansion!

These additions significantly improve test coverage with comprehensive scenarios:

  • URL/file loading with multiple error conditions (HTTP errors, network failures, missing content-types)
  • Custom naming strategies and conflict resolution
  • Extensive parameter resolver coverage (security types, content-types, deprecated params, style/explode)
  • Security requirements (bearer, apiKey, oauth2, openIdConnect, including edge cases)
  • Metadata extraction (externalDocs, x-frontmcp extensions, servers)
  • Operation filtering strategies
  • Error handling paths (missing operations, validation failures, generation errors)

The test quality aligns well with the learning that requires 95%+ coverage across all metrics and testing all code paths including error cases.

Based on learnings, 95%+ test coverage is required across statements, branches, functions, and lines, with all code paths including error cases tested.

Also applies to: 310-323, 325-392, 834-1012, 1015-1516

libs/plugins/src/codecall/errors/tool-call.errors.ts (1)

147-147: Excellent fix! Consistent immutability across all error classes.

The addition of Object.freeze(this) to both ToolAccessDeniedError and ToolNotFoundError addresses the past review feedback and ensures all three internal error classes have uniform freeze behavior. This prevents tampering with error properties and strengthens the security guarantees of the error handling system.

Also applies to: 163-163

libs/plugins/src/codecall/__tests__/tool-call.errors.test.ts (6)

13-22: LGTM!

The error codes constant is thoroughly tested with all six codes verified.


134-139: LGTM! Justified use of as any for testing the default error case.

The type assertion to any is appropriately used here to test the fallback behavior when an unknown error code is passed at runtime. This tests the default branch in the switch statement and ensures graceful degradation.


142-162: LGTM!

Comprehensive testing of SelfReferenceError with property validation, instanceof checks, and immutability verification. This aligns with the coding guidelines for testing error classes.


164-183: Excellent! Addresses past review feedback.

The immutability test (lines 179-182) directly addresses the past review comment that flagged missing immutability tests for ToolAccessDeniedError. The test suite now comprehensively covers properties, instanceof checks, and immutability.


185-203: Excellent! Addresses past review feedback.

The immutability test (lines 199-202) directly addresses the past review comment that flagged missing immutability tests for ToolNotFoundError. The test suite now comprehensively covers properties, instanceof checks, and immutability.


1-203: Outstanding test coverage that aligns with all coding guidelines.

This comprehensive test suite achieves the 95%+ coverage requirement and thoroughly tests:

  • All error codes and their message generation
  • Message sanitization with various edge cases (Unix/Windows paths, line numbers, stack traces, truncation)
  • All three error classes with property validation, instanceof checks, and immutability verification
  • Error handling for unknown error codes

The tests directly address the past review feedback by adding immutability tests for ToolAccessDeniedError and ToolNotFoundError, and the corresponding source file changes ensure all error classes are consistently frozen.

Based on learnings from coding guidelines for this repository.

apps/e2e/demo-e2e-redis/jest.e2e.config.ts (1)

3-4: Preset loading pattern is appropriate for Jest configuration.

The require statement for loading the coverage preset is appropriate in this context, as Jest configuration files commonly use CommonJS module resolution for preset loading. The ESLint disable comment is justified.

apps/e2e/demo-e2e-errors/jest.e2e.config.ts (1)

3-4: Coverage integration follows established pattern.

The coverage preset integration and directory configuration are consistent with other e2e test suites in the project. The require statement is appropriate for Jest configuration loading.

Also applies to: 39-40

apps/e2e/demo-e2e-cache/jest.e2e.config.ts (1)

3-4: Coverage configuration is consistent across e2e suites.

The implementation matches the pattern used by other demo-e2e configurations, providing uniform coverage collection and reporting.

Also applies to: 39-40

apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts (1)

3-4: Coverage integration is properly configured.

The coverage preset and directory configuration follow the established pattern across all e2e test suites.

Also applies to: 39-40

.nycrc.json (1)

1-21: NYC configuration aligns with project coverage requirements.

The configuration correctly:

  • Sets 95% thresholds across all metrics (statements, branches, functions, lines), meeting the project's coverage standards from learnings
  • Specifically excludes only libs/adapters/src/index.ts and libs/plugins/src/index.ts (lines 7-8), avoiding the blanket !**/index.ts exclusion that would incorrectly omit executable code in libs/sdk/src/index.ts
  • Configures appropriate reporters and output directories

Based on learnings, this meets the requirement for 95%+ test coverage across all metrics.

.github/workflows/push.yml (4)

186-193: Coverage job is appropriately scoped to main branch.

The coverage job correctly:

  • Runs only on the main branch to avoid redundant coverage collection on feature branches
  • Depends on prior build, unit-tests, and e2e-tests jobs to ensure code quality before coverage analysis

214-219: Verify test execution strategy for coverage collection.

The coverage job re-runs all unit and E2E tests with --coverage flag. This means tests are executed twice: once in the dedicated test jobs (without coverage) and again here (with coverage).

While this approach isolates coverage collection, it increases CI time. Consider whether the earlier unit-tests and e2e-tests jobs should collect coverage directly, or if this separation is intentional for performance reasons (running core tests faster without coverage overhead).


224-228: Codecov upload is configured to not fail the build.

Line 227 sets fail_ci_if_error: false, meaning Codecov upload failures won't block the pipeline. This is reasonable for preventing external service issues from breaking builds, but note that coverage quality enforcement relies solely on the local threshold check (line 231).


230-231: Coverage threshold enforcement meets project standards.

The threshold check enforces 95% across all metrics (statements, branches, functions, lines), aligning with project learnings and requirements. Since there's no continue-on-error flag, the workflow will fail if coverage drops below these thresholds.

Based on learnings, this correctly enforces the 95%+ test coverage requirement.

apps/e2e/demo-e2e-codecall/jest.e2e.config.ts (1)

3-4: Coverage configuration follows project-wide pattern.

The implementation is consistent with other e2e test configurations, enabling centralized coverage collection and reporting.

Also applies to: 39-40

apps/e2e/demo-e2e-serverless/jest.e2e.config.ts (1)

3-4: Coverage integration completed for serverless e2e suite.

The configuration matches the pattern established across all other e2e test suites, providing uniform coverage collection.

Also applies to: 39-40

apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts (1)

1-2: LGTM: Coverage preset integration is correct.

The coverage preset is imported via require() and merged into the Jest config. The coverageDirectory is set before the preset spread, and since the preset (as shown in jest.e2e.coverage.preset.js) doesn't define coverageDirectory, there's no conflict. The pattern is consistent with other e2e demo configs in this PR.

Also applies to: 49-50

libs/cli/src/cli.ts (1)

51-51: LGTM: Help text addition is accurate and consistent.

The coverage flag documentation is correctly placed in the Test Options section and matches the implementation.

apps/e2e/demo-e2e-transparent/jest.e2e.config.ts (1)

3-4: LGTM: Coverage preset integration follows established pattern.

The implementation is consistent with other e2e configs in this PR and properly typed with Config.InitialOptions.

Also applies to: 39-40

libs/cli/src/args.ts (2)

25-25: LGTM: Interface extension is correct.

The coverage field is properly typed as an optional boolean, consistent with other test-related flags.


48-48: LGTM: Flag parsing implementation is correct.

The parsing logic for --coverage and -c follows the same pattern as other boolean flags in this function.

apps/e2e/demo-e2e-public/jest.e2e.config.ts (1)

3-4: LGTM: Coverage preset integration is consistent.

The implementation matches the pattern used across all e2e demo configs in this PR.

Also applies to: 39-40

libs/cli/src/commands/test.ts (2)

140-143: LGTM: Coverage flag handling is implemented correctly.

The coverage flag is properly passed to Jest and logged for user visibility.

Also applies to: 162-164


69-79: The collectCoverageFrom pattern is correct as-is.

All projects in the repository (libs, apps, and e2e subdirectories) consistently use a src/ directory structure. The pattern <rootDir>/src/**/*.ts is well-founded and requires no changes.

Likely an incorrect or invalid review comment.

libs/cli/src/__tests__/args.spec.ts (2)

190-205: LGTM: Coverage flag tests are comprehensive.

The tests cover all scenarios: long form (--coverage), short form (-c), and absence of the flag. The assertions correctly validate both presence and absence.


227-236: LGTM: Integration test validates multi-flag scenarios.

The combined flags test ensures the coverage flag works correctly alongside other test command flags.

jest.e2e.coverage.preset.js (1)

1-20: LGTM: E2E coverage preset is well-structured with clear intent.

The configuration is appropriate for E2E coverage aggregation:

  • JSON-only reporter enables merging coverage across e2e suites
  • The exclusion pattern correctly omits test files
  • The comment clearly explains why sdk/index.ts is included (executable code) while barrel exports in adapters/plugins are excluded

Based on learnings, ensure that the coverage thresholds (95%+ across all metrics) are enforced at the aggregation level, which appears to be handled by .nycrc.json mentioned in the PR summary.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (10)
apps/e2e/demo-e2e-notifications/jest.e2e.config.ts (2)

2-5: Add type safety and error handling for external preset loading.

Same issue as in demo-e2e-openapi: The require() call returns any without type safety or error handling.

See the proposed fix in the review comment for apps/e2e/demo-e2e-openapi/jest.e2e.config.ts (lines 2-5).


40-41: Critical: Verify preset spread order doesn't override coverageDirectory.

Same property override concern as in demo-e2e-openapi. The spread order could cause all apps to share the same coverage directory.

apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts (2)

2-5: Add type safety and error handling for external preset loading.

Same type safety and error handling issues as other E2E configs.


40-41: Critical: Verify preset spread order doesn't override coverageDirectory.

Same property override concern across all E2E configs.

apps/e2e/demo-e2e-codecall/jest.e2e.config.ts (2)

2-5: Add type safety and error handling for external preset loading.

Same type safety and error handling issues as other E2E configs.


40-41: Critical: Verify preset spread order doesn't override coverageDirectory.

Same property override concern across all E2E configs.

apps/e2e/demo-e2e-cache/jest.e2e.config.ts (2)

2-5: Add type safety and error handling for external preset loading.

Same type safety and error handling issues as other E2E configs.


40-41: Critical: Verify preset spread order doesn't override coverageDirectory.

Same property override concern across all E2E configs.

apps/e2e/demo-e2e-serverless/jest.e2e.config.ts (2)

2-5: Add type safety and error handling for external preset loading.

Same type safety and error handling issues as other E2E configs.


40-41: Critical: Verify preset spread order doesn't override coverageDirectory.

Same property override concern across all E2E configs.

🧹 Nitpick comments (1)
libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts (1)

121-121: Consider replacing any type assertions with proper types.

Throughout the test suite, event data is cast to any to access event-specific properties. This bypasses TypeScript's type safety and violates the coding guideline requiring strict typing.

Consider defining specific interfaces for each event type's data payload and using type guards or typed helper functions instead. For example:

interface ExecutionStartData {
  scriptHash: string;
  scriptLength: number;
}

// Then in tests:
const data = receivedEvents[0].data as ExecutionStartData;
expect(data.scriptHash).toMatch(/^sh_[0-9a-f]{8}$/);

This provides type safety, better IDE support, and catches potential issues at compile time.

As per coding guidelines: "Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults."

Also applies to: 149-149, 167-167, 191-191, 215-215, 227-227, 240-240, 249-249, 262-262, 274-274, 287-287, 299-299, 312-312, 321-321, 341-341, 350-350, 363-363, 374-374, 383-383, 394-394, 404-404, 414-414, 426-427, 437-438

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf90823 and c17b2c6.

📒 Files selected for processing (15)
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • apps/e2e/demo-e2e-ui/jest.e2e.config.ts
  • apps/e2e/demo-e2e-public/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transparent/jest.e2e.config.ts
  • apps/e2e/demo-e2e-redis/jest.e2e.config.ts
  • apps/e2e/demo-e2e-errors/jest.e2e.config.ts
  • apps/e2e/demo-e2e-providers/jest.e2e.config.ts
  • apps/e2e/demo-e2e-hooks/jest.e2e.config.ts
  • apps/e2e/demo-e2e-orchestrated/jest.e2e.config.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead

Files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Test all code paths including error cases and constructor validation
Include error class instanceof checks in tests to validate error handling

Files:

  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
libs/**

⚙️ CodeRabbit configuration file

libs/**: Contains publishable SDK libraries. Review for API correctness, breaking changes, and consistency with docs. When public APIs change, ensure there is a matching docs/draft/docs/** update (not direct edits under docs/docs/**).

Files:

  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-cache/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
  • apps/e2e/demo-e2e-codecall/jest.e2e.config.ts
  • apps/e2e/demo-e2e-notifications/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation

Applied to files:

  • apps/e2e/demo-e2e-multiapp/jest.e2e.config.ts
  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • apps/e2e/demo-e2e-openapi/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/*/index.ts : Implement entry point re-exports in index.ts files for each module (adapters, build, bundler, etc.)

Applied to files:

  • apps/e2e/demo-e2e-serverless/jest.e2e.config.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{renderers,utils,base-template,tool-template,runtime}/**/*.test.{ts,tsx,js,jsx} : Test HTML escaping for user-provided content in security-critical paths

Applied to files:

  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Include error class `instanceof` checks in tests to validate error handling

Applied to files:

  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Achieve 95%+ test coverage across statements, branches, functions, and lines

Applied to files:

  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : SSR components must be tested for correct HTML output and client-side hydration must be tested separately

Applied to files:

  • libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts
🧬 Code graph analysis (1)
libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts (1)
libs/plugins/src/codecall/services/audit-logger.service.ts (2)
  • AUDIT_EVENT_TYPES (8-38)
  • AuditEvent (45-56)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Libraries
  • GitHub Check: Lint & Format Checks
🔇 Additional comments (2)
libs/plugins/src/codecall/__tests__/audit-logger.service.test.ts (1)

1-480: Excellent test coverage addressing all previous concerns.

The test suite comprehensively covers the AuditLoggerService with all previously requested edge cases now included:

  • Stack trace sanitization with multi-line errors (lines 354-368)
  • Line number removal with explicit patterns (lines 370-377)
  • Hash algorithm edge cases including empty strings, very long strings, and unicode (lines 389-441)
  • Execution ID uniqueness under stress with 1000+ consecutive calls (lines 443-479)

All public methods are tested with normal paths, edge cases, error conditions, and data validation. Immutability is verified and listener isolation is confirmed. This should comfortably achieve the required 95%+ coverage across all metrics.

apps/e2e/demo-e2e-openapi/jest.e2e.config.ts (1)

40-41: No issue found: preset does not define coverageDirectory.

The jest.e2e.coverage.preset.js file contains only coverageReporters and collectCoverageFrom properties. Since the preset does not define coverageDirectory, the spread operator cannot override the app-specific path defined at line 40. The configuration is correct as written.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts (1)

360-376: Add a clarifying comment for the as any cast.

The use of as any on line 368 is reasonable for testing unknown type handling, but per coding guidelines, a comment explaining why it's necessary would improve clarity.

🔎 Suggested addition
     it('should handle unknown security type', async () => {
       const mappers: ParameterMapper[] = [
         {
           inputKey: 'Auth',
           key: 'Auth',
           type: 'header',
           security: {
             scheme: 'unknownScheme',
+            // Using 'as any' to test graceful handling of invalid security types
             type: 'unknown' as any,
           },
         },
       ];
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c17b2c6 and 2243011.

📒 Files selected for processing (1)
  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead

Files:

  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
libs/**

⚙️ CodeRabbit configuration file

libs/**: Contains publishable SDK libraries. Review for API correctness, breaking changes, and consistency with docs. When public APIs change, ensure there is a matching docs/draft/docs/** update (not direct edits under docs/docs/**).

Files:

  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation

Applied to files:

  • libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Libraries
  • GitHub Check: Lint & Format Checks
🔇 Additional comments (9)
libs/mcp-from-openapi/src/__tests__/security-resolver.spec.ts (9)

1-13: LGTM! Clean test setup.

The imports and test setup follow best practices with proper type imports and test isolation via beforeEach.


15-85: LGTM! Comprehensive coverage of basic resolve scenarios.

The tests effectively cover empty mappers, non-security parameter skipping, context-based security (certificates, cookies), and bearer authentication. All assertions are precise and appropriate.


87-336: LGTM! Excellent coverage of authentication types.

The tests comprehensively cover all major authentication schemes (Basic, Digest, API Key in multiple locations, OAuth2, OpenID Connect, custom resolvers, named API keys, and custom headers). Each test properly validates the expected output format.


338-358: LGTM! Solid error handling and edge case coverage.

The tests effectively verify signature detection, unknown type/scheme handling, and missing authentication value scenarios. The resolver correctly handles these edge cases without throwing errors.

Also applies to: 378-418


421-486: LGTM! Thorough validation of missing security detection.

The checkMissingSecurity tests properly verify detection of unresolved security schemes while correctly skipping non-security parameters.


489-574: LGTM! Excellent signRequest error handling.

The tests cover successful signature generation with header preservation, proper error handling when signatureGenerator is missing (line 542), and correct skipping of non-signature security parameters.


577-602: LGTM! Validates minimal Digest auth formatting.

The test correctly verifies that Digest authentication works with only username and password fields, ensuring graceful handling of partial Digest configurations.


605-677: LGTM! Comprehensive edge case coverage.

Excellent coverage of edge cases including async custom resolvers, undefined return values with fallback behavior, and sensible defaults for missing httpScheme. These tests ensure robust handling of various real-world scenarios.


681-716: LGTM! Complete createSecurityContext validation.

The tests thoroughly verify the createSecurityContext helper function with partial auth, full auth types (including custom resolver functions), and empty auth objects. Good coverage of the context creation API.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (6)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts (1)

22-41: Optimize redundant map access.

The counter is accessed three times: initialization check (line 28), increment (line 33), and return (line 39). The value retrieved and incremented on lines 33-34 should be reused in the return statement instead of accessing the map again on line 39.

🔎 Proposed refactor
 async execute(_input: z.input<typeof inputSchema>): Promise<z.infer<typeof outputSchema>> {
   const authInfo = this.getAuthInfo();
   const sessionId = authInfo.sessionId ?? 'no-session';
   const hasSession = !!authInfo.sessionId;

   // Initialize counter if needed
   if (!sessionRequestCounts.has(sessionId)) {
     sessionRequestCounts.set(sessionId, 0);
   }

   // Increment request count
-  const currentCount = sessionRequestCounts.get(sessionId) ?? 0;
-  sessionRequestCounts.set(sessionId, currentCount + 1);
+  const currentCount = sessionRequestCounts.get(sessionId)!;
+  const newCount = currentCount + 1;
+  sessionRequestCounts.set(sessionId, newCount);

   return {
     sessionId,
     hasSession,
-    requestCount: sessionRequestCounts.get(sessionId) ?? 0,
+    requestCount: newCount,
   };
 }
apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json (1)

9-10: Remove duplicate decorator configuration.

emitDecoratorMetadata and experimentalDecorators are already enabled in the parent tsconfig.json (lines 4-5), making these settings redundant.

🔎 Proposed refactor
 {
   "extends": "./tsconfig.json",
   "compilerOptions": {
     "outDir": "../../../dist/out-tsc",
     "module": "NodeNext",
     "moduleResolution": "NodeNext",
     "jsx": "react-jsx",
-    "types": ["node"],
-    "emitDecoratorMetadata": true,
-    "experimentalDecorators": true
+    "types": ["node"]
   },
   "exclude": ["jest.config.ts", "jest.e2e.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "e2e/**/*.ts"],
   "include": ["src/**/*.ts", "src/**/*.tsx"]
 }
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts (2)

28-28: Use consistent authInfo access pattern.

This file accesses this.authInfo directly (line 28), while the companion GetSessionInfoTool uses this.getAuthInfo() (get-session-info.tool.ts, line 23). Use a consistent pattern across both tools for maintainability.

🔎 Proposed fix for consistency
 async execute(input: z.infer<typeof inputSchema>): Promise<z.infer<typeof outputSchema>> {
-  const sessionId = this.authInfo.sessionId ?? 'no-session';
+  const authInfo = this.getAuthInfo();
+  const sessionId = authInfo.sessionId ?? 'no-session';
   const amount = input.amount ?? 1;

29-29: Remove unnecessary default fallback.

The input schema already defines .default(1) for the amount field (line 6), so Zod will automatically provide the default value when amount is undefined. The ?? 1 fallback is redundant.

🔎 Proposed refactor
 async execute(input: z.infer<typeof inputSchema>): Promise<z.infer<typeof outputSchema>> {
   const sessionId = this.authInfo.sessionId ?? 'no-session';
-  const amount = input.amount ?? 1;
+  const amount = input.amount;
apps/e2e/demo-e2e-transport-recreation/e2e/transport-recreation.e2e.test.ts (1)

84-84: JSON string matching in assertions may be fragile.

While more specific than bare number matching, checking for JSON fragments like '"previousValue":10' can still break if the response format changes (e.g., whitespace variations, field ordering). Consider parsing the response as JSON and asserting on structured data, or verify that the testing framework normalizes JSON formatting.

🔎 Alternative approach using structured assertions

If the testing framework provides access to parsed response data, prefer:

// Example of more robust assertion if response is accessible as JSON
const responseData = JSON.parse(result.content[0].text);
expect(responseData.previousValue).toBe(10);
expect(responseData.incrementedBy).toBe(1);

Otherwise, ensure the current string matching approach is documented as expecting specific JSON formatting from the MCP protocol.

Also applies to: 107-107

apps/e2e/demo-e2e-transport-recreation/project.json (1)

41-41: Consider removing passWithNoTests: true after initial development.

While passWithNoTests: true is useful during initial setup, it can hide issues where tests are accidentally not discovered or executed. Since this PR adds actual e2e tests (transport-recreation.e2e.test.ts), consider whether this option should remain enabled.

Also applies to: 50-50

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2243011 and aa97dbe.

📒 Files selected for processing (14)
  • apps/e2e/demo-e2e-transport-recreation/e2e/transport-recreation.e2e.test.ts
  • apps/e2e/demo-e2e-transport-recreation/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transport-recreation/project.json
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/index.ts
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts
  • apps/e2e/demo-e2e-transport-recreation/src/main.ts
  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
  • apps/e2e/demo-e2e-transport-recreation/tsconfig.json
  • apps/e2e/demo-e2e-transport-recreation/webpack.config.js
  • libs/sdk/src/transport/__tests__/transport.registry.test.ts
  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
  • libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts
  • libs/sdk/src/transport/adapters/streamable-http-transport.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead

Files:

  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/index.ts
  • libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts
  • apps/e2e/demo-e2e-transport-recreation/e2e/transport-recreation.e2e.test.ts
  • apps/e2e/demo-e2e-transport-recreation/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transport-recreation/src/main.ts
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts
  • libs/sdk/src/transport/__tests__/transport.registry.test.ts
  • libs/sdk/src/transport/adapters/streamable-http-transport.ts
  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts
  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Test all code paths including error cases and constructor validation
Include error class instanceof checks in tests to validate error handling

Files:

  • libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts
  • apps/e2e/demo-e2e-transport-recreation/e2e/transport-recreation.e2e.test.ts
  • libs/sdk/src/transport/__tests__/transport.registry.test.ts
  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
libs/sdk/src/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

libs/sdk/src/**/*.ts: MCP response types should use strict MCP protocol types (GetPromptResult, ReadResourceResult) instead of unknown
Use specific error classes with MCP error codes instead of generic errors
Use getCapabilities() method for dynamic capability exposure instead of hardcoding capabilities
Use changeScope property instead of scope in change events to avoid confusion with Scope class
Validate URIs per RFC 3986 at metadata level using proper validation
Validate hook flows and fail fast on invalid hook configurations with specific error messages

Files:

  • libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts
  • libs/sdk/src/transport/__tests__/transport.registry.test.ts
  • libs/sdk/src/transport/adapters/streamable-http-transport.ts
  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
libs/**

⚙️ CodeRabbit configuration file

libs/**: Contains publishable SDK libraries. Review for API correctness, breaking changes, and consistency with docs. When public APIs change, ensure there is a matching docs/draft/docs/** update (not direct edits under docs/docs/**).

Files:

  • libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts
  • libs/sdk/src/transport/__tests__/transport.registry.test.ts
  • libs/sdk/src/transport/adapters/streamable-http-transport.ts
  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Test coverage must be 95%+ across statements, branches, functions, and lines
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/*/index.ts : Implement entry point re-exports in index.ts files for each module (adapters, build, bundler, etc.)

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/index.ts
  • apps/e2e/demo-e2e-transport-recreation/webpack.config.js
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{adapters,theme,build}/**/*.test.{ts,tsx,js,jsx} : Test component behavior across all platform configurations (OpenAI, Claude, etc.)

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/index.ts
  • libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts
  • apps/e2e/demo-e2e-transport-recreation/e2e/transport-recreation.e2e.test.ts
  • apps/e2e/demo-e2e-transport-recreation/jest.e2e.config.ts
  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
  • apps/e2e/demo-e2e-transport-recreation/tsconfig.json
  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Universal app shell (UniversalApp, FrontMCPProvider) must provide platform-agnostic React context and initialization

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/index.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation

Applied to files:

  • libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts
  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: FrontMCP is a TypeScript-first schema validation framework - all types should align with MCP protocol definitions

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/src/main.ts
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : The bundler module must re-export utilities from frontmcp/uipack/bundler and provide SSR component bundling functionality

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/webpack.config.js
📚 Learning: 2025-12-24T00:41:55.397Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:55.397Z
Learning: Applies to libs/uipack/src/{theme,build,bundler,base-template}/**/*.{ts,tsx,js,jsx} : Use theme.cdn configuration instead of hard-coding CDN URLs

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/webpack.config.js
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Use Nx for build system with commands like `nx build sdk`, `nx test`, `nx run-many -t test`

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/project.json
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/common/records/**/*.ts : Centralize record types in common/records directory and import from there instead of module-specific files

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
  • apps/e2e/demo-e2e-transport-recreation/tsconfig.json
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to libs/sdk/src/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
📚 Learning: 2025-12-19T02:04:46.475Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.475Z
Learning: Applies to **/*.ts : Use strict TypeScript mode with no `any` types without strong justification - use `unknown` instead for generic type defaults

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Use React Testing Library for component tests and include SSR/hydration tests for all interactive components

Applied to files:

  • apps/e2e/demo-e2e-transport-recreation/tsconfig.app.json
📚 Learning: 2025-12-24T00:41:41.819Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-24T00:41:41.819Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : SSR components must be tested for correct HTML output and client-side hydration must be tested separately

Applied to files:

  • libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts
🧬 Code graph analysis (6)
libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts (2)
libs/sdk/src/transport/adapters/streamable-http-transport.ts (1)
  • RecreateableStreamableHTTPServerTransport (58-160)
libs/testing/src/client/mcp-test-client.ts (1)
  • sessionId (207-209)
apps/e2e/demo-e2e-transport-recreation/jest.e2e.config.ts (1)
libs/sdk/src/common/utils/decide-request-intent.utils.ts (1)
  • Config (58-60)
apps/e2e/demo-e2e-transport-recreation/src/main.ts (1)
apps/e2e/demo-e2e-orchestrated/src/main.ts (1)
  • Server (38-38)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts (3)
libs/cli/src/templates/3rd-party-integration/src/tools/example.list.ts (1)
  • inputSchema (12-17)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts (1)
  • Tool (20-45)
libs/testing/src/client/mcp-test-client.ts (1)
  • sessionId (207-209)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/increment-counter.tool.ts (3)
libs/cli/src/templates/3rd-party-integration/src/tools/example.list.ts (1)
  • inputSchema (12-17)
apps/e2e/demo-e2e-transport-recreation/src/apps/transport-test/tools/get-session-info.tool.ts (1)
  • Tool (15-42)
libs/testing/src/client/mcp-test-client.ts (1)
  • sessionId (207-209)
libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts (1)
libs/testing/src/client/mcp-test-client.ts (1)
  • sessionId (207-209)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Libraries
  • GitHub Check: Lint & Format Checks
🔇 Additional comments (11)
libs/sdk/src/transport/adapters/streamable-http-transport.ts (5)

59-63: LGTM - Well-documented deferred initialization field.

The private _pendingInitState field appropriately stores the sessionId when the internal transport isn't ready, which is essential for serverless cold start scenarios.


79-85: LGTM - Clean observability API.

The hasPendingInitState getter provides a clean way to inspect whether initialization state is pending. This is useful for debugging and testing.


101-120: LGTM - Robust deferred initialization logic.

The method correctly handles both immediate initialization (when transport is ready) and deferred initialization (when transport isn't ready yet). Input validation is thorough, covering empty strings, whitespace, and type checking.


122-140: LGTM - Well-designed helper with SDK version safety.

The _applyInitState helper centralizes the initialization logic and includes proper validation to detect MCP SDK version incompatibilities. This defensive coding will help catch breaking changes early.


142-159: LGTM - Correct first-request initialization handling.

The handleRequest override correctly applies any pending initialization state before delegating to the base implementation. This ensures session state is restored on the first request in serverless cold start scenarios, while still handling the edge case where the transport might not be ready.

libs/sdk/src/transport/__tests__/transport.registry.test.ts (1)

637-1069: Excellent production scenario test coverage.

This comprehensive test suite covers critical real-world scenarios including:

  • Serverless cold starts with token validation
  • Multi-instance failover with session preservation
  • Security validations (token mismatches, client fingerprinting)
  • Error handling (Redis failures, timeouts, corrupt data)
  • Session and transport state preservation

The tests effectively validate the transport recreation mechanisms under production conditions and edge cases, ensuring robustness and reliability.

Based on learnings: Test coverage requirement of 95%+ across all metrics appears to be well-addressed by these additions.

libs/sdk/src/transport/adapters/__tests__/sse-transport.test.ts (1)

1-401: Outstanding test coverage for SSE transport recreation.

This test suite provides exceptional coverage of the RecreateableSSEServerTransport with 36 tests covering:

  • Constructor behavior with various options and edge cases
  • Event ID counter lifecycle with comprehensive validation (negative, NaN, Infinity, non-integers, overflow)
  • Session state restoration and mismatch handling
  • Event ID continuity across reconnections
  • Multi-instance failover scenarios
  • Security validations (negative IDs, prototype pollution attempts)

The tests follow best practices by testing all code paths including error cases and constructor validation, meeting the 95%+ coverage requirement.

Based on learnings: Test coverage meets requirements - all code paths tested including error cases and constructor validation.

libs/sdk/src/transport/adapters/__tests__/streamable-http-transport.test.ts (1)

1-383: Excellent test coverage for pending initialization mechanism.

This test suite provides comprehensive coverage of the RecreateableStreamableHTTPServerTransport with 34 tests, including:

  • Constructor behavior and initialization state
  • Pending state handling when internal transport is missing (critical for serverless cold starts)
  • Deferred initialization application via handleRequest override
  • Session recreation from stored state
  • Multi-instance failover scenarios
  • Edge cases (long IDs, unicode, special characters, idempotency)
  • Thorough input validation (empty, whitespace, null, undefined session IDs)

The tests effectively validate the new pending initialization mechanism, which is the core feature of this PR, ensuring it works correctly in serverless environments.

Based on learnings: Test coverage meets requirements - all code paths tested including error cases and constructor validation, achieving 95%+ coverage across all metrics.

apps/e2e/demo-e2e-transport-recreation/e2e/transport-recreation.e2e.test.ts (2)

88-109: Good validation coverage for increment-counter tool.

The input validation tests appropriately cover positive cases, negative values, zero values, and default behavior. This provides good confidence in the tool's parameter handling.


1-118: The @frontmcp/testing module already provides proper TypeScript types for all fixtures, matchers, and configuration options in strict mode with no any types. The matchers (toBeSuccessful, toHaveTextContent, toBeError, toContainTool) have correct MatcherFunction signatures, the mcp fixture is properly typed as McpTestClient, and TestConfig fully types all options. No changes are required.

apps/e2e/demo-e2e-transport-recreation/project.json (1)

6-6: Well-defined project tags for organization.

The tags ["scope:demo", "type:e2e", "feature:transport-recreation"] provide clear categorization for this e2e demo application, which will help with Nx task orchestration and project graph filtering.

@frontegg-david frontegg-david merged commit 79b490b into main Dec 30, 2025
20 of 22 checks passed
@frontegg-david frontegg-david deleted the add-coverage branch December 30, 2025 03:15
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