mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-21 15:55:50 +00:00
fix: 修复对穷鬼模式的 auto dream 和 session memory 越过
This commit is contained in:
@@ -159,7 +159,7 @@ export async function* handleStopHooks(
|
|||||||
toolUseContext.appendSystemMessage as ((msg: import('../types/message.js').SystemMessage) => void) | undefined,
|
toolUseContext.appendSystemMessage as ((msg: import('../types/message.js').SystemMessage) => void) | undefined,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (!toolUseContext.agentId) {
|
if (!toolUseContext.agentId && !poorMode) {
|
||||||
void executeAutoDream(stopHookContext, toolUseContext.appendSystemMessage)
|
void executeAutoDream(stopHookContext, toolUseContext.appendSystemMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import { writeFile } from 'fs/promises'
|
import { writeFile } from 'fs/promises'
|
||||||
import memoize from 'lodash-es/memoize.js'
|
import memoize from 'lodash-es/memoize.js'
|
||||||
|
import { feature } from 'bun:bundle'
|
||||||
import { getIsRemoteMode } from '../../bootstrap/state.js'
|
import { getIsRemoteMode } from '../../bootstrap/state.js'
|
||||||
import { getSystemPrompt } from '../../constants/prompts.js'
|
import { getSystemPrompt } from '../../constants/prompts.js'
|
||||||
import { getSystemContext, getUserContext } from '../../context.js'
|
import { getSystemContext, getUserContext } from '../../context.js'
|
||||||
@@ -280,6 +281,12 @@ const extractSessionMemory = sequential(async function (
|
|||||||
return
|
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)
|
// Check gate lazily when hook runs (cached, non-blocking)
|
||||||
if (!isSessionMemoryGateEnabled()) {
|
if (!isSessionMemoryGateEnabled()) {
|
||||||
// Log gate failure once per session (ant-only)
|
// Log gate failure once per session (ant-only)
|
||||||
|
|||||||
Reference in New Issue
Block a user