test(write): set umask to 0o022 for deterministic file permissions#1
Open
HaleTom wants to merge 5 commits into
Open
test(write): set umask to 0o022 for deterministic file permissions#1HaleTom wants to merge 5 commits into
HaleTom wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR bumps the repo to v1.3.15 and includes multiple functional changes across tests, server/API, SDK generation, and the CLI TUI—most notably making a tool.write permission test deterministic under non-default umasks and adding experimental “Console org” switching support end-to-end.
Changes:
- Make
tool.writepermission assertions deterministic by setting/restoringprocess.umask(0o022)during the sensitive write test. - Add experimental Console endpoints (
/experimental/console,/experimental/console/orgs,/experimental/console/switch) and wire them through OpenAPI + generated JS SDK + TUI org switching UI. - Migrate
ReadToolto an Effect-based tool definition and refactor its test suite accordingly; adjust session token accounting to separate reasoning tokens from output.
Reviewed changes
Copilot reviewed 46 out of 47 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| sdks/vscode/package.json | Bump VS Code extension version to 1.3.15. |
| packages/web/src/content/docs/zen.mdx | Remove MiMo “Free” model references from Zen docs/pricing. |
| packages/web/package.json | Bump web package version to 1.3.15. |
| packages/util/package.json | Bump util package version to 1.3.15. |
| packages/ui/package.json | Bump UI package version to 1.3.15. |
| packages/slack/package.json | Bump Slack package version to 1.3.15. |
| packages/sdk/openapi.json | Add experimental Console endpoints to OpenAPI spec. |
| packages/sdk/js/src/v2/gen/types.gen.ts | Add generated types for experimental Console endpoints. |
| packages/sdk/js/src/v2/gen/sdk.gen.ts | Add generated client methods for experimental Console endpoints; reorganize Tool/Console clients. |
| packages/sdk/js/package.json | Bump SDK package version to 1.3.15. |
| packages/plugin/package.json | Bump plugin package version to 1.3.15. |
| packages/opencode/test/tool/write.test.ts | Set/restore umask to stabilize permission assertions. |
| packages/opencode/test/tool/read.test.ts | Refactor ReadTool tests to Effect-based harness and instance providers. |
| packages/opencode/test/session/compaction.test.ts | Expand usage tests to validate reasoning vs output token separation and cost accounting. |
| packages/opencode/test/config/config.test.ts | Update Account service mock to include activeOrg() and add active-org fixture data. |
| packages/opencode/src/tool/registry.ts | Extend ToolRegistry layer requirements/provisioning to include services needed by effectified tools. |
| packages/opencode/src/tool/read.ts | Convert ReadTool to Tool.defineEffect, using AppFileSystem/LSP/FileTime/Instruction services. |
| packages/opencode/src/tool/external-directory.ts | Add Effect wrapper assertExternalDirectoryEffect and migrate path normalization helpers to AppFileSystem. |
| packages/opencode/src/session/index.ts | Change token accounting to subtract reasoning tokens from output token count. |
| packages/opencode/src/server/routes/experimental.ts | Add experimental Console routes for metadata/org listing/org switching. |
| packages/opencode/src/npm/index.ts | Set Arborist ignoreScripts: true for dependency operations. |
| packages/opencode/src/filesystem/index.ts | Improve Windows path normalization and add normalizePathPattern. |
| packages/opencode/src/config/console-state.ts | Introduce ConsoleState schema + empty default state. |
| packages/opencode/src/config/config.ts | Track consoleState in Config state and expose getConsoleState(). |
| packages/opencode/src/cli/cmd/tui/util/provider-origin.ts | Add helpers/icons to label Console-managed providers in the UI. |
| packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx | Add categoryView to render richer category headers. |
| packages/opencode/src/cli/cmd/tui/context/sync.tsx | Fetch and store console state from experimental console endpoint during sync. |
| packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx | Show active Console org label in the prompt and trigger org switch command when applicable. |
| packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx | Mark Console-managed providers and prevent selecting them for local auth setup. |
| packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx | Display Console-managed provider label in model selection UI. |
| packages/opencode/src/cli/cmd/tui/component/dialog-console-org.tsx | New dialog to list and switch Console orgs via experimental endpoints. |
| packages/opencode/src/cli/cmd/tui/app.tsx | Add “Switch org” command when multiple orgs are available. |
| packages/opencode/src/account/index.ts | Add activeOrg() helper and adjust orgsByAccount() error handling. |
| packages/opencode/specs/effect-migration.md | Document transitional patterns for effectified tools; mark read.ts as migrated. |
| packages/opencode/script/build.ts | Mark node-gyp as external for build. |
| packages/opencode/package.json | Bump opencode package version to 1.3.15. |
| packages/function/package.json | Bump function package version to 1.3.15. |
| packages/extensions/zed/extension.toml | Bump Zed extension version and release asset URLs to 1.3.15. |
| packages/enterprise/package.json | Bump enterprise package version to 1.3.15. |
| packages/desktop/package.json | Bump desktop package version to 1.3.15. |
| packages/desktop-electron/package.json | Bump desktop-electron package version to 1.3.15. |
| packages/console/mail/package.json | Bump console-mail package version to 1.3.15. |
| packages/console/function/package.json | Bump console-function package version to 1.3.15. |
| packages/console/core/package.json | Bump console-core package version to 1.3.15. |
| packages/console/app/package.json | Bump console-app package version to 1.3.15. |
| packages/app/package.json | Bump app package version to 1.3.15. |
| bun.lock | Update workspace package versions to 1.3.15. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9719a21 to
3fcdc4a
Compare
3fcdc4a to
90f7ec2
Compare
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes anomalyco#18987
Type of change
What does this PR do?
The
writetool testsets file permissions when writing sensitive datafails on systems with a non-default umask (e.g.0027). The test hardcoded0o644as the expected permission, butFilesystem.write()respects the system umask when no explicit mode is set.Fixed by setting
process.umask(0o022)before the test and restoring it in afinallyblock, ensuring deterministic permissions regardless of the host environment.How did you verify your code works?
bun test test/tool/write.test.ts— all 13 tests passbun typecheck— no errorsScreenshots / recordings
N/A — no UI changes.
Checklist