Skip to content

tool.write should enforce 0644 file mode despite umask #19076

@SeashoreShi

Description

@SeashoreShi

Problem

tool.write can create files with mode 0600 under strict umask environments (for example umask 077), even though tests and behavior expect 0644.

Why this matters

The project expects deterministic write permissions for files created by write paths. Under hardened environments this drift causes test failures and inconsistent behavior.

Reproduction

  1. Set a strict umask (e.g. umask 077).
  2. Run packages/opencode tests.
  3. Observe failure in test/tool/write.test.ts (Expected 0644, Received 0600).

Expected behavior

Files written by tool.write should end up with mode 0644 regardless of process umask.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions