mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:30:42 +00:00
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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user