File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import { assignMessageRefs } from "../message-ids"
2020import { getCurrentParams , getCurrentTokenUsage , countTokens } from "../strategies/utils"
2121import { deduplicate , purgeErrors } from "../strategies"
2222import { saveSessionState } from "../state/persistence"
23- import { sendCompressBatchNotification } from "../ui/notification"
23+ import { sendCompressNotification } from "../ui/notification"
2424
2525// Non-primitive arrays are hidden in the TUI, so keep the schema simple and explicit.
2626function buildSchema ( ) {
@@ -156,7 +156,7 @@ export function createCompressMessageTool(ctx: ToolContext): ReturnType<typeof t
156156 . filter ( ( msg ) => ! ( msg . info . role === "user" && isIgnoredUserMessage ( msg ) ) )
157157 . map ( ( msg ) => msg . info . id )
158158
159- await sendCompressBatchNotification (
159+ await sendCompressNotification (
160160 ctx . client ,
161161 ctx . logger ,
162162 ctx . config ,
Original file line number Diff line number Diff line change @@ -204,16 +204,22 @@ export function createCompressRangeTool(ctx: ToolContext): ReturnType<typeof too
204204 const sessionMessageIds = rawMessages
205205 . filter ( ( msg ) => ! ( msg . info . role === "user" && isIgnoredUserMessage ( msg ) ) )
206206 . map ( ( msg ) => msg . info . id )
207+ const notificationEntries = [
208+ {
209+ blockId,
210+ summary : compressRangeArgs . content . summary ,
211+ summaryTokens,
212+ } ,
213+ ]
207214
208215 await sendCompressNotification (
209216 ctx . client ,
210217 ctx . logger ,
211218 ctx . config ,
212219 ctx . state ,
213220 toolCtx . sessionID ,
214- blockId ,
215- compressRangeArgs . content . summary ,
216- summaryTokens ,
221+ notificationEntries ,
222+ undefined ,
217223 totalSessionTokens ,
218224 sessionMessageIds ,
219225 params ,
Original file line number Diff line number Diff line change @@ -133,39 +133,6 @@ export async function sendUnifiedNotification(
133133 return true
134134}
135135
136- export async function sendCompressNotification (
137- client : any ,
138- logger : Logger ,
139- config : PluginConfig ,
140- state : SessionState ,
141- sessionId : string ,
142- compressionId : number ,
143- summary : string ,
144- summaryTokens : number ,
145- totalSessionTokens : number ,
146- sessionMessageIds : string [ ] ,
147- params : any ,
148- ) : Promise < boolean > {
149- return sendCompressBatchNotification (
150- client ,
151- logger ,
152- config ,
153- state ,
154- sessionId ,
155- [
156- {
157- blockId : compressionId ,
158- summary,
159- summaryTokens,
160- } ,
161- ] ,
162- undefined ,
163- totalSessionTokens ,
164- sessionMessageIds ,
165- params ,
166- )
167- }
168-
169136function buildCompressionSummary (
170137 entries : CompressionNotificationEntry [ ] ,
171138 state : SessionState ,
@@ -196,7 +163,7 @@ function getCompressionLabel(entries: CompressionNotificationEntry[]): string {
196163 return `Compression #${ firstBlockId } `
197164}
198165
199- export async function sendCompressBatchNotification (
166+ export async function sendCompressNotification (
200167 client : any ,
201168 logger : Logger ,
202169 config : PluginConfig ,
You can’t perform that action at this time.
0 commit comments