fix(plugin): verify event hook compatibility with v1.4.0
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -150,14 +150,21 @@ export async function handleSessionIdle(args: {
|
||||
|
||||
let resolvedInfo: ResolvedMessageInfo | undefined
|
||||
let encounteredCompaction = false
|
||||
let latestMessageWasCompaction = false
|
||||
try {
|
||||
const messageInfoResult = await resolveLatestMessageInfo(ctx, sessionID, prefetchedMessages)
|
||||
resolvedInfo = messageInfoResult.resolvedInfo
|
||||
encounteredCompaction = messageInfoResult.encounteredCompaction
|
||||
latestMessageWasCompaction = messageInfoResult.latestMessageWasCompaction
|
||||
} catch (error) {
|
||||
log(`[${HOOK_NAME}] Failed to fetch messages for agent check`, { sessionID, error: String(error) })
|
||||
}
|
||||
|
||||
if (latestMessageWasCompaction) {
|
||||
log(`[${HOOK_NAME}] Skipped: latest message is a compaction marker`, { sessionID })
|
||||
return
|
||||
}
|
||||
|
||||
const sessionAgent = getSessionAgent(sessionID)
|
||||
if (!resolvedInfo?.agent && sessionAgent) {
|
||||
resolvedInfo = { ...resolvedInfo, agent: sessionAgent }
|
||||
|
||||
Reference in New Issue
Block a user