From 3ce1a7c96b68db801b69d53107306a5695396ca8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 04:48:51 +0000 Subject: [PATCH 1/2] Lower ECS container overrides trim threshold for headroom ECS rejects runTask when the serialized container overrides exceed 8192 characters, but real-world failures were happening even when our own length check passed, since ECS's actual accounting doesn't match ours exactly. Trim at 7500 instead so the oversized private_key env var gets dropped earlier, leaving margin before the hard limit. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_013BnUutcaMNynydRnay6KPn --- src/createCloudJob.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/createCloudJob.ts b/src/createCloudJob.ts index e0f31aa..e98a170 100644 --- a/src/createCloudJob.ts +++ b/src/createCloudJob.ts @@ -13,7 +13,8 @@ import * as crypto from 'crypto' const clusterName = 'violinist-cluster' // The ECS API rejects a runTask call where the serialized container overrides // are longer than this, with "Container Overrides length must be at most 8192". -const overridesMaxLength = 8192 +// We trigger our own trimming below this hard limit, to leave some headroom. +const overridesMaxLength = 7500 // The env var we drop if that happens, to give the task a chance of starting. const skipWhenTooLong = 'private_key' const sleepWhilePolling = 5000 From 4782b6b3dc955585a24a5a7e297670ea54a6e33f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 06:38:04 +0000 Subject: [PATCH 2/2] Use a small adjustable safety margin instead of a fixed lower cap 7500 was too large a jump from the real 8192 limit. Express the trim threshold as 8192 minus an adjustable overridesLengthSafetyMargin const (64) instead, so it's easy to tune if the observed gap between our length calculation and AWS's own accounting changes. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_013BnUutcaMNynydRnay6KPn --- src/createCloudJob.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/createCloudJob.ts b/src/createCloudJob.ts index e98a170..5b3c72d 100644 --- a/src/createCloudJob.ts +++ b/src/createCloudJob.ts @@ -13,8 +13,10 @@ import * as crypto from 'crypto' const clusterName = 'violinist-cluster' // The ECS API rejects a runTask call where the serialized container overrides // are longer than this, with "Container Overrides length must be at most 8192". -// We trigger our own trimming below this hard limit, to leave some headroom. -const overridesMaxLength = 7500 +// AWS's own accounting can come out a bit stricter than what we compute here, +// so we trim a bit before the hard limit. Adjust this if that gap changes. +const overridesLengthSafetyMargin = 64 +const overridesMaxLength = 8192 - overridesLengthSafetyMargin // The env var we drop if that happens, to give the task a chance of starting. const skipWhenTooLong = 'private_key' const sleepWhilePolling = 5000