fix: 修复对穷鬼模式的 auto dream 和 session memory 越过

This commit is contained in:
claude-code-best
2026-04-12 23:24:12 +08:00
parent 9a3081dff6
commit 3cf94fbda0
2 changed files with 8 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
import { writeFile } from 'fs/promises'
import memoize from 'lodash-es/memoize.js'
import { feature } from 'bun:bundle'
import { getIsRemoteMode } from '../../bootstrap/state.js'
import { getSystemPrompt } from '../../constants/prompts.js'
import { getSystemContext, getUserContext } from '../../context.js'
@@ -280,6 +281,12 @@ const extractSessionMemory = sequential(async function (
return
}
// Poor mode: skip to reduce token consumption
if (feature('POOR')) {
const { isPoorModeActive } = await import('../../commands/poor/poorMode.js')
if (isPoorModeActive()) return
}
// Check gate lazily when hook runs (cached, non-blocking)
if (!isSessionMemoryGateEnabled()) {
// Log gate failure once per session (ant-only)