From 12e4c2b5429ff975118cd4efd3485fee56ba37ed Mon Sep 17 00:00:00 2001 From: Jon B Date: Tue, 24 Feb 2026 18:44:41 -0600 Subject: [PATCH] fix: type compatibility for dependency upgrades and automerge PAT - GitHttpClient: cast Uint8Array[] to BlobPart[] for stricter TS types - openai-helpers: guard toolCall.type before accessing .function (OpenAI v6) - automerge: use CI_GITHUB_TOKEN for merge step so downstream workflows trigger Co-Authored-By: Claude Opus 4.6 --- .github/workflows/automerge.yml | 2 +- src/core/git/GitHttpClient.ts | 2 +- src/services/ai/openai-helpers.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 1e7dff54..ee835f6f 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -26,6 +26,6 @@ jobs: - name: Enable automerge env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} PR_URL: ${{ github.event.pull_request.html_url }} run: gh pr merge "$PR_URL" --auto --squash diff --git a/src/core/git/GitHttpClient.ts b/src/core/git/GitHttpClient.ts index 9ffe387c..c0f29cd2 100644 --- a/src/core/git/GitHttpClient.ts +++ b/src/core/git/GitHttpClient.ts @@ -43,7 +43,7 @@ export const gitHttpClient = { const res = await secureFetch(url, { method, headers, - body: body ? new Blob(body) : undefined, + body: body ? new Blob(body as BlobPart[]) : undefined, }); const responseHeaders: Record = {}; diff --git a/src/services/ai/openai-helpers.ts b/src/services/ai/openai-helpers.ts index 1afcbff2..90c3919c 100644 --- a/src/services/ai/openai-helpers.ts +++ b/src/services/ai/openai-helpers.ts @@ -95,6 +95,8 @@ export function parseOpenAIContent( if (message.tool_calls) { for (const toolCall of message.tool_calls) { + if (toolCall.type !== 'function') continue; + let parsedInput: Record = {}; try { parsedInput = JSON.parse(toolCall.function.arguments);