Dashboard › opencode › Distillation
c0e24b22-1026-4dcf-bdb1-4dbec525adc3["lore_tm_v1_NAFfwCFQh5FWi8L33ZsWz7yW6_jl50mFyzSKr-gBOb4","lore_tm_v1__TXNGHoJUxefAEDLriflICmc71heKBLUeDzNgiAfnTM"]
Date: Sep 8, 2026
/tmp/opencode/pty-plugin-smoke.ts is a 290-line smoke-test harness importing the PTY plugin from /home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/pty.ts; it mocks tool registration, permission assertions, synthetic session notifications, and event subscriptions, and uses project/location directory /tmp/opencode./tmp/opencode/pty-plugin-smoke.ts lines 58–62 expects exactly the PTY tools pty_spawn, pty_write, pty_read, pty_list, and pty_kill; it verifies pty_spawn, pty_write, and pty_kill declare options.permission === "shell"./tmp/opencode/pty-plugin-smoke.ts lines 67–78 require rejection of: 1. 129 arguments to /bin/true, 2. 5 arguments each containing "x".repeat(16_000), and 3. one encoded argument containing "'" .repeat(16_384) (written as "'"​.repeat(16_384) in code); accepted errors must mention limit or argv./tmp/opencode/pty-plugin-smoke.ts verify: explicit shell denial rejects pty_spawn with PTY command denied; an external_directory denial blocks workdir /tmp/opencode/pty-project/outside, a symlink to /tmp; shell permission calls include canonical source { type: "tool", messageID: context.messageID, id: context.id }; pty_write authorizes a resource containing <stdin>; and shell permission calls must not pass a command resource through save./tmp/opencode/pty-plugin-smoke.ts spawn /bin/sh -c "read value; printf 'got:%s\n' \"$value\"" with notifyOnExit: true, write hello\n, require exit code 0, and verify pty_read finds got:hello; another owner session must receive PTY session not found from pty_write, pty_read, and pty_kill, while pty_list must return [] without leaking the PTY./tmp/opencode/pty-plugin-smoke.ts spawn /bin/sh -c "read value" with timeoutSeconds: 1 and require a synthetic notification with timedOut === true; the original PTY must appear in pty_list and support pty_kill({ id, cleanup: true })./tmp/opencode/pty-plugin-smoke.ts lines 165–183 spawns /bin/sh -c "trap '' TERM; while :; do sleep 1; done", calls pty_kill({ id: stubbornID, cleanup: true }), then verifies the process group no longer exists by requiring process.kill(-stubbornPID, 0) to fail with ESRCH./tmp/opencode/pty-plugin-smoke.ts emit { type: "session.deleted", data: { sessionID } } and verify: an existing PTY is removed from pty_list; an in-flight pty_spawn waiting at the permission gate fails with Session has been deleted; and subsequent spawns for that deleted owner are denied with the same error./tmp/opencode/pty-plugin-smoke.ts spawns /bin/printf with argument one\ntwo\n, waits for exit notification, then requires pty_read to report exactly 2 lines and totalLines === 2, ensuring a trailing newline does not create a phantom line./tmp/opencode/pty-plugin-smoke.ts attempts pty_write with "😀".repeat(20_000) and requires rejection mentioning UTF-8 byte limit, followed by pty_kill({ id: bytesID, cleanup: true })./tmp/opencode/pty-plugin-smoke.ts holds shell permission, starts 5 concurrent pty_spawn calls for session-reservations, and requires a 6th spawn to fail with PTY session limit reached; after releasing the gate, all 5 reserved sessions must return IDs and be cleaned up./tmp/opencode/pty-plugin-smoke.ts calls cleanup?.() and prints JSON containing tools: ["pty_spawn", "pty_write", "pty_read", "pty_list", "pty_kill"] plus true flags for permissions, ownership, interactive, notification, timeout, escalation, sessionDeletion, inflightDeletion, atomicReservations, argvBounds, utf8Bytes, linePaging, and cleanup; the provided content does not include an execution result.No files found; no search path or query was included in the result.