Repository navigation
fix(setup): reject nonregular client configuration before reading - #1379
rudycelekli wants to merge 1 commit into
Conversation
Signed-off-by: Rudy Celekli <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: This fix works. The red CI is not from this PR. Main had a broken test then. Main is fixed now. A re-run should go green. Edit: added the OpenCode and Pi licenses. Why CI is redCI tested a merge with main at 08ec2bf. That main had a broken test from 001851f. The failing case was This PR's own head starts before that commit. On the head alone, that file passes (54/54). I rebuilt the CI merge without git. I took main at 08ec2bf. Then I applied this PR's diff with
The only failure is FIFO before and afterI used a throwaway HOME. The OpenCode (MIT) config was a FIFO. Each command ran under
Then I tried a symlink to a FIFO. In 6.3.0, doctor and setup hung. Uninstall already refused it there. This PR answers all three fast. Doctor and setup now say this (I shortened the path):
For a plain FIFO, uninstall says the same. It ends "then rerun uninstall." For the symlink, uninstall keeps its old "could not be safely verified" note. The FIFO stayed a FIFO every time. The symlink stayed a symlink. No backup file was made. No process was left stuck. Heads-upPR #1376 (Pi client; Pi is MIT) edits three of the same files. That includes Tests
Thanks, rudycelekli! Test setup
🤖 Generated with Claude Code (Opus 5.5) 🦊 |
|
Thank you for the PR and the FIFO/symlink investigation. Closing as superseded by the shared regular-file boundary now on main: configuration/reference integration and bounded descriptor reads. Doctor, setup, maintenance and uninstall configuration reads now use the shared nonblocking regular-file admission, including setup readback; named read failures retain the selected path. The implementation reuses that boundary without the additional client-specific read wrapper. The replacement passed typecheck, lint/module boundaries and formatting. This closure pass compared the source; it did not rerun the PR's CLI/FIFO tests or real providers. |
Problem
A client configuration path can be a FIFO, or a symlink to one.
doctor,setupanduninstallopen it with ordinary readFile and wait indefinitely for a writer. The command never reaches its diagnostic or planned-action result.Change
Use the existing regular-file admission/read primitive for all client configuration reads, including maintenance rereads and setup readback. It opens nonblocking, validates the same descriptor and closes it after reading. Project nonregular configuration into actionable client diagnostics. Preserve missing-file creation, ordinary files, owned symlink lifecycle, backups and disabled registrations.
Verification
npm run check, test discovery,npm pack --dry-runand installednpm run verify:packagepass. Package verification includes planned/idempotent setup, backup/readback, failure recovery, symlink lifecycle, read-only update and MCP startup.AI assistance was used for investigation, implementation and verification.