fix(write): enforce explicit file mode despite umask#19077
fix(write): enforce explicit file mode despite umask#19077SeashoreShi wants to merge 2 commits intoanomalyco:devfrom
Conversation
|
I updated this branch with the latest |
|
The e2e test failures appear to be environment-related, not caused by this PR:
These failures are consistent with transient CI environment issues rather than code regressions. Could a maintainer please re-run the e2e tests? Thanks! |
|
Following up on the e2e failures: I analyzed both Windows and Linux job logs in detail. The failures are environment-related, not code regressions:
The write-permissions fix itself is solid and passes all local tests. Could a maintainer please re-run the e2e tests? They should pass on a clean CI run. Thank you! |
|
Forcing You should never programmatically loosen a user's umask — it's a deliberate security boundary. The correct direction for security is to respect umask, or chmod to something more restrictive (e.g., The right fix is test-side: pin With #14853 closed by its author, I'd suggest closing both this PR and #19076. |
|
This PR has been waiting for review for several days. If there's no response in the next 48 hours, I'll close it and focus on new contributions. Please let me know if there are any blockers or if this needs adjustment. Thank you! |
Issue for this PR
Closes #19076
Type of change
What does this PR do?
Fixes file mode handling in write paths so
tool.writeconsistently produces0644files even under strict umask settings.Changes:
WriteToolnow writes with explicit mode0o644.Filesystem.writenow applieschmodafter write whenmodeis provided.writeFile(..., { mode })does not update mode).How did you verify your code works?
packages/opencode/test/tool/write.test.ts(Expected 0644, Received 0600).bun --cwd packages/opencode test test/tool/write.test.tsbun --cwd packages/opencode testScreenshots / recordings
N/A (non-UI change)
Checklist
If you do not follow this template your PR will be automatically rejected.