Conversation
…requireEnv validation Agent-Logs-Url: https://github.com/laiso/ts-bench/sessions/30542317-3114-4282-8428-a81be81d2d3c Co-authored-by: laiso <39830+laiso@users.noreply.github.com>
…lly) Agent-Logs-Url: https://github.com/laiso/ts-bench/sessions/55b29425-1268-4d43-bfed-15fcf8228043 Co-authored-by: laiso <39830+laiso@users.noreply.github.com>
| return value; | ||
| } | ||
|
|
||
| export function requireAnyEnv(keys: string[], message?: string): { key: string; value: string } { |
There was a problem hiding this comment.
🟡 requireAnyEnv missing placeholder detection added to requireEnv
The PR adds placeholder detection to requireEnv (line 10) to reject values like <your-key>, your-api-key-here, or CHANGE_ME. However, requireAnyEnv (line 16-22) still accepts any non-empty string, including these same placeholder patterns. Since requireAnyEnv is widely used by agent builders to obtain API keys (e.g., src/agents/builders/claude.ts:51, src/agents/builders/aider.ts:11, src/agents/builders/gemini.ts:11), a user who copies .env.example and fills in a placeholder like <your-api-key> would get past requireAnyEnv validation and receive a confusing authentication error from the API provider instead of the clear "placeholder value" error.
(Refers to lines 16-22)
Was this helpful? React with 👍 or 👎 to provide feedback.
prepared.cleanup?.()called afterexecute()but not incatchblock, so temp env files leak on exceptionsagent.ts: wrapexecute()intry/finallyto guarantee cleanuptest.ts: wrapexecute()intry/finallyto guarantee cleanuptest-only.ts(2 locations): wrap bothexecute()calls intry/finallyto guarantee cleanup