fix: route dual-memory hint and rerank cost advisory through the CLI-aware logging convention#889
Conversation
…aware logging convention (CortexReach#888) The dual-memory hint now logs once per process via logReg (debug in CLI mode), instead of once per registration context and per CLI command. The CortexReach#843 rerank cost advisory stays a gateway-boot warning but logs at debug in CLI mode, so memory-pro subcommand output stays clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Substantive Code Review — PR #889Reviewer: Harrison Forge (agent) | Date: 2026-06-12 TL;DRAPPROVE with a minor note. The fix correctly addresses the log repetition issue identified in #888. Change-by-change analysis
|
| Dimension | Value |
|---|---|
| Bug severity | MEDIUM — log noise degrades CLI usability and drowns operational logs |
| Fix size | SMALL — ~10 lines of new code |
| Risk | LOW — only affects logging, no behavioral changes |
| Test coverage | ADEQUATE — PR body notes startup-health-diagnostics tests pass |
| Correctness | SOLID — uses existing logReg convention, follows established patterns |
Minor note
Consider whether dualMemoryHintLogged should use Object.defineProperty(globalThis, ...) or a module-level const with a getter/setter to prevent accidental resets from other code. In practice, the module is self-contained so this is unnecessary, but worth being aware of for larger refactors.
Verdict
APPROVE. Clean fix, minimal risk.
rickthomasjr
left a comment
There was a problem hiding this comment.
Agent Code Review: PR #889 — fix: route dual-memory hint and rerank cost advisory through the CLI-aware logging convention
Verdict: APPROVE
Summary
Two logging improvements: (1) downgrades the auto-recall rerank cost advisory from warn to debug in CLI mode (so each memory-pro search command doesn't repeat the gateway-boot advisory), and (2) deduplicates the dual-memory model warning using a process-scoped dualMemoryHintLogged flag + the existing logReg convention.
P1 — Cost advisory logging: APPROVED
Before: api.logger.warn(rerankCostWarning) fired on every gateway registration context and every CLI command. After: (isCliMode() ? api.logger.debug : api.logger.warn) — gateway still warns, CLI commands stay quiet. Correct behavior for a gateway-boot advisory.
P2 — Dual-memory hint dedup: APPROVED
Before: api.logger.info() fired once per registration context (multiple per gateway boot). After: module-scoped dualMemoryHintLogged flag ensures it fires once per process. Uses logReg() (the CLI-aware logger from PR #888) so it also respects CLI mode. Correct.
P3 — No behavioral change: APPROVED
This PR is purely a logging cleanup. No logic changes, no state changes, no API changes. Zero risk of regression.
Conclusion
Clean, minimal, zero-risk cleanup. APPROVE.
rwmjhb
left a comment
There was a problem hiding this comment.
Approved. The semantic change is small and aligned with the CLI-aware logging convention: the dual-memory hint is guarded once per process, and the rerank cost advisory is moved out of normal CLI-visible output while staying visible in gateway logs.
Verification checked:
- orchestrator targeted tests passed
- orchestrator full npm test passed
npm run build --if-presentpassed on headeb508565913f31ee3258f021e917726242405a78node test/cli-smoke.mjspassednode test/plugin-manifest-regression.mjspassed
Non-blocking cleanup request: the PR contains broad index.ts line-ending/format churn for a narrow logging fix. That produced static ANY_TYPE warning noise and makes the stale branch harder to rebase/review. It would be cleaner to remove the unrelated churn or split it out.
Fixes #888
What
logRegconvention: a gateway boot prints it once at info instead of once per registration context, and CLI commands see it only at debug.isCliMode(), somemory-prosubcommand output is no longer prefixed with the multi-line advisory on every invocation.Both banners keep their educational and cost-awareness intent; only the repetition and the CLI placement change.
Tests
test/startup-health-diagnostics.test.mjs2/2 (thebuildAutoRecallRerankCostWarningbuilder is untouched; only the log call changes)test/plugin-manifest-regression.mjspassesNote
A clean
tsc -p tsconfig.jsonbuild also wants to modifydist/src/store.jsanddist/src/retriever.js, becausesrc/contains fixes the committed dist predates (aprocess.report.excludeNetworkguard against a long first-load hang, and a reranktop_ncap). Those files are intentionally left untouched here to keep this PR scoped; filing the dist drift separately.