From 91e8a02a1225c786bd6001eae5cb7fd26e2c1ceb Mon Sep 17 00:00:00 2001 From: Ahmed Date: Wed, 27 May 2026 19:00:54 +0500 Subject: [PATCH 1/3] fix: align session and message API payloads with OpenCode schema --- nodes/LmChatOpenCode/OpenCodeChatModel.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nodes/LmChatOpenCode/OpenCodeChatModel.ts b/nodes/LmChatOpenCode/OpenCodeChatModel.ts index 68bafb8..d6529bd 100644 --- a/nodes/LmChatOpenCode/OpenCodeChatModel.ts +++ b/nodes/LmChatOpenCode/OpenCodeChatModel.ts @@ -159,7 +159,7 @@ export class OpenCodeChatModel extends BaseChatModel { agent: this.agent, model: { providerID: this.providerID, - modelID: this.modelID, + id: this.modelID, }, }), signal: controller.signal, @@ -247,10 +247,6 @@ export class OpenCodeChatModel extends BaseChatModel { // Build request body with optional parameters const body: Record = { parts, - model: { - providerID: this.providerID, - modelID: this.modelID, - }, agent: this.agent, }; From 8d0403e0088626c5afa9b6158469c8b2e93e51dc Mon Sep 17 00:00:00 2001 From: Ahmed Date: Wed, 27 May 2026 19:15:19 +0500 Subject: [PATCH 2/3] fix: update session payload test assertion to use id instead of modelID --- tests/OpenCodeChatModel.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/OpenCodeChatModel.test.ts b/tests/OpenCodeChatModel.test.ts index acbde7a..43f19e9 100644 --- a/tests/OpenCodeChatModel.test.ts +++ b/tests/OpenCodeChatModel.test.ts @@ -108,7 +108,7 @@ describe("OpenCodeChatModel", () => { agent: "build", model: { providerID: "anthropic", - modelID: "claude-3-5-sonnet-20241022", + id: "claude-3-5-sonnet-20241022", }, }), }), From 826d4206277267623ea4356f72d02b22dfa56b2a Mon Sep 17 00:00:00 2001 From: Ahmed Date: Wed, 27 May 2026 19:18:50 +0500 Subject: [PATCH 3/3] chore: add jest.config.js and unignore it in .gitignore --- .gitignore | 3 +++ jest.config.js | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 jest.config.js diff --git a/.gitignore b/.gitignore index fede83b..de7a47b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ dist/ # But keep these specific files !.eslintrc.js +!jest.config.js + # IDE .vscode/ @@ -44,3 +46,4 @@ temp/ # MCP servers .playwright-mcp/ + diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..0c4001f --- /dev/null +++ b/jest.config.js @@ -0,0 +1,5 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/tests/**/*.test.ts'], +}; \ No newline at end of file