( messages: Message[], )
| 3961 | * compact boundaries. |
| 3962 | */ |
| 3963 | export function getContextEfficiencyAttachment( |
| 3964 | messages: Message[], |
| 3965 | ): Attachment[] { |
| 3966 | if (!feature('HISTORY_SNIP')) { |
| 3967 | return [] |
| 3968 | } |
| 3969 | // Gate must match SnipTool.isEnabled() — don't nudge toward a tool that |
| 3970 | // isn't in the tool list. Lazy require keeps this file snip-string-free. |
| 3971 | const { isSnipRuntimeEnabled, shouldNudgeForSnips } = |
| 3972 | // eslint-disable-next-line @typescript-eslint/no-require-imports |
| 3973 | require('../services/compact/snipCompact.js') as typeof import('../services/compact/snipCompact.js') |
| 3974 | if (!isSnipRuntimeEnabled()) { |
| 3975 | return [] |
| 3976 | } |
| 3977 | |
| 3978 | if (!shouldNudgeForSnips(messages)) { |
| 3979 | return [] |
| 3980 | } |
| 3981 | |
| 3982 | return [{ type: 'context_efficiency' }] |
| 3983 | } |
| 3984 | |
| 3985 | |
| 3986 | function isFileReadDenied( |
no test coverage detected