@code-yeongyu/senpi-codemode 2026.11.9-2 → 2026.11.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/package.json +4 -4
- package/src/environments/js-installer.ts +2 -0
- package/src/environments/py-installer.ts +2 -0
- package/src/kernels/shared/subprocess-process.ts +2 -0
- package/src/skill/bun/SKILL.md +1 -1
- package/src/skill/bun/references/session-recipes.md +2 -2
- package/src/skill/bun/references/test.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2026.11.10] - 2026-11-10
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- The bundled Bun skill no longer tells agents to re-spawn Bun as `process.execPath` unconditionally: inside a compiled host that path is the host binary, so the skill now limits it to standalone Bun and directs compiled hosts to resolve `bun` through PATH ([code-yeongyu/oh-my-openagent#12569](https://github.com/code-yeongyu/oh-my-openagent/issues/12569), [#6232](https://github.com/code-yeongyu/senpi/pull/6232))
|
|
14
|
+
- Hide the console window for installer and kernel subprocess spawns on Windows ([#3965](https://github.com/code-yeongyu/senpi/issues/3965))
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
|
|
3
18
|
## [2026.11.9-2] - 2026-11-09
|
|
4
19
|
|
|
5
20
|
### Breaking Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-codemode",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.10",
|
|
4
4
|
"description": "Source-only senpi extension package for codemode evaluation tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/parser": "8.0.4",
|
|
36
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.
|
|
36
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.10",
|
|
37
37
|
"quickjs-wasi": "3.6.2",
|
|
38
38
|
"typebox": "1.3.34"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@code-yeongyu/senpi": "2026.11.
|
|
41
|
+
"@code-yeongyu/senpi": "2026.11.10"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@code-yeongyu/senpi": "2026.11.
|
|
44
|
+
"@code-yeongyu/senpi": "2026.11.10"
|
|
45
45
|
},
|
|
46
46
|
"keywords": [
|
|
47
47
|
"senpi",
|
|
@@ -163,6 +163,8 @@ export function runJsInstall(input: {
|
|
|
163
163
|
const child = spawn(input.command, argv, {
|
|
164
164
|
cwd: input.cwd,
|
|
165
165
|
stdio: ["ignore", "pipe", "pipe"],
|
|
166
|
+
// senpi#3965: npm/pnpm is a console-subsystem exe on Windows.
|
|
167
|
+
windowsHide: true,
|
|
166
168
|
// npm reads `global`/`location` from any .npmrc and the env; a global install would land where the import never looks.
|
|
167
169
|
env: {
|
|
168
170
|
...input.env,
|
|
@@ -217,6 +217,8 @@ export async function runPipInstall(input: {
|
|
|
217
217
|
const child = spawn(input.interpreter, argv, {
|
|
218
218
|
cwd: input.cwd,
|
|
219
219
|
stdio: ["ignore", "pipe", "pipe"],
|
|
220
|
+
// senpi#3965: python/pip is a console-subsystem exe on Windows.
|
|
221
|
+
windowsHide: true,
|
|
220
222
|
env: { ...isolatedPipEnv(), TMPDIR: scratch, TEMP: scratch, TMP: scratch },
|
|
221
223
|
});
|
|
222
224
|
let termination: Promise<void> | undefined;
|
|
@@ -204,6 +204,8 @@ export function spawnSubprocess(spawn: SubprocessSpawn | undefined, request: Sub
|
|
|
204
204
|
detached: true,
|
|
205
205
|
env: request.env,
|
|
206
206
|
stdio: ["pipe", "pipe", "pipe"],
|
|
207
|
+
// senpi#3965: kernel children can be console-subsystem exes on Windows.
|
|
208
|
+
windowsHide: true,
|
|
207
209
|
});
|
|
208
210
|
globalThis.__senpiCodemodeGateObserveResource?.("processes", child, "close");
|
|
209
211
|
return child;
|
package/src/skill/bun/SKILL.md
CHANGED
|
@@ -45,7 +45,7 @@ Free wins (no code change): 2x lower CPU, 13-48% less server memory, 2-2.5x fast
|
|
|
45
45
|
1. **Eval-first, builtin-first.** The `eval` js kernel runs on Bun (that is why this skill is present): call `Bun.*` APIs directly inside js cells and reach for `bash` or a spawned `bun` only for CLI surfaces (`bun test`, `bun build`, `bun pm`) or work that needs a separate process. The Replaces column above is a ban list for new dependencies in production code, test helpers and one-off scripts alike.
|
|
46
46
|
2. **Anything that must outlive a cell starts outside it.** The kernel SIGKILLs every `Bun.spawn` child when its cell settles, so browsers, daemons, dev servers, remote `ssh` jobs and slow git hooks start through `tool.monitor({ command })` or `tool.bash({ run_in_background: true })`; a stopped long `Bun.$` cell restarts the kernel and loses every global, so helpers live in an importable file.
|
|
47
47
|
3. **`Bun.$` runs one command with array-interpolated args; real shell syntax goes to bash.** `${"a b"}` is ONE argument, `$?`/`$VAR` are literal, `for`/`until`/heredocs are parse errors or silent `command not found` with rc 0, and `VAR=x cmd` is not applied to a binary — each of these produced a false-green gate. Use `` $`cmd ${[args]}`.nothrow().quiet() `` for a command and `Bun.spawn(["bash", "-c", script], { env: process.env, stdin: "ignore" })` for a script.
|
|
48
|
-
4. **Every `Bun.spawn` passes `env: process.env`, and re-spawns Bun as `process.execPath
|
|
48
|
+
4. **Every `Bun.spawn` passes `env: process.env`, and re-spawns Bun as `process.execPath` — but only when this runtime IS standalone Bun.** An env-less child gets the environment the process STARTED with (runtime HOME/TMPDIR edits never arrive), and `"bun"` from PATH has resolved to three different shims on our machines. Inside a compiled host (the OmO engine, any `--compile` binary) `process.execPath` is the host binary itself, not Bun: spawning it with a script path starts another agent instead of running the script (omo#12569). There, resolve `bun` through PATH — senpi appends a real Bun shim to PATH — and never hand a script path to an unverified `process.execPath`. Give a child that reads stdin `stdin: "ignore"` or an explicit end, or it waits for EOF forever.
|
|
49
49
|
5. **`bun test` gets its timeout on the command line and exact paths with `./`.** `--timeout N` is the only budget that reaches every file (a preload's `setDefaultTimeout` covers the first file, bunfig's is ignored); a timeout SIGTERMs every child the test spawned, so a database started in `beforeAll` dies with it; `bun test path.ts` without `./` is a substring filter. The full table is in [test](references/test.md) — read it before writing or debugging a suite.
|
|
50
50
|
6. **Measure with the Bun the work targets.** The kernel's `Bun.version`, the shell's `bun --version` and a repo's pinned Bun (CI `bun-version`, `devDependencies.bun`) differ on one machine and 1.4.2 vs 1.4.3 changed test outcomes, so evidence runs use the pin; probe a feature in an empty directory, because `bun check`/`bun fmt`/`bun lint` otherwise run a same-named package.json script. Installs: `CI=1`, visible output, and after `--ignore-scripts` run `node node_modules/bun/install.js` — [install](references/install.md) lists why.
|
|
51
51
|
7. **Read the matching reference before using an unfamiliar API** — signatures and caveats (`Bun.markdown` HTML is unsanitized, HTTP/3 is experimental, `writer({ append: true })` truncated a results file) live there, not here; [session-recipes](references/session-recipes.md) holds the rest of the session-learned traps.
|
|
@@ -40,10 +40,10 @@ proc.resourceUsage(); // { maxRSS, cpuTime: { user, system } } — measure, do n
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
- `stdin: "ignore"` (or write then `.end()` the `FileSink`) for any child that may read stdin: a `bun -e` program reading stdin, or `promisify(execFile)` with `input` (Bun ignores it), waits for EOF forever; under ssh it orphans and blocks later jobs (2026-08-31, 2026-10-30).
|
|
43
|
-
- Re-spawning Bun: use `process.execPath
|
|
43
|
+
- Re-spawning Bun: use `process.execPath` only when this runtime is standalone Bun — `"bun"` from PATH has resolved to three different shims on our machines (a mise shim refused a temp HOME, a stray 1.4.0 shim in `~/.bun/install/global/node_modules/.bin` hung rpc tests, and after a reboot PATH resolved `bun` to a vite-plus shim with shim recursion; the `bun test vX.Y.Z` header line is the tell, 2026-09-28, 10-26, 10-29). Inside a compiled binary `process.execPath` IS the host binary, so spawning it with a script path starts another agent instead of running the script (omo#12569): resolve `bun` through PATH there — senpi appends a real Bun shim to PATH — and never hand a script path to an unverified `process.execPath`. See [build](build.md).
|
|
44
44
|
- `proc.signalCode` is set when a signal is SENT, not when the child exits: a child ignoring SIGTERM keeps running while `signalCode === "SIGTERM"`; await `proc.exited` with a deadline, then `proc.kill("SIGKILL")` (2026-10-02).
|
|
45
45
|
- **The js eval kernel SIGKILLs every `Bun.spawn` child when its cell settles** — four Chromium launches in a row died 0.05-9 s after the launching cell completed, and a child parked in `globalThis` does not survive (2026-09-16/10-17). Anything that must outlive a cell (browser, daemon, dev server, `ssh` running a remote job, a `git commit` with slow hooks) starts through `tool.monitor({ command })` or `tool.bash({ run_in_background: true })`; keep only its id/pid in `globalThis`. Conversely `bun --no-orphans script.ts` makes a script exit when its parent dies and SIGKILL every descendant on exit. A stopped long `Bun.$` cell restarts the whole kernel and loses every global; keep helpers in an importable file and restore with `Object.assign(globalThis, await import(path))` (2026-10-02).
|
|
46
|
-
- IPC with a Bun child: `Bun.spawn([process.execPath, "child.ts"], { env: process.env, ipc(message, child) {} })
|
|
46
|
+
- IPC with a Bun child: `Bun.spawn([process.execPath, "child.ts"], { env: process.env, ipc(message, child) {} })` (standalone Bun only — in a compiled host resolve `bun` through PATH, see above), then `child.send(value)`; the child uses `process.send(value)` and `process.on("message", fn)` (structured-clone values; measured on 1.4.4).
|
|
47
47
|
- PTY: `Bun.spawn(["bash"], { terminal: { cols, rows, data(term, chunk) {} } })` then `proc.terminal.write()/resize()` — replaces node-pty and the macOS `script -q /dev/null` trick.
|
|
48
48
|
- `Bun.spawnSync` blocks the kernel thread and cannot be interrupted: never in an eval cell. `maxBuffer` kills a chatty sync child.
|
|
49
49
|
- `signal: AbortSignal.timeout(ms)` works for `fetch` and `spawn` alike (`killSignal` picks the signal).
|
|
@@ -19,7 +19,7 @@ bun test --check # type-check test file
|
|
|
19
19
|
| `expect(p).rejects` hangs after a Worker reply | `await expect(p).rejects…` reached from the continuation of an awaited Worker message deadlocks (oven-sh/bun#37189, still on 1.4.3) | `const err = await p.then(() => undefined, (e) => e)` then assert on `err` |
|
|
20
20
|
| `mock.module()` reaches every importer | mocking a re-exporting entry replaces the function for modules importing it by relative path too; one file's `mock.module` of a shared logger breaks another file's `spyOn` in the same run (2026-10-26/27) | copy the real namespace first (`{ ...(await import(x)) }`), keep such tests in their own process (`bun test ./x.isolated.test.ts`) or run `--isolate` |
|
|
21
21
|
| Preload patch of a builtin is invisible | a preload's `require("node:os").x = …` reaches product `import * as os` only if nothing ESM-imported that builtin before the patch; Bun snapshots the namespace at first ESM import and `module.syncBuiltinESMExports()` does not help (2026-10-29) | patch before any ESM import of the builtin, or use the product's env seam |
|
|
22
|
-
| Respawned `"bun"` is not this Bun | PATH can resolve to a mise shim or a stray older `bun` in a global `.bin`; the test's `calls.log` ENOENT hid a `--version` exit 1 (2026-09-28, 10-29) | spawn `process.execPath
|
|
22
|
+
| Respawned `"bun"` is not this Bun | PATH can resolve to a mise shim or a stray older `bun` in a global `.bin`; the test's `calls.log` ENOENT hid a `--version` exit 1 (2026-09-28, 10-29) | spawn `process.execPath` — standalone Bun only (in a compiled host it is the host binary; resolve `bun` through PATH there, omo#12569); surface the child's stderr when a stub log is missing |
|
|
23
23
|
| Env-less child misses runtime env | `Bun.spawn` without `env` gives the child the STARTUP environment | `env: process.env` — see [session-recipes](session-recipes.md) |
|
|
24
24
|
| Timed-out test keeps running | the per-test timeout marks the test failed but its body keeps executing; a body awaiting a never-settling promise is not ended at all, and `onTestFinished` runs while it is still awaiting (2026-10-12/16) | own async work in a hook registered before fixture removal; wrap a never-settles RED in an outer `timeout -k 5 <s>` |
|
|
25
25
|
| Shared-helper hooks bind once | an `afterEach`/`afterAll` at module scope of a helper several files import binds only to the FIRST importer; 16 files skipped cleanup and left 106 temp dirs (2026-10-10) | register per call with `onTestFinished(() => …)` inside the helper |
|