Skip to content

Commit 3cf94fb

Browse files
fix: 修复对穷鬼模式的 auto dream 和 session memory 越过
1 parent 9a3081d commit 3cf94fb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/query/stopHooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export async function* handleStopHooks(
159159
toolUseContext.appendSystemMessage as ((msg: import('../types/message.js').SystemMessage) => void) | undefined,
160160
)
161161
}
162-
if (!toolUseContext.agentId) {
162+
if (!toolUseContext.agentId && !poorMode) {
163163
void executeAutoDream(stopHookContext, toolUseContext.appendSystemMessage)
164164
}
165165
}

src/services/SessionMemory/sessionMemory.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { writeFile } from 'fs/promises'
88
import memoize from 'lodash-es/memoize.js'
9+
import { feature } from 'bun:bundle'
910
import { getIsRemoteMode } from '../../bootstrap/state.js'
1011
import { getSystemPrompt } from '../../constants/prompts.js'
1112
import { getSystemContext, getUserContext } from '../../context.js'
@@ -280,6 +281,12 @@ const extractSessionMemory = sequential(async function (
280281
return
281282
}
282283

284+
// Poor mode: skip to reduce token consumption
285+
if (feature('POOR')) {
286+
const { isPoorModeActive } = await import('../../commands/poor/poorMode.js')
287+
if (isPoorModeActive()) return
288+
}
289+
283290
// Check gate lazily when hook runs (cached, non-blocking)
284291
if (!isSessionMemoryGateEnabled()) {
285292
// Log gate failure once per session (ant-only)

0 commit comments

Comments
 (0)