@code-yeongyu/senpi-codemode 2026.11.9-2 → 2026.11.10-1

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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [2026.11.10-1] - 2026-11-10
4
+
5
+ ### Breaking Changes
6
+
7
+ ### Added
8
+
9
+ ### Changed
10
+
11
+ ### Fixed
12
+
13
+ - `agent()`, `output()` and the eval prompt's spawn helpers keep working when the task tools are eval-only (`exposure: "eval"`, withheld from the model while eval exists), and an eval-only tool's kernel prelude stays loaded ([#6276](https://github.com/code-yeongyu/senpi/pull/6276))
14
+
15
+ ### Removed
16
+
17
+ ## [2026.11.10] - 2026-11-10
18
+
19
+ ### Breaking Changes
20
+
21
+ ### Added
22
+
23
+ ### Changed
24
+
25
+ ### Fixed
26
+
27
+ - 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))
28
+ - Hide the console window for installer and kernel subprocess spawns on Windows ([#3965](https://github.com/code-yeongyu/senpi/issues/3965))
29
+
30
+ ### Removed
31
+
3
32
  ## [2026.11.9-2] - 2026-11-09
4
33
 
5
34
  ### Breaking Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-codemode",
3
- "version": "2026.11.9-2",
3
+ "version": "2026.11.10-1",
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.9-2",
36
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.10-1",
37
37
  "quickjs-wasi": "3.6.2",
38
38
  "typebox": "1.3.34"
39
39
  },
40
40
  "peerDependencies": {
41
- "@code-yeongyu/senpi": "2026.11.9-2"
41
+ "@code-yeongyu/senpi": "2026.11.10-1"
42
42
  },
43
43
  "devDependencies": {
44
- "@code-yeongyu/senpi": "2026.11.9-2"
44
+ "@code-yeongyu/senpi": "2026.11.10-1"
45
45
  },
46
46
  "keywords": [
47
47
  "senpi",
@@ -13,6 +13,7 @@ type SchemaArgs = Static<typeof schemaArgsSchema>;
13
13
  export interface EvalSchemaToolInfo {
14
14
  readonly name: string;
15
15
  readonly description?: string | undefined;
16
+ readonly exposure?: string | undefined;
16
17
  readonly parameters?: unknown;
17
18
  readonly kernelPrelude?: KernelPreludeContribution | undefined;
18
19
  }
@@ -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;
@@ -1,14 +1,16 @@
1
1
  import type { KernelPreludeContribution } from "@code-yeongyu/senpi";
2
2
  import type { CodemodeRuntimeAPI } from "./runtime-factory.ts";
3
+ import { reachableToolNames } from "./reachable-tools.ts";
3
4
 
4
5
  type ToolRegistry = Pick<CodemodeRuntimeAPI, "getActiveTools" | "getAllTools">;
5
6
 
6
7
  /**
7
- * Kernel globals of the tools active right now. Read per cell, so a tool activated by `tool_search`, a by-name
8
- * call, or a command shows up in the next cell and a deactivated one disappears, whatever the registration order.
8
+ * Kernel globals of the tools a cell can reach right now (active, or eval-exposed and withheld from the model).
9
+ * Read per cell, so a tool activated by `tool_search`, a by-name call, or a command shows up in the next cell
10
+ * and a deactivated one disappears, whatever the registration order.
9
11
  */
10
12
  export function activeKernelPreludes(pi: ToolRegistry): readonly KernelPreludeContribution[] {
11
- const active = new Set(pi.getActiveTools());
13
+ const active = reachableToolNames(pi);
12
14
  return pi.getAllTools().flatMap((tool) => (tool.kernelPrelude && active.has(tool.name) ? [tool.kernelPrelude] : []));
13
15
  }
14
16
 
@@ -0,0 +1,31 @@
1
+ import type { EvalSchemaToolInfo } from "../bridges/schema-bridge.ts";
2
+
3
+ export interface ReachableToolRegistry {
4
+ getActiveTools(): string[];
5
+ getAllTools(): readonly EvalSchemaToolInfo[];
6
+ }
7
+
8
+ /**
9
+ * The tools a cell can call: the model-visible active tools plus every registered tool whose declared
10
+ * exposure is `eval`. The session withholds an eval-exposed tool from the model whenever eval itself is
11
+ * registered (bash, grep, glob, generate_image, a plugin's thread_* or task_* family), so it is absent
12
+ * from `getActiveTools()` while `executeTool` still reaches it; reading only the active list made
13
+ * `agent()`/`output()` report the task tool unavailable and dropped its kernel prelude the moment it
14
+ * became eval-only (senpi#6269 follow-up).
15
+ */
16
+ export function reachableToolNames(pi: ReachableToolRegistry): Set<string> {
17
+ const names = new Set(pi.getActiveTools());
18
+ for (const tool of registeredTools(pi)) if (tool.exposure === "eval") names.add(tool.name);
19
+ return names;
20
+ }
21
+
22
+ // The loader's registry methods throw until the runtime binds (the dedupe probe in
23
+ // coding-agent's codemode-builtin-dedupe.test.ts registers eval before that point); an
24
+ // unreadable registry adds nothing, like promptKernelPreludes.
25
+ function registeredTools(pi: ReachableToolRegistry): readonly EvalSchemaToolInfo[] {
26
+ try {
27
+ return pi.getAllTools();
28
+ } catch {
29
+ return [];
30
+ }
31
+ }
@@ -27,6 +27,7 @@ import { processRuntimeInfo } from "../kernels/js/process-worker.ts";
27
27
  import { sessionEnvironmentFrom } from "../kernels/session-env.ts";
28
28
  import { resolveSessionArtifactsDir } from "../output/streaming-output.ts";
29
29
  import type { EnabledEvalLanguages, EvalLanguage, EvalRuntimes } from "../tool/types.ts";
30
+ import { reachableToolNames } from "./reachable-tools.ts";
30
31
  import { jsRuntimeInfo, runtimesFromAvailability } from "./runtime-info.ts";
31
32
  import {
32
33
  type CodemodeSessionManager,
@@ -90,7 +91,7 @@ export async function createRuntime(
90
91
  const enabledLanguages = enabledLanguagesFrom(settings, availability);
91
92
  const jsProcessIsolation = resolveJsIsolation(settings) === "process";
92
93
  const artifacts = resolveSessionArtifactsDir(ctx.sessionManager.getSessionFile());
93
- const activeTools = new Set(pi.getActiveTools());
94
+ const activeTools = reachableToolNames(pi);
94
95
  const executeTool = createExecuteTool(pi, activeTools);
95
96
  const create = options.createSessionManager ?? createCodemodeSessionManager;
96
97
  const sessionId = sessionIdFrom(event);
@@ -166,7 +167,7 @@ export function createExecuteTool(pi: CodemodeRuntimeAPI, activeTools?: Readonly
166
167
  const executeTool: AgentExecuteTool = (toolName, params, executeOptions) =>
167
168
  pi.executeTool(toolName, params, { ...executeOptions, activateInactiveTool: true });
168
169
  return Object.assign(executeTool, {
169
- isToolAvailable: (name: string): boolean => activeTools?.has(name) ?? pi.getActiveTools().includes(name),
170
+ isToolAvailable: (name: string): boolean => (activeTools ?? reachableToolNames(pi)).has(name),
170
171
  });
171
172
  }
172
173
 
@@ -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;
@@ -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`.** 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. Give a child that reads stdin `stdin: "ignore"` or an explicit end, or it waits for EOF forever.
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`, never `"bun"` from PATH — 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 `bun` can be the binary itself — see [build](build.md).
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) {} })`, then `child.send(value)`; the child uses `process.send(value)` and `process.on("message", fn)` (structured-clone values; measured on 1.4.4).
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`; surface the child's stderr when a stub log is missing |
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 |