opencode
opencode copied to clipboard
fix(read): narrow .env file blocking to not block .envrc
Summary
- Fix overly broad
.envfile blocking that was catching.envrc(direnv) and other legitimate files - Changed from
filepath.includes(".env")to basename-only regex/^\.env(\.|$)/ - Added
.env.exampleand.env.templateto whitelist - Added test coverage for env file blocking behavior
Test plan
- [x]
bun test test/tool/read.test.tspasses (7 tests) - [ ] Manual test: can now read
.envrcfiles - [ ] Verify
.env,.env.local,.env.productionstill blocked
Fixes #4969
🤖 Generated with Claude Code