From 2534db3febd9097862450a53ca441be22279654d Mon Sep 17 00:00:00 2001 From: Ben Bachem <10088265+bezbac@users.noreply.github.com> Date: Fri, 18 Sep 2026 10:58:01 +0200 Subject: [PATCH] Fix formatting and linting issues --- package.json | 5 +++++ src/runtime.ts | 2 +- src/v2.ts | 2 +- test/integration/v2.test.ts | 26 +++++++++++++++----------- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index e70aaa2..2fa2812 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,11 @@ "lint": "eslint .", "test:integration": "pnpm run build && tsc --noEmit -p tsconfig.test.json && vitest run test/integration" }, + "knip": { + "ignore": [ + "dist/**" + ] + }, "dependencies": { "@langfuse/otel": "^5.10.1", "@opentelemetry/api": "^1.9.1", diff --git a/src/runtime.ts b/src/runtime.ts index aa98d37..dde4670 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -17,7 +17,7 @@ const LangfuseCredentialsSchema = Schema.Struct({ type LangfuseCredentials = typeof LangfuseCredentialsSchema.Type; -export class MissingLangfuseCredentials extends Data.TaggedError( +class MissingLangfuseCredentials extends Data.TaggedError( "MissingLangfuseCredentials", )<{ readonly message: string }> {} diff --git a/src/v2.ts b/src/v2.ts index bd26c69..b7ede1f 100644 --- a/src/v2.ts +++ b/src/v2.ts @@ -76,7 +76,7 @@ const LangfusePlugin = { generationDetails.get(input.messageID)?.toolCalls.set(input.id, { id: input.id, name: input.tool, - arguments: JSON.stringify(input.input) ?? "null", + arguments: JSON.stringify(input.input), }); langfuse.rememberToolCall({ callID: input.id, diff --git a/test/integration/v2.test.ts b/test/integration/v2.test.ts index 7333bde..e60f68c 100644 --- a/test/integration/v2.test.ts +++ b/test/integration/v2.test.ts @@ -210,16 +210,20 @@ describe("OpenCode 2 package entrypoint", () => { )(contextInput); const cleanup = await SourcePlugin.setup(context); - await vi.waitFor(() => expect(prompt).toBeTypeOf("function")); + await vi.waitFor(() => { + expect(prompt).toBeTypeOf("function"); + }); prompt?.({ sessionID: "session-1", messageID: "user-1", prompt: { text: "Say hello" }, }); - await vi.waitFor(() => expect(executeBefore).toBeTypeOf("function")); - await vi.waitFor(() => - expect(runtime.startActiveGenerationStep).toHaveBeenCalled(), - ); + await vi.waitFor(() => { + expect(executeBefore).toBeTypeOf("function"); + }); + await vi.waitFor(() => { + expect(runtime.startActiveGenerationStep).toHaveBeenCalled(); + }); executeBefore?.({ id: "call-1", messageID: "assistant-1", @@ -229,14 +233,14 @@ describe("OpenCode 2 package entrypoint", () => { }); releaseStep?.(); - await vi.waitFor(() => + await vi.waitFor(() => { expect(runtime.traceUserPrompt).toHaveBeenCalledWith({ sessionID: "session-1", messageID: "user-1", content: [{ type: "text", text: "Say hello" }], - }), - ); - await vi.waitFor(() => + }); + }); + await vi.waitFor(() => { expect(runtime.traceGeneration).toHaveBeenCalledWith( expect.objectContaining({ parentID: "user-1", @@ -254,8 +258,8 @@ describe("OpenCode 2 package entrypoint", () => { }), ], }), - ), - ); + ); + }); await cleanup?.(); }); });