Skip to content

Commit 11e6404

Browse files
committed
modify micro to use config
1 parent 4eccb76 commit 11e6404

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/codingcode/src/session/messages.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { join } from 'path';
22
import type { Message } from '../core/types.js';
33
import type { SessionEvent, AssistantEvent, TokenUsage } from './types.js';
44
import { readHistory, resolveSessionDir } from './io.js';
5+
import { getContextConfig } from '../context/config.js';
56

67
const COMPACTIBLE_TOOLS = new Set([
78
'read_file',
@@ -14,8 +15,6 @@ const COMPACTIBLE_TOOLS = new Set([
1415
'edit_file',
1516
]);
1617

17-
const MIN_CHARS_FOR_COMPACT = 50;
18-
1918
export interface VisibilityResult {
2019
hidden: Set<string>;
2120
compactedTurnIds: Set<number>;
@@ -106,7 +105,7 @@ export function buildMessagesFromEvents(events: SessionEvent[]): Message[] {
106105
if (
107106
compactedTurnIds.has(event.turnId) &&
108107
COMPACTIBLE_TOOLS.has(event.toolName.toLowerCase()) &&
109-
event.output.length > MIN_CHARS_FOR_COMPACT
108+
event.output.length > getContextConfig().microCompactMinChars
110109
) {
111110
output = `[Earlier: used ${event.toolName}]`;
112111
}

0 commit comments

Comments
 (0)