From 9691399e53a8b0afd652fd25a1a56fab095c48a5 Mon Sep 17 00:00:00 2001 From: stainlu Date: Sun, 26 Apr 2026 16:50:30 +0800 Subject: [PATCH] fix(agents): drop unnecessary non-null assertion in fallback prelude formatter Local default oxlint did not run --type-aware so the warning was missed on the initial commit; CI surfaced it via check-lint. Hoist the heading into a named const so its length is read directly without the assertion. --- src/agents/command/attempt-execution.helpers.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agents/command/attempt-execution.helpers.ts b/src/agents/command/attempt-execution.helpers.ts index fc93574f92b..f6c01ac3dfb 100644 --- a/src/agents/command/attempt-execution.helpers.ts +++ b/src/agents/command/attempt-execution.helpers.ts @@ -237,8 +237,9 @@ export function formatClaudeCliFallbackPrelude( CLAUDE_CLI_FALLBACK_PRELUDE_MIN_TURN_CHARS, options?.charBudget ?? CLAUDE_CLI_FALLBACK_PRELUDE_DEFAULT_CHAR_BUDGET, ); - const sections: string[] = ["## Prior session context (from claude-cli)"]; - let remaining = charBudget - sections[0]!.length; + const heading = "## Prior session context (from claude-cli)"; + const sections: string[] = [heading]; + let remaining = charBudget - heading.length; if (seed.summaryText) { const summarySection = `\nSummary of earlier conversation:\n${seed.summaryText}`; if (summarySection.length <= remaining) {