codex-review-mcp 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -138,10 +138,12 @@ process.on('uncaughtException', (error) => {
138
138
  console.error(`[codex-review-mcp] Server will continue running, but this indicates a serious bug.`);
139
139
  // Don't exit - let the server continue running
140
140
  });
141
- // Log startup information
141
+ // Log startup information with environment diagnostics
142
142
  console.error(`[codex-review-mcp v${VERSION}] Starting server...`);
143
143
  console.error(`[codex-review-mcp] Node version: ${process.version}`);
144
144
  console.error(`[codex-review-mcp] Platform: ${process.platform}`);
145
+ console.error(`[codex-review-mcp] CWD: ${process.cwd()}`);
146
+ console.error(`[codex-review-mcp] OPENAI_API_KEY: ${process.env.OPENAI_API_KEY ? '✓ Set' : '✗ MISSING'}`);
145
147
  const transport = new StdioServerTransport();
146
148
  await server.connect(transport);
147
149
  console.error(`[codex-review-mcp v${VERSION}] ✅ Server started successfully`);
@@ -1,10 +1,13 @@
1
- export function formatOutput(agentMarkdown) {
1
+ export function formatOutput(agentMarkdown, version) {
2
2
  // For MVP, trust agent output if non-empty; otherwise return a minimal stub.
3
- if (agentMarkdown && agentMarkdown.trim().length > 0)
4
- return agentMarkdown;
3
+ const versionFooter = version ? `\n\n---\n*Generated by codex-review-mcp v${version}*` : '';
4
+ if (agentMarkdown && agentMarkdown.trim().length > 0) {
5
+ return agentMarkdown + versionFooter;
6
+ }
5
7
  return [
6
8
  '# Code Review',
7
9
  '',
8
10
  'No issues detected or empty output from agent.',
11
+ versionFooter,
9
12
  ].join('\n');
10
13
  }
@@ -2,10 +2,18 @@ import { describe, it, expect } from 'vitest';
2
2
  import { formatOutput } from './formatOutput.js';
3
3
  describe('formatOutput', () => {
4
4
  describe('Valid Agent Output', () => {
5
- it('should return agent markdown as-is when valid', () => {
5
+ it('should return agent markdown without version when version not provided', () => {
6
6
  const agentOutput = '# Code Review\n\n## Issues\n\n- Issue 1\n- Issue 2';
7
7
  const result = formatOutput(agentOutput);
8
8
  expect(result).toBe(agentOutput);
9
+ expect(result).not.toContain('Generated by codex-review-mcp');
10
+ });
11
+ it('should append version footer when version is provided', () => {
12
+ const agentOutput = '# Code Review\n\n## Issues\n\n- Issue 1';
13
+ const result = formatOutput(agentOutput, '2.3.0');
14
+ expect(result).toContain(agentOutput);
15
+ expect(result).toContain('---');
16
+ expect(result).toContain('*Generated by codex-review-mcp v2.3.0*');
9
17
  });
10
18
  it('should preserve formatting and special characters', () => {
11
19
  const agentOutput = `# Review
@@ -58,6 +66,12 @@ function fix() {
58
66
  expect(result).toContain('# Code Review');
59
67
  expect(result).toContain('No issues detected or empty output from agent');
60
68
  });
69
+ it('should include version in fallback message when provided', () => {
70
+ const result = formatOutput('', '2.3.0');
71
+ expect(result).toContain('# Code Review');
72
+ expect(result).toContain('No issues detected or empty output from agent');
73
+ expect(result).toContain('*Generated by codex-review-mcp v2.3.0*');
74
+ });
61
75
  it('should return fallback message when output is only whitespace', () => {
62
76
  const result = formatOutput(' \n\n \t ');
63
77
  expect(result).toContain('# Code Review');
@@ -59,7 +59,7 @@ export async function performCodeReview(input, onProgress) {
59
59
  await debugLog(`Review produced ${agentMd.length} chars`);
60
60
  // Format output
61
61
  await onProgress?.('Formatting output…', 90, 100);
62
- const out = formatOutput(agentMd);
62
+ const out = formatOutput(agentMd, VERSION);
63
63
  await onProgress?.('Done', 100, 100);
64
64
  return out;
65
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-review-mcp",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",