()
| 456 | } |
| 457 | |
| 458 | function shouldSkipInjection() { |
| 459 | // Only apply dedup when explicitly enabled (set by Kiro adapter) OR when |
| 460 | // we detect a per-prompt-firing platform via PROMPT_SUBMIT heuristic in |
| 461 | // stdin. The stdin is drained in main(), so we rely on env flag here. |
| 462 | const dedupEnabled = String(process.env.EVOLVER_SESSION_START_DEDUP || '').toLowerCase() === '1' |
| 463 | || String(process.env.EVOLVER_SESSION_START_DEDUP || '').toLowerCase() === 'true'; |
| 464 | if (!dedupEnabled) return false; |
| 465 | |
| 466 | const ttlMs = Number(process.env.EVOLVER_SESSION_START_DEDUP_TTL_MS) || (30 * 60 * 1000); |
| 467 | return throttled(process.cwd(), ttlMs, getDedupStatePath()); |
| 468 | } |
| 469 | |
| 470 | // Drain the hook stdin (session context JSON) before running, so we can read the |
| 471 | // tool's session_id and mark the session in the registry. The host passes the |
no test coverage detected