MCPcopy Create free account
hub / github.com/Noumena-Network/code / getVerifyPlanReminderTurnCount

Function getVerifyPlanReminderTurnCount

src/utils/attachments.ts:3879–3896  ·  view source on GitHub ↗
(messages: Message[])

Source from the content-addressed store, hash-verified

3877 * interval fires every ~10 tool calls instead of ~10 human turns.
3878 */
3879export function getVerifyPlanReminderTurnCount(messages: Message[]): number {
3880 let turnCount = 0
3881 for (let i = messages.length - 1; i >= 0; i--) {
3882 const message = messages[i]
3883 if (message && isHumanTurn(message)) {
3884 turnCount++
3885 }
3886 // Stop counting at plan_mode_exit attachment (marks when implementation started)
3887 if (
3888 message?.type === 'attachment' &&
3889 message.attachment.type === 'plan_mode_exit'
3890 ) {
3891 return turnCount
3892 }
3893 }
3894 // No plan_mode_exit found
3895 return 0
3896}
3897
3898/**
3899 * Get verify plan reminder attachment if the model hasn't called VerifyPlanExecution yet.

Callers 1

Calls 1

isHumanTurnFunction · 0.85

Tested by

no test coverage detected