fix: Fix MCP output parsing to conform to new output schema format for service actions#706
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: d6f1830 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds test helpers and logging utilities, a TSX-based test worker loader, conditional worker script selection, a schema-parse simplification, MCP server integration test, changeset entries, and small workspace/package configuration updates. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Files:
🧠 Learnings (5)📓 Common learnings📚 Learning: 2025-11-24T19:45:01.582ZApplied to files:
📚 Learning: 2025-06-03T09:11:29.651ZApplied to files:
📚 Learning: 2025-08-17T01:32:58.983ZApplied to files:
📚 Learning: 2025-11-24T19:45:01.582ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/project-builder-server/src/actions/utils/run-in-worker.ts (1)
37-41: Consider potential sensitive data in input logging.The new logging improves observability by capturing when actions start execution. However, the
inputparameter may contain sensitive data (PII, credentials, API keys) depending on the action being executed.Consider either:
- Using
logger.debug()instead oflogger.info()for input data- Implementing input sanitization before logging
- Adding a note in documentation about configuring log levels appropriately in production
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
.changeset/five-poems-enjoy.md(1 hunks).changeset/soft-pets-swim.md(1 hunks)packages/project-builder-server/package.json(1 hunks)packages/project-builder-server/src/actions/utils/run-in-worker.ts(2 hunks)packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts(1 hunks)packages/project-builder-server/src/actions/utils/worker-script.ts(1 hunks)packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts(1 hunks)packages/sync/src/tests/logger.test-utils.ts(3 hunks)pnpm-workspace.yaml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Add a new Changeset in the
.changeset/directory for new features or changes, with format'package-name': patchand description of the feature or change
Files:
.changeset/soft-pets-swim.md.changeset/five-poems-enjoy.md
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/is the alias forsrc/)
If a particular interface or type is not exported, change the file so it is exported
If caught on a typing loop where forcing theanytype is necessary, do not iterate too much - leave the typing as broken and let the user fix itIf target code is not easily testable, refactor it to be more testable (e.g., export types or functions)
**/*.{ts,tsx}: Import components from '@baseplate-dev/ui-components' package for UI development (e.g., Button, Input, Card, Dialog, etc.)
Use form components with React Hook Form controller variants (InputField, TextareaField, SelectField, CheckboxField, SwitchField, ComboboxField, MultiComboboxField, ColorPickerField, DatePickerField, DateTimePickerField)
Use SidebarLayout, Card, Breadcrumb, NavigationMenu, and NavigationTabs components for consistent layout structure from @baseplate-dev/ui-components
Use Dialog, ConfirmDialog, and useConfirmDialog from @baseplate-dev/ui-components for modal dialogs and confirmation interactions
Always usecompareStringsfrom@baseplate-dev/utilsinstead ofString.prototype.localeCompare()for code generation, file sorting, and internal data structures
If a particular interface or type is not exported, modify the file to export it
Use TsCodeFragment for composable code pieces and TsCodeUtils for manipulating fragments when generating TypeScript code
Create generators usingcreateGeneratorwith configuration via descriptor schema (Zod), organizing into one or more tasks created withcreateGeneratorTask
Tasks should haverun(initialization) andbuild(code generation) phases, export and consume providers, and may be organized into phases for ordered execution
Use provider scopes to control visibility and prevent collisions be...
Files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.tspackages/project-builder-server/src/actions/utils/worker-script.test-helper.tspackages/project-builder-server/src/actions/utils/worker-script.tspackages/project-builder-server/src/actions/utils/run-in-worker.tspackages/sync/src/tests/logger.test-utils.ts
**/*.{unit.test.ts,int.test.ts}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{unit.test.ts,int.test.ts}: Unit tests must use.unit.test.tssuffix, integration tests must use.int.test.tssuffix
Always import vitest globals explicitly (describe, it, expect)
Files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx,js}: Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
Prefer using nullish coalescing operator (??) instead of logical or (||), enforced via ESLint rule
Prefer barrel exports e.g.export * from './foo.js'instead of individual named exports
Use console.info/warn/error instead of console.log
Files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.tspackages/project-builder-server/src/actions/utils/worker-script.test-helper.tspackages/project-builder-server/src/actions/utils/worker-script.tspackages/project-builder-server/src/actions/utils/run-in-worker.tspackages/sync/src/tests/logger.test-utils.ts
**/*.{unit,int}.test.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
**/*.{unit,int}.test.{ts,tsx}: Use descriptive test names that explain what is being tested
Structure tests with Arrange-Act-Assert: clear setup, execution, and verification phases
Always mock external API calls and file system operations
Each test should be independent and not rely on other tests
Leverage TypeScript for type-safe mocking in tests
Focus on testing public methods and behaviors, not implementation details
Each test should verify one specific behavior
Extract repeated logic into helper functions to reduce duplication
Test broad behavior and common edge cases intelligently to avoid slowing down CI with excessive tests
For file system operations in tests, use memfs and mocknode:fsandnode:fs/promises
When using globby with mocked fs, pass the mocked fs adapter to the globby call
Files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts
**/*.int.test.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
Integration tests use
.int.test.tssuffix
Files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts
**/*.test-helper.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
Extract common setup code into test helpers in
*.test-helper.tsfiles
Files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
🧠 Learnings (28)
📓 Common learnings
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Test broad behavior and common edge cases intelligently to avoid slowing down CI with excessive tests
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Extract repeated logic into helper functions to reduce duplication
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.test-helper.{ts,tsx} : Extract common setup code into test helpers in `*.test-helper.ts` files
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-11-24T19:45:27.654Z
Learning: Applies to +(*.tsx|packages/project-builder-web/**/*.tsx|packages/ui-components/**/*.tsx) : Use ShadCN-based components from `baseplate-dev/ui-components` instead of creating custom components
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.int.test.{ts,tsx} : Integration tests use `.int.test.ts` suffix
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.int.test.{ts,tsx} : Integration tests use `.int.test.ts` suffix
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Leverage TypeScript for type-safe mocking in tests
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In the project-builder-server test suite, Vitest automocks for 'node:fs' and 'node:fs/promises' are already configured to use memfs without needing explicit implementation replacement in each test file.
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.unit.test.{ts,tsx} : Unit tests are colocated with source files using `.unit.test.ts` suffix
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.unit.test.{ts,tsx} : Unit tests are colocated with source files using `.unit.test.ts` suffix
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to .changeset/*.md : Add a new Changeset in the `.changeset/` directory for new features or changes, with format `'package-name': patch` and description of the feature or change
Applied to files:
.changeset/soft-pets-swim.md.changeset/five-poems-enjoy.md
📚 Learning: 2025-05-08T12:56:11.723Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:70-79
Timestamp: 2025-05-08T12:56:11.723Z
Learning: In the check-changesets.ts script for monorepo validation, `npm pack ${pkg.name}latest` is intentionally used to pack the most recently published version (not local changes) for comparison purposes to determine if changes require new changesets.
Applied to files:
pnpm-workspace.yaml
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Leverage TypeScript for type-safe mocking in tests
Applied to files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.tspackages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In the project-builder-server test suite, Vitest automocks for 'node:fs' and 'node:fs/promises' are already configured to use memfs without needing explicit implementation replacement in each test file.
Applied to files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.int.test.{ts,tsx} : Integration tests use `.int.test.ts` suffix
Applied to files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{unit.test.ts,int.test.ts} : Unit tests must use `.unit.test.ts` suffix, integration tests must use `.int.test.ts` suffix
Applied to files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Always mock external API calls and file system operations
Applied to files:
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.test-helper.{ts,tsx} : Extract common setup code into test helpers in `*.test-helper.ts` files
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to src/tests/**/*.{ts,tsx} : Test helpers are located in `src/tests/` directory
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Extract repeated logic into helper functions to reduce duplication
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Import test functions explicitly from 'vitest' instead of using globals. Example: `import { describe, expect, it } from 'vitest';`
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.tspackages/project-builder-server/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Tasks should have `run` (initialization) and `build` (code generation) phases, export and consume providers, and may be organized into phases for ordered execution
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Use Dynamic Tasks for data-driven generation where code generation is driven by data
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.test.ts : Import test functions explicitly from 'vitest' instead of relying on globals (e.g., `import { describe, expect, it } from 'vitest';`)
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.tspackages/project-builder-server/package.json
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Test broad behavior and common edge cases intelligently to avoid slowing down CI with excessive tests
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
📚 Learning: 2025-08-17T01:32:58.983Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 633
File: packages/project-builder-web/src/routes/admin-sections.$appKey/-components/columns/column-configs.ts:1-2
Timestamp: 2025-08-17T01:32:58.983Z
Learning: The project-builder-web package doesn't use ESM (ECMAScript modules), so .js extensions are not required in import statements, unlike other packages in the codebase that do use Node 16 ESM resolution.
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-06-03T09:11:29.651Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.651Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Run `pnpm lint:affected` and `pnpm typecheck` before committing changes
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-11-24T19:45:27.654Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-11-24T19:45:27.654Z
Learning: Applies to +(*.tsx|packages/project-builder-web/**/*.tsx|packages/ui-components/**/*.tsx) : Use ShadCN-based components from `baseplate-dev/ui-components` instead of creating custom components
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx,js,jsx} : Follow ESM module resolution with TypeScript's `NodeNext` setting
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{unit.test.ts,int.test.ts} : Always import vitest globals explicitly (describe, it, expect)
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.test.{ts,tsx} : For file system operations in tests, use memfs and mock 'node:fs' and 'node:fs/promises' with vi.mock
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Use ESM-only module system (`"type": "module"` in package.json)
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx,js} : Node 16 module resolution - include file extensions in imports (`.js`)
Applied to files:
packages/project-builder-server/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Create generators using `createGenerator` with configuration via descriptor schema (Zod), organizing into one or more tasks created with `createGeneratorTask`
Applied to files:
packages/project-builder-server/src/actions/utils/worker-script.ts
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx,js} : Use console.info/warn/error instead of console.log
Applied to files:
packages/sync/src/tests/logger.test-utils.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Focus on testing public methods and behaviors, not implementation details
Applied to files:
packages/sync/src/tests/logger.test-utils.ts
🧬 Code graph analysis (2)
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts (4)
packages/project-builder-server/src/actions/types.ts (1)
ServiceActionContext(15-26)packages/sync/src/tests/logger.test-utils.ts (1)
createConsoleLogger(65-88)packages/project-builder-server/src/dev-server/mcp/server.ts (1)
createMcpServer(42-178)packages/project-builder-server/src/actions/registry.ts (1)
ALL_SERVICE_ACTIONS(23-40)
packages/project-builder-server/src/actions/utils/run-in-worker.ts (1)
packages/project-builder-server/src/actions/utils/worker-script.ts (1)
WorkerData(8-12)
⏰ 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). (5)
- GitHub Check: Verify Sync (todo-with-auth0)
- GitHub Check: Verify Sync (blog-with-auth)
- GitHub Check: test
- GitHub Check: Test E2E
- GitHub Check: Lint
🔇 Additional comments (12)
packages/project-builder-server/package.json (1)
92-92: LGTM! TSX devDependency supports the new test helper.The addition of
tsxas a devDependency is appropriate for enabling the TSX runtime in tests via the newworker-script.test-helper.tsfile.pnpm-workspace.yaml (1)
36-40: LGTM! Cosmetic key reordering with no functional impact.The reordering of workspace configuration keys (
minimumReleaseAge,publishBranch,saveWorkspaceProtocol) has no effect on functionality..changeset/five-poems-enjoy.md (1)
1-5: LGTM! Changeset correctly documents the test helper addition.The changeset follows the expected format and accurately describes the addition of the
createConsoleLoggertest helper..changeset/soft-pets-swim.md (1)
1-5: LGTM! Changeset correctly documents the MCP output parsing fix.The changeset follows the expected format and accurately describes the fix to MCP output parsing for service actions.
packages/project-builder-server/src/dev-server/mcp/mcp-server.int.test.ts (1)
1-68: LGTM! Well-structured integration test for MCP server.The integration test properly:
- Uses
.int.test.tssuffix (as per guidelines)- Imports vitest globals explicitly
- Includes proper cleanup in
afterEach- Tests the MCP server end-to-end with in-memory transport
- Validates the
discover-generatorstool response structure, confirming the output parsing fix works correctlypackages/sync/src/tests/logger.test-utils.ts (4)
1-1: LGTM! Import additions support the new console logger API.The import of
LoggerandLogLeveltypes from the evented logger enables proper typing for the newcreateConsoleLoggerfunction.
5-7: LGTM! TestLogger interface consistently extended.The addition of
getWarnOutput()andgetInfoOutput()methods completes the interface symmetrically across all log levels.
10-27: LGTM! Good refactoring to extract formatMessage.Extracting
formatMessageas a top-level function promotes reusability and reduces duplication betweencreateTestLoggerandcreateConsoleLogger.
54-88: LGTM! Console logger implementation follows best practices.The
createConsoleLoggerfunction:
- Uses
console.error/warn/info/debuginstead ofconsole.log(as per guidelines)- Implements proper log level filtering via
shouldLog- Reuses the extracted
formatMessagehelper- Provides a clean API for test environments
packages/project-builder-server/src/actions/utils/worker-script.ts (1)
82-82: LGTM! Critical fix for MCP output schema validation.The change from
z.object(action.outputSchema).parse(result)toaction.outputSchema.parse(result)is correct. The previous code incorrectly wrapped an already-complete Zod schema withz.object(), which created an invalid schema structure. The new code properly uses the schema directly, conforming to the expected Zod 4 API and fixing the MCP output parsing issue described in the PR.packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts (1)
1-5: LGTM! Clean test helper for TSX runtime registration.This test helper:
- Properly registers the TSX ESM loader via
register()- Dynamically imports the worker script to enable test-time execution
- Follows the test helper pattern (as per guidelines)
- Works in conjunction with the environment-based worker script path selection in
run-in-worker.tspackages/project-builder-server/src/actions/utils/run-in-worker.ts (1)
43-49: LGTM!Clean refactor that replaces the hardcoded path with the environment-aware constant. The
satisfies WorkerDataensures type safety for the worker data structure.
| const WORKER_SCRIPT_PATH = path.join( | ||
| import.meta.dirname, | ||
| process.env.NODE_ENV === 'test' | ||
| ? 'worker-script.test-helper.ts' | ||
| : 'worker-script.js', | ||
| ); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
echo "=== Checking for worker script files ==="
fd -t f "worker-script" packages/project-builder-server/src/actions/utils/
echo ""
echo "=== Checking for tsx in package.json ==="
if [ -f packages/project-builder-server/package.json ]; then
jq '.devDependencies.tsx // .dependencies.tsx' packages/project-builder-server/package.json
else
echo "package.json not found"
fi
echo ""
echo "=== Looking for integration tests using runActionInWorker ==="
rg -l "runActionInWorker" --type ts -g "*.int.test.ts" packages/project-builder-server/
echo ""
echo "=== Checking for NODE_OPTIONS or vitest configuration ==="
fd -t f "vitest.config" packages/project-builder-server/
fd -t f ".env*" packages/project-builder-server/ | head -10
echo ""
echo "=== Checking the run-in-worker.ts file ==="
fd -t f "run-in-worker.ts" packages/project-builder-server/ && wc -l packages/project-builder-server/src/actions/utils/run-in-worker.tsRepository: halfdomelabs/baseplate
Length of output: 1394
🏁 Script executed:
#!/bin/bash
echo "=== Reading vitest.config.js ==="
cat packages/project-builder-server/vitest.config.js
echo ""
echo "=== Reading worker-script.test-helper.ts ==="
cat packages/project-builder-server/src/actions/utils/worker-script.test-helper.ts
echo ""
echo "=== Searching for any .int.test.ts files in the project ==="
fd -e "int.test.ts" packages/project-builder-server/
echo ""
echo "=== Checking root package.json for tsx ==="
cat package.json | jq '.devDependencies.tsx // .dependencies.tsx // "not found"'Repository: halfdomelabs/baseplate
Length of output: 938
🏁 Script executed:
#!/bin/bash
echo "=== Reading run-in-worker.ts (relevant sections) ==="
head -50 packages/project-builder-server/src/actions/utils/run-in-worker.ts
echo ""
echo "=== Checking for worker-script.js (compiled version) ==="
fd "worker-script.js" packages/project-builder-server/
echo ""
echo "=== Looking at the action execution logging (lines 37-49) ==="
sed -n '37,49p' packages/project-builder-server/src/actions/utils/run-in-worker.ts
echo ""
echo "=== Checking what data is passed to workers ==="
grep -A 5 -B 5 "workerData" packages/project-builder-server/src/actions/utils/run-in-worker.ts | head -30Repository: halfdomelabs/baseplate
Length of output: 2421
Input logging exposes potentially sensitive data in action arguments.
The dynamic path selection (test helper .ts for test environment, compiled .js for production) is properly configured using tsx/esm/api register() for TypeScript support in worker threads. However, line 41 logs the full input object, which may contain sensitive information like API keys, credentials, or user data.
Consider sanitizing or excluding sensitive fields before logging, or log only non-sensitive metadata like input size/structure rather than values.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.