MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getVerifyPlanReminderAttachment

Function getVerifyPlanReminderAttachment

src/utils/attachments.ts:3894–3929  ·  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

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

Callers 1

getAttachmentsFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.85

Tested by

no test coverage detected