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

Function getVerifyPlanReminderAttachment

src/utils/attachments.ts:3901–3936  ·  view source on GitHub ↗

* Get verify plan reminder attachment if the model hasn't called VerifyPlanExecution yet.

(
  messages: Message[] | undefined,
  toolUseContext: ToolUseContext,
)

Source from the content-addressed store, hash-verified

3899 * Get verify plan reminder attachment if the model hasn't called VerifyPlanExecution yet.
3900 */
3901async function getVerifyPlanReminderAttachment(
3902 messages: Message[] | undefined,
3903 toolUseContext: ToolUseContext,
3904): Promise<Attachment[]> {
3905 if (
3906 (process.env.NCODE_BUILD_MODE !== 'noumena' && process.env.USER_TYPE !== 'ant') ||
3907 !isEnvTruthy(process.env.CLAUDE_CODE_VERIFY_PLAN)
3908 ) {
3909 return []
3910 }
3911
3912 const appState = toolUseContext.getAppState()
3913 const pending = appState.pendingPlanVerification
3914
3915 // Only remind if plan exists and verification not started or completed
3916 if (
3917 !pending ||
3918 pending.verificationStarted ||
3919 pending.verificationCompleted
3920 ) {
3921 return []
3922 }
3923
3924 // Only remind every N turns
3925 if (messages && messages.length > 0) {
3926 const turnCount = getVerifyPlanReminderTurnCount(messages)
3927 if (
3928 turnCount === 0 ||
3929 turnCount % VERIFY_PLAN_REMINDER_CONFIG.TURNS_BETWEEN_REMINDERS !== 0
3930 ) {
3931 return []
3932 }
3933 }
3934
3935 return [{ type: 'verify_plan_reminder' }]
3936}
3937
3938export function getCompactionReminderAttachment(
3939 messages: Message[],

Callers 1

getAttachmentsFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.90

Tested by

no test coverage detected