Skip to content

Commit 2f1c3ef

Browse files
stainluobviyus
authored andcommitted
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.
1 parent 29dcdc3 commit 2f1c3ef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/agents/command/attempt-execution.helpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ export function formatClaudeCliFallbackPrelude(
237237
CLAUDE_CLI_FALLBACK_PRELUDE_MIN_TURN_CHARS,
238238
options?.charBudget ?? CLAUDE_CLI_FALLBACK_PRELUDE_DEFAULT_CHAR_BUDGET,
239239
);
240-
const sections: string[] = ["## Prior session context (from claude-cli)"];
241-
let remaining = charBudget - sections[0]!.length;
240+
const heading = "## Prior session context (from claude-cli)";
241+
const sections: string[] = [heading];
242+
let remaining = charBudget - heading.length;
242243
if (seed.summaryText) {
243244
const summarySection = `\nSummary of earlier conversation:\n${seed.summaryText}`;
244245
if (summarySection.length <= remaining) {

0 commit comments

Comments
 (0)