diff options
| author | Dax Raad <[email protected]> | 2026-04-30 23:57:27 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-05-01 15:35:45 -0400 |
| commit | c2609cbf046a35ce0013b41f5b3f72532d972ad4 (patch) | |
| tree | 82fa653f7351451e54f5093ce60caf262a0969d7 /packages/core | |
| parent | 2115df57bf40c1f9a2e5d03502852f874fd82b69 (diff) | |
| download | opencode-c2609cbf046a35ce0013b41f5b3f72532d972ad4.tar.gz opencode-c2609cbf046a35ce0013b41f5b3f72532d972ad4.zip | |
core: allow agents to access global tmp directory without permission prompts
Agents can now create temporary files in the global tmp directory without
triggering external_directory permission prompts. This enables agents to
freely use temporary storage for intermediate files during builds and
other operations.
Diffstat (limited to 'packages/core')
| -rw-r--r-- | packages/core/test/global.test.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/core/test/global.test.ts b/packages/core/test/global.test.ts new file mode 100644 index 000000000..4e13e8842 --- /dev/null +++ b/packages/core/test/global.test.ts @@ -0,0 +1,16 @@ +import { describe, expect, test } from "bun:test" +import fs from "fs/promises" +import os from "os" +import path from "path" +import { Global } from "@opencode-ai/core/global" + +describe("global paths", () => { + test("tmp path is under the system temp directory", () => { + expect(Global.Path.tmp).toBe(path.join(os.tmpdir(), "opencode")) + expect(Global.make().tmp).toBe(Global.Path.tmp) + }) + + test("tmp path is created on module load", async () => { + expect((await fs.stat(Global.Path.tmp)).isDirectory()).toBe(true) + }) +}) |
