From 8368a274a08579049c7c19bc7776ed9f11c05555 Mon Sep 17 00:00:00 2001 From: Dai Ha Date: Tue, 22 Sep 2026 10:46:31 +0700 Subject: [PATCH 1/2] fleetd #618: state the measured auto-compact precedence, not 'unverified' ClaudeCodeArguments.withAutoCompactWindow's javadoc and FleetConfig's warnConflictingAutoCompactWindows WARN text both used to say the precedence between --autocompact and CLAUDE_CODE_AUTO_COMPACT_WINDOW was not verified. fleetd #618 measured it: the env var wins, so the flag has no effect when both are set. Update both texts to say so, name #618, and warn that deleting the env var to resolve the conflict LOWERS the live window rather than fixing anything. No behaviour change; the WARN still fires on the same condition and stays a WARN (per #601). --- .../java/dev/ltms/fleet/config/FleetConfig.java | 8 +++++--- .../dev/ltms/fleet/launch/ClaudeCodeArguments.java | 14 ++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java b/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java index 94f4916..45b415a 100644 --- a/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java +++ b/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java @@ -2285,9 +2285,11 @@ public record FleetConfig( names.sort(String::compareTo); detail.sort(String::compareTo); log.warn("Claude Code profile(s) {} set disagreeing autoCompactWindow and env." - + "CLAUDE_CODE_AUTO_COMPACT_WINDOW — the daemon starts anyway. Fix by " - + "removing one key or setting equal values on each: {}. Which input Claude " - + "Code actually follows when they disagree is not verified here.", + + "CLAUDE_CODE_AUTO_COMPACT_WINDOW — the daemon starts anyway: {}. fleetd " + + "#618 measured that CLAUDE_CODE_AUTO_COMPACT_WINDOW wins, so " + + "autoCompactWindow is inert on these profiles. Set equal values on each " + + "to resolve this — do not just delete the env var, since that LOWERS the " + + "live window to autoCompactWindow's value rather than fixing anything.", names, String.join(", ", detail)); } diff --git a/fleetd/src/main/java/dev/ltms/fleet/launch/ClaudeCodeArguments.java b/fleetd/src/main/java/dev/ltms/fleet/launch/ClaudeCodeArguments.java index ce2e214..263c2e4 100644 --- a/fleetd/src/main/java/dev/ltms/fleet/launch/ClaudeCodeArguments.java +++ b/fleetd/src/main/java/dev/ltms/fleet/launch/ClaudeCodeArguments.java @@ -15,13 +15,15 @@ public final class ClaudeCodeArguments { * Append the configured Claude Code auto-compaction window when the profile opts in. * *

This flag and the environment variable {@code CLAUDE_CODE_AUTO_COMPACT_WINDOW} can - * disagree. Which one Claude Code actually follows when they do is NOT verified here — this - * javadoc used to claim the environment variable always wins, but nobody had measured that, and - * this host's own {@code fleetd.yaml} asserts the opposite in a comment. So this javadoc no - * longer picks a side. {@link FleetConfig#load(java.nio.file.Path)} only WARNS when a Claude - * Code profile sets both to different values (see {@code + * disagree, and fleetd #618 measured which one Claude Code actually follows: the environment + * variable wins, ahead of this {@code --autocompact} flag, ahead of the settings file, ahead of + * clientdata, the experiment, and the model default. So when a profile sets both, the flag this + * method appends has NO effect — Claude Code reads {@code CLAUDE_CODE_AUTO_COMPACT_WINDOW} + * first and never consults the flag. {@link FleetConfig#load(java.nio.file.Path)} only WARNS + * when a Claude Code profile sets both to different values (see {@code * FleetConfig.warnConflictingAutoCompactWindows}) — it does not stop the daemon from starting, - * and a launched session may end up honouring either window. + * and the launched session honours the env var, not this flag. Measured against Claude Code + * 2.1.278 (fleetd #618) — a later version could reorder this precedence. */ public static List withAutoCompactWindow(List argv, FleetConfig.Profile profile) { if (profile.autoCompactWindow() == null) { -- 2.52.0 From 6cb31a10e4b97bf0eac5b03cd1747b6fdeeaf351 Mon Sep 17 00:00:00 2001 From: Dai Ha Date: Tue, 22 Sep 2026 10:50:59 +0700 Subject: [PATCH 2/2] fleetd #618: fix the third stale spot the brief missed The method-level javadoc on FleetConfig.warnConflictingAutoCompactWindows (above the log.warn call) still claimed the autoCompactWindow vs CLAUDE_CODE_AUTO_COMPACT_WINDOW precedence was 'intentionally not asserted' and cited fleetd.yaml's now-corrected comment as evidence the question was open. Replace it with the measured answer from #618: the env var wins, so autoCompactWindow is inert on a profile that sets both. Kept the WARN-not-throw rationale paragraph above it untouched (#601) and kept the ClaudeCodeArguments cross-reference, which now points to an agreeing claim instead of a contradicting one. No behaviour change. --- .../main/java/dev/ltms/fleet/config/FleetConfig.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java b/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java index 45b415a..62da9a8 100644 --- a/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java +++ b/fleetd/src/main/java/dev/ltms/fleet/config/FleetConfig.java @@ -2240,11 +2240,11 @@ public record FleetConfig( * information — which profiles, and now both values, so they can fix it without reading the * source — without ever taking the fleet down. * - *

Which of the two inputs Claude Code actually follows when they disagree is intentionally - * not asserted here. {@code ClaudeCodeArguments}'s javadoc used to state the - * environment variable always wins; nobody had measured that, and this host's own - * {@code fleetd.yaml} asserts the opposite in a comment. This method only detects and reports - * the disagreement — see {@link dev.ltms.fleet.launch.ClaudeCodeArguments}. + *

fleetd #618 measured which of the two inputs Claude Code actually follows when they + * disagree: the environment variable wins, so {@code autoCompactWindow} is inert on a profile + * that also sets the env var. This method only detects and reports the disagreement — it does + * not correct it — see {@link dev.ltms.fleet.launch.ClaudeCodeArguments} for the full measured + * precedence. * *

Equal values never warn: either input then produces the same session window, so there is * nothing to reconcile. -- 2.52.0