#9974: refactor(agents): replace console.warn with SubsystemLogger in compaction-safeguard.ts
agents
size: XS
Cluster:
Refactor Console Logging in Agents
Refactors `src/agents/pi-extensions/compaction-safeguard.ts` to use the standardized `SubsystemLogger` instead of `console.warn` for improved logging control and consistency.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR refactors `src/agents/pi-extensions/compaction-safeguard.ts` to route warning output through the shared logging system by introducing a subsystem logger (`createSubsystemLogger("agents/compaction-safeguard")`) and replacing three `console.warn(...)` calls with `log.warn(...)`. This aligns the compaction safeguard extension’s diagnostics with the rest of the repo’s structured, configurable logging.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Change is a straightforward logging refactor (console.warn -> SubsystemLogger.warn) using an existing, repo-standard API, with no behavioral changes to compaction logic beyond log routing/formatting.
- No files require special attention
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#9425: refactor(agents): replace console.warn with SubsystemLogger in comp...
by dinakars777 · 2026-02-05
91.9%
#9461: refactor(cli): replace console.warn with SubsystemLogger in health.ts
by dinakars777 · 2026-02-05
87.8%
#9990: refactor(agents): replace console.warn with SubsystemLogger in veni...
by dinakars777 · 2026-02-06
83.8%
#11281: fix(logging): prevent subsystem loggers from bypassing file log lev...
by janckerchen · 2026-02-07
80.8%
#23669: refactor(logging): migrate node-host and tailscale console calls to...
by kevinWangSheng · 2026-02-22
80.0%
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
78.0%
#11153: refactor(hooks): replace console.warn/error with subsystem logger
by hclsys · 2026-02-07
78.0%
#7892: Claude/setup agent firewall ww xsv
by starwreckntx · 2026-02-03
77.6%
#6110: refactor: simplify boolean logic using nullish coalescing
by T1mn · 2026-02-01
77.4%
#7085: test: skip flaky workspace-paths & safe-bins tests on non-Linux/CI ...
by ThinkIbrokeIt · 2026-02-02
77.2%