Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: fix automation updates (#8108)

Max Deichmann258dde469146
diff --git a/.devcontainer.json b/.devcontainer.json
index e0266f743d..224b42cddb 100644
--- a/.devcontainer.json
+++ b/.devcontainer.json
@@ -1,6 +1,6 @@
{
- "name": "langfuse-development",
- "forwardPorts": [3000, 5432, 6379, 8123, 9000],
- "onCreateCommand": "npm install -g [email protected]",
- "postCreateCommand": "curl -L https://github.com/golang-migrate/migrate/releases/download/v4.18.3/migrate.linux-amd64.tar.gz | tar xvz && git restore LICENSE README.md && chmod +x migrate && sudo mv migrate /usr/bin && cp .env.dev.example .env && npm install -g @anthropic-ai/claude-code && pnpm i"
+ "name": "langfuse-development",
+ "forwardPorts": [3000, 5432, 6379, 8123, 9000],
+ "onCreateCommand": "npm install -g [email protected]",
+ "postCreateCommand": "curl -L https://github.com/golang-migrate/migrate/releases/download/v4.18.3/migrate.linux-amd64.tar.gz | tar xvz && git restore LICENSE README.md && chmod +x migrate && sudo mv migrate /usr/bin && cp .env.dev.example .env && npm install -g @anthropic-ai/claude-code && pnpm i"
}
diff --git a/packages/shared/src/server/repositories/automation-repository.ts b/packages/shared/src/server/repositories/automation-repository.ts
index d2e375cd9c..0468c82a5f 100644
--- a/packages/shared/src/server/repositories/automation-repository.ts
+++ b/packages/shared/src/server/repositories/automation-repository.ts
@@ -40,13 +40,15 @@ export const getActionByIdWithSecrets = async ({
// Decrypt secret headers for webhook execution using new structure
const decryptedHeaders = config.requestHeaders
? decryptSecretHeaders(mergeHeaders(config.headers, config.requestHeaders))
- : Object.entries(config.headers).reduce(
- (acc, [key, value]) => {
- acc[key] = { secret: false, value };
- return acc;
- },
- {} as Record<string, { secret: boolean; value: string }>,
- );
+ : config.headers
+ ? Object.entries(config.headers).reduce(
+ (acc, [key, value]) => {
+ acc[key] = { secret: false, value };
+ return acc;
+ },
+ {} as Record<string, { secret: boolean; value: string }>,
+ )
+ : {};
return {
...actionConfig,
@@ -54,7 +56,7 @@ export const getActionByIdWithSecrets = async ({
type: config.type,
url: config.url,
requestHeaders: decryptedHeaders,
- displayHeaders: config.displayHeaders,
+ displayHeaders: getDisplayHeaders(config),
apiVersion: config.apiVersion,
displaySecretKey: config.displaySecretKey,
secretKey: config.secretKey,
@@ -128,10 +130,7 @@ const convertTriggerToDomain = (trigger: Trigger): TriggerDomain => {
};
};
-const convertActionToDomain = (action: Action): ActionDomain => {
- const config = action.config as WebhookActionConfigWithSecrets;
-
- // Handle legacy headers - convert them to displayHeaders format if displayHeaders is undefined
+const getDisplayHeaders = (config: WebhookActionConfigWithSecrets) => {
let displayHeaders = config.displayHeaders;
if (!displayHeaders && config.headers) {
// Convert legacy headers to displayHeaders format
@@ -143,13 +142,18 @@ const convertActionToDomain = (action: Action): ActionDomain => {
{} as Record<string, { secret: boolean; value: string }>,
);
}
+ return displayHeaders;
+};
+
+const convertActionToDomain = (action: Action): ActionDomain => {
+ const config = action.config as WebhookActionConfigWithSecrets;
return {
...action,
config: {
type: config.type,
url: config.url,
- displayHeaders,
+ displayHeaders: getDisplayHeaders(config),
apiVersion: config.apiVersion,
displaySecretKey: config.displaySecretKey,
} as SafeWebhookActionConfig,