refactor(shell): use Effect ChildProcess for shell command execution (#20494)

This commit is contained in:
Kit Langton 2026-04-01 12:07:57 -04:00 committed by GitHub
commit a9c85b7c27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 136 additions and 70 deletions

View file

@ -2,7 +2,6 @@ import type { ToolPart } from "@opencode-ai/sdk/v2/client"
import { test, expect } from "../fixtures"
import { sessionIDFromUrl } from "../actions"
import { promptSelector } from "../selectors"
import { createSdk } from "../utils"
const isBash = (part: unknown): part is ToolPart => {
if (!part || typeof part !== "object") return false
@ -14,10 +13,9 @@ const isBash = (part: unknown): part is ToolPart => {
test("shell mode runs a command in the project directory", async ({ page, withProject }) => {
test.setTimeout(120_000)
await withProject(async ({ directory, gotoSession, trackSession }) => {
const sdk = createSdk(directory)
await withProject(async ({ directory, gotoSession, trackSession, sdk }) => {
const prompt = page.locator(promptSelector)
const cmd = process.platform === "win32" ? "dir" : "ls"
const cmd = process.platform === "win32" ? "dir" : "command ls"
await gotoSession()
await prompt.click()