Skip to content

Commit 829d8d9

Browse files
Alix-007claude
andcommitted
fix(agents): avoid variable shadow in compaction safeguard test
Use testing.capCompactionSummaryPreservingSuffix alias instead of destructuring to avoid eslint no-shadow with the upper-scope import. Co-Authored-By: Claude Opus 4.8 <[email protected]>
1 parent b01c5dc commit 829d8d9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/agents/agent-hooks/compaction-safeguard.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ describe("compaction-safeguard summary budgets", () => {
459459
"\n\n<workspace-critical-rules>\n## Session Startup\nRead AGENTS.md\n</workspace-critical-rules>";
460460
const body = "x".repeat(MAX_COMPACTION_SUMMARY_CHARS);
461461

462-
const capped = capCompactionSummaryPreservingSuffix(body, suffix);
462+
const capped = capper(body, suffix);
463463

464464
expect(capped.length).toBeLessThanOrEqual(MAX_COMPACTION_SUMMARY_CHARS);
465465
expect(capped).toContain("<workspace-critical-rules>");
@@ -534,11 +534,11 @@ describe("compaction-safeguard summary budgets", () => {
534534
it("preserves emoji when capCompactionSummaryPreservingSuffix truncates body with surrogate pair at boundary", () => {
535535
// When the body + suffix exceeds the cap, the body is truncated. An emoji
536536
// at the cut point must stay intact.
537-
const { capCompactionSummaryPreservingSuffix } = testing;
537+
const capper = testing.capCompactionSummaryPreservingSuffix;
538538
const suffix = "\n\n## Tool Failures\n- exec: failed";
539539
const body = "x".repeat(MAX_COMPACTION_SUMMARY_CHARS - 1) + "🧠extra";
540540

541-
const capped = capCompactionSummaryPreservingSuffix(body, suffix);
541+
const capped = capper(body, suffix);
542542

543543
expect(capped).not.toMatch(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])/);
544544
expect(capped).not.toMatch(/(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/);

0 commit comments

Comments
 (0)