Skip to content

Revert "use builtin vitest file snapshots for OpenAPI json file"#1813

Closed
robert-inkeep wants to merge 1 commit intomainfrom
revert-1801-use-builtin-vitest-snapshots-for-openapi
Closed

Revert "use builtin vitest file snapshots for OpenAPI json file"#1813
robert-inkeep wants to merge 1 commit intomainfrom
revert-1801-use-builtin-vitest-snapshots-for-openapi

Conversation

@robert-inkeep
Copy link
Collaborator

Reverts #1801

@vercel vercel bot temporarily deployed to Preview – agents-docs February 9, 2026 04:54 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

⚠️ No Changeset found

Latest commit: 5b373a4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 9, 2026

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

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 9, 2026 4:56am
agents-manage-ui Error Error Feb 9, 2026 4:56am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
agents-docs Skipped Skipped Feb 9, 2026 4:56am

Request Review

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

4 Key Findings | Risk: Medium

🟠⚠️ Major (4) 🟠⚠️

🟠 1) evaluateConversation.ts:11-12, runDatasetItem.ts:18-19, Agent.ts:44-45, ref.ts:14 Revert introduces import path changes that don't match pre-#1801 state

Issue: This revert changes several files from relative imports to src/ prefix style, but the original files (before PR #1801) used relative imports. This means the revert is not restoring the codebase to its pre-#1801 state — it's introducing new import style changes.

Why: A revert PR should restore the exact previous state. Introducing different import styles:

  1. Creates inconsistency within the same files (e.g., evaluateConversation.ts now has src/data/db on lines 11-12 but ../../../../data/db/runDbClient on line 13)
  2. Deviates from the established codebase convention (>95% of files use relative imports)
  3. The src/ prefix is NOT a TypeScript path alias — it only works via baseUrl: ".", making it less explicit

Fix: See inline comments with 1-click suggestions to restore the correct relative import paths.

Refs:

💭 Consider (2) 💭

💭 1) openapi.test.ts:27-140 Custom JSON diff implementation has no test coverage
Issue + Why: The custom diff logic (computeJsonDiff, formatDiffOutput, summarizeValue) provides better developer experience for OpenAPI changes than Vitest's built-in snapshots, but has no unit test coverage. If this logic has bugs, snapshot test failures could be misleading or miss real issues.
Suggestion: Consider adding unit tests for the diff utilities in a future PR. This is pre-existing code being restored, so not blocking for this revert.

💭 2) openapi.test.ts:262-268 Custom snapshot update mechanism differs from Vitest conventions
Issue + Why: The UPDATE_OPENAPI_SNAPSHOT=true environment variable approach differs from Vitest's standard -u flag. New contributors may try pnpm test -u and be confused when it doesn't update the snapshot.
Suggestion: Ensure this is documented in AGENTS.md or the package README.

📌 Inline Comments (4)

  • 🟠 evaluateConversation.ts:11-12 Import path style doesn't match pre-#1801 state
  • 🟠 runDatasetItem.ts:18-19 Import path style doesn't match pre-#1801 state
  • 🟠 Agent.ts:44-45 Import path style doesn't match pre-#1801 state
  • 🟠 ref.ts:14 Import path style doesn't match pre-#1801 state

💡 APPROVE WITH SUGGESTIONS

Summary: The OpenAPI test revert itself looks fine and restores the custom diff logic that provides better developer feedback for API contract changes. However, the revert is not clean — it introduces src/ prefix imports that didn't exist before PR #1801. I've provided 1-click fix suggestions in the inline comments. Once those imports are corrected to use relative paths (matching the pre-#1801 state), this should be good to merge.

Discarded (1)
Location Issue Reason Discarded
stream-helpers.test.ts:23-27 Mock type changed from Mock<...> to ReturnType<typeof vi.fn> Cosmetic TypeScript change with no behavioral impact
Reviewer Stats
Reviewer Returned Inline Comments Main Findings Pending Recs Discarded
pr-review-tests 3 0 0 0 1
pr-review-consistency 1 4 0 0 0
pr-review-standards 0 0 0 0 0
Total 4 4 0 0 1

Note: The 4 inline comments cover the same issue (import path inconsistency) across 4 files — they were consolidated from pr-review-consistency's multi-file finding.

Comment on lines +11 to +12
import { manageDbClient } from 'src/data/db';
import manageDbPool from 'src/data/db/manageDbPool';
Copy link
Contributor

Choose a reason for hiding this comment

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

MAJOR Import path style introduced by revert doesn't match pre-#1801 state

This file used relative imports (../../../../data/db) before PR #1801 was merged. The revert should restore those exact imports rather than introducing the src/ prefix style. Currently this creates inconsistency with line 13 which still uses relative imports.

Suggested change
import { manageDbClient } from 'src/data/db';
import manageDbPool from 'src/data/db/manageDbPool';
import { manageDbClient } from '../../../../data/db';
import manageDbPool from '../../../../data/db/manageDbPool';

Comment on lines +18 to +19
import { manageDbClient } from 'src/data/db';
import manageDbPool from 'src/data/db/manageDbPool';
Copy link
Contributor

Choose a reason for hiding this comment

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

MAJOR Import path style introduced by revert doesn't match pre-#1801 state

Same issue as evaluateConversation.ts — this file used relative imports before PR #1801. The revert should restore those exact imports.

Suggested change
import { manageDbClient } from 'src/data/db';
import manageDbPool from 'src/data/db/manageDbPool';
import { manageDbClient } from '../../../../data/db';
import manageDbPool from '../../../../data/db/manageDbPool';

Comment on lines +44 to +45
import manageDbPool from 'src/data/db/manageDbPool';
import { env } from 'src/env';
Copy link
Contributor

Choose a reason for hiding this comment

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

MAJOR Import path style introduced by revert doesn't match pre-#1801 state

Agent.ts used relative imports (../../../data/db/manageDbPool and ../../../env) before PR #1801. The revert introduces src/ prefix style which creates inconsistency with line 46.

Suggested change
import manageDbPool from 'src/data/db/manageDbPool';
import { env } from 'src/env';
import manageDbPool from '../../../data/db/manageDbPool';
import { env } from '../../../env';

} from '@inkeep/agents-core';
import type { Context, Next } from 'hono';
import { manageDbClient } from '../data/db';
import { manageDbClient } from 'src/data/db';
Copy link
Contributor

Choose a reason for hiding this comment

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

MAJOR Import path style introduced by revert doesn't match pre-#1801 state

ref.ts used the relative import ../data/db before PR #1801.

Suggested change
import { manageDbClient } from 'src/data/db';
import { manageDbClient } from '../data/db';

@github-actions github-actions bot deleted a comment from claude bot Feb 9, 2026
@robert-inkeep robert-inkeep deleted the revert-1801-use-builtin-vitest-snapshots-for-openapi branch February 9, 2026 05:57
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.

1 participant