From e3147390ad09c31218a5d9fb0e8577acba058ff4 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 13:17:50 +0000 Subject: [PATCH 1/3] fix: URL-encode function name in fetchFunctionLogs API call Functions with slashes in their names (zero-config functions like stam/foo from functions/stam/foo/entry.ts) were causing 404 errors because the slash was interpreted as a path separator. Co-authored-by: Kfir Stri --- packages/cli/src/core/resources/function/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/core/resources/function/api.ts b/packages/cli/src/core/resources/function/api.ts index dfa04030..5d181b86 100644 --- a/packages/cli/src/core/resources/function/api.ts +++ b/packages/cli/src/core/resources/function/api.ts @@ -112,7 +112,7 @@ export async function fetchFunctionLogs( let response: KyResponse; try { - response = await appClient.get(`functions-mgmt/${functionName}/logs`, { + response = await appClient.get(`functions-mgmt/${encodeURIComponent(functionName)}/logs`, { searchParams, }); } catch (error) { From 936193ada888d343ce425a8e06725dd8b5d951f2 Mon Sep 17 00:00:00 2001 From: Kfir Strikovsky Date: Thu, 19 Mar 2026 15:42:40 +0200 Subject: [PATCH 2/3] lint --- packages/cli/src/core/resources/function/api.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/core/resources/function/api.ts b/packages/cli/src/core/resources/function/api.ts index 5d181b86..723f04d9 100644 --- a/packages/cli/src/core/resources/function/api.ts +++ b/packages/cli/src/core/resources/function/api.ts @@ -112,9 +112,12 @@ export async function fetchFunctionLogs( let response: KyResponse; try { - response = await appClient.get(`functions-mgmt/${encodeURIComponent(functionName)}/logs`, { - searchParams, - }); + response = await appClient.get( + `functions-mgmt/${encodeURIComponent(functionName)}/logs`, + { + searchParams, + }, + ); } catch (error) { throw await ApiError.fromHttpError( error, From 1f7171307e52c735733b857e447ba96e94407ac3 Mon Sep 17 00:00:00 2001 From: Kfir Strikovsky Date: Thu, 19 Mar 2026 15:50:15 +0200 Subject: [PATCH 3/3] fix test server --- packages/cli/tests/cli/testkit/TestAPIServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/tests/cli/testkit/TestAPIServer.ts b/packages/cli/tests/cli/testkit/TestAPIServer.ts index efdf4665..2cabf4f7 100644 --- a/packages/cli/tests/cli/testkit/TestAPIServer.ts +++ b/packages/cli/tests/cli/testkit/TestAPIServer.ts @@ -496,7 +496,7 @@ export class TestAPIServer { mockFunctionLogs(functionName: string, response: FunctionLogsResponse): this { return this.addRoute( "GET", - `/api/apps/${this.appId}/functions-mgmt/${functionName}/logs`, + `/api/apps/${this.appId}/functions-mgmt/${encodeURIComponent(functionName)}/logs`, response, ); } @@ -632,7 +632,7 @@ export class TestAPIServer { mockFunctionLogsError(functionName: string, error: ErrorResponse): this { return this.addErrorRoute( "GET", - `/api/apps/${this.appId}/functions-mgmt/${functionName}/logs`, + `/api/apps/${this.appId}/functions-mgmt/${encodeURIComponent(functionName)}/logs`, error, ); }