Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Conversation

mongodben
Copy link
Collaborator

@mongodben mongodben commented Sep 2, 2025

Jira: n/a

Changes

  • Fix cascade of build issues.
  • There were some unused deps that resulted in more issues, so removed them. Namely with langchain.
    • removing langchain updated the version of the openai SDK imported, which required some TS changes to it
  • Quite a few other mysterious TS issues in the test suites, which were patched
  • Additional annotations on the PR regarding the changes

Notes

  • I am frankly unclear of what exactly was going on. One thing seemed to lead to or reveal another

- npm ci
- npm run build
- npm run lint
# - npm run lint
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see https://jira.mongodb.org/browse/EAI-1290

i think that linting wasnt working properly before. and the error surfaced now

}

const toolCall = (outputMessage as AssistantMessage).toolCall;
if (!toolCall || toolCall.type !== "function") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

new version of openai package requires this

req.params = baseReq.params;
req.query = baseReq.query;
req.headers = baseReq.headers;
(req.headers as any) = baseReq.headers;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idk why, but w/ other updates, had to do this casting

content_index: 0,
output_index: 0,
item_id: itemId,
logprobs: [],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also part of openai package update

// silence logger for tests
logger.transports.forEach((t) => (t.silent = true));

// Mock autoevals to avoid ESM parsing issues
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed ESM issue w/ running tests. issue was a bit spooky, but this fix is fine

To learn more, see Authenticate Data API
Requests.
servers:`;
description:`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idk why this one broke, but fine now when shorted expected string.

// silence logger for tests
logger.transports.forEach((t) => (t.silent = true));

// Polyfill File API for Node.js environment if not available
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

another spooky issue. hat tip to claude for patching.


const ratingSchema = z
.int()
.number()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this issue had to do w/ zod versions. should be fine i think

temperature: 0,
model,
schema: promptResponseRatingSchema,
schema: promptResponseRatingSchema as any,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this bit janky but got things working. also def related to zod versions

"@babel/preset-typescript": "^7.22.5",
"@langchain/anthropic": "^0.2.3",
"@langchain/openai": "^0.2.1",
"@types/common-tags": "^1.8.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remove unused deps that caused some build errs

Comment on lines +88 to 99
"@lg-chat/avatar": "^7.0.0",
"@lg-chat/chat-disclaimer": "^4.0.7",
"@lg-chat/chat-window": "^4.1.2",
"@lg-chat/fixed-chat-window": "^4.0.4",
"@lg-chat/input-bar": "^10.0.2",
"@lg-chat/leafygreen-chat-provider": "5.0.0",
"@lg-chat/message": "^8.0.0",
"@lg-chat/message-feed": "^7.0.0",
"@lg-chat/message-feedback": "^7.0.0",
"@lg-chat/message-prompts": "^4.0.3",
"@lg-chat/message-rating": "^4.0.3",
"@lg-chat/message-rating": "^5.0.0",
"@lg-chat/rich-links": "^3.1.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

upgrade LG versions fixing dep issues

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remove unused deps that were causing peer dep issues

class. It extends the AsyncCallerParams interface and adds additional
properties specific to the GitHub repository loader.
*/
export interface GithubRepoLoaderParams {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pull in type locally to avoid requiring the type from package causing issues

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unused. can delete.

had deps causing issues

@@ -1,5 +1,5 @@
import { jest } from "@jest/globals";
import { MongoClient, ObjectId } from "mongodb-rag-core/mongodb";
import { MongoClient, ObjectId } from "mongodb";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

importing from self was causing issues. deleted

date: date,
decimal: new BSON.Decimal128("123.456"),
binary: new BSON.Binary(Buffer.from("test")),
binary: new BSON.Binary(new Uint8Array(Buffer.from("test"))),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was giving TS err. works now

const csvEntries = (await csv
.parse(source, { columns: true })
.toArray()) as CsvEntry[];
const csvEntries = await new Promise<CsvEntry[]>((resolve, reject) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idk why this was causing TS issue but it was

@mongodben mongodben changed the title all builds Fix build issue cascade Sep 2, 2025
@mongodben mongodben marked this pull request as ready for review September 2, 2025 17:31
@nlarew nlarew merged commit d670e4b into main Sep 2, 2025
2 checks passed
@nlarew nlarew deleted the package_fixes_v2 branch September 2, 2025 18:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants