Repository navigation
fix(integrations): bound managed config reads and writes - #7029
Conversation
Refuse oversized and non-regular managed configuration inputs, apply the same 4 MiB write bound before target mutation, and retain committed or uncertain snapshots. Read small files into initialized size-proportional buffers while preserving growth and overflow probes. Preserve store-owned cleanup for unused snapshots and all current upstream test registrations. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Separate oversized-file rejection from final-symlink rejection. Probe file-symlink creation on Windows and mark only that test skipped for EPERM/EACCES; preserve other errors and execute the rejection check when creation succeeds. The oversized assertion already preceded link creation, but an unavailable link privilege failed the combined test. Keep byte-boundary coverage unconditional and record actual symlink skips.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer integration into |
Summary
Based on #7017 by @luvs01.
Managed integration configs (Cline, Kilo, Aside and other client files OpenCodex edits) were read with an unbounded
readFileSync, so an oversized or special file could be loaded whole before parsing. Reads now go through a bounded regular-file descriptor that refuses final symlinks, FIFOs/devices and files over 4 MiB. Writes refuse merged configs and Cline recovery markers past the same bound before any mutation, and the unused pre-write snapshot is discarded through the state store when that refusal happens.This carries the two in-scope commits from #7017 unchanged (authorship preserved). The two unrelated test-hardening commits (generation-child diagnostics, Windows tray probe readiness) are left out to keep this PR on one topic.
Verification
bun run typecheckbun test tests/lib/bounded-file-read.test.ts tests/clients/{aside-profiles,cline-writer,integrations-journal,integrations-state,integrations-writer}.test.ts tests/test-layout*.test.ts: all new and changed cases pass. One pre-existing TOML-date failure inintegrations-state.test.tsreproduces identically onorigin/devwith local Bun 1.3.14 (CI pins 1.4.x).Checklist
Co-authored-by: Epinephrine [email protected]
Summary by CodeRabbit
Bug Fixes
Documentation