Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug]: can't run npm script directly in background

Abierto
#37 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
bun, typescript
Área
cli, tooling

Línea de trabajo

Empieza reproduciendo el caso de Windows 11 con pty_spawn: compara iniciar npm run dev directamente con iniciarlo mediante pwsh -Command. El issue estará resuelto cuando la invocación directa de npm inicie correctamente el servidor de desarrollo en segundo plano, igual que la ruta funcional de PowerShell.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Description

If I say run dev server in the background it will fail, but when I say run pwsh in background and run dev server it will succeed.

Reproduction Steps

Steps to reproduce the behavior:

  1. Configure plugin in opencode.json
  2. Run opencode
  3. Use pty_spawn with '...'
  4. See error

Expected Behavior

will succeed with the first prompt

Environment

  • OS: [Windows 11]
  • OpenCode Version: [1.14.46]
  • Plugin Version: [1.1.0]
  • Bun Version: [1.3.2]

OpenCode Configuration

opencode.json (sanitized)
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-pty"],
}

Debug Logs

Click to expand debug logs

To get debug logs, run OpenCode with debug logging enabled:

opencode --log-level DEBUG --print-logs

Or check log files in ~/.local/share/opencode/logs/.

[Paste relevant log output here]

Additional Context

Run dev server in background

Session ID: ses_1edb97631ffe6ZvMa6sfEGGija
Created: 2026/5/10 22:24:33
Updated: 2026/5/10 22:26:26


User

run npm dev in background


Assistant (Build · MiniMax M2.5 Free · 22.2s)

Thinking:

The user wants to run npm dev in the background. Based on the AGENTS.md file, the dev server is started with npm run dev which runs wrangler dev. I'll spawn a PTY session to run this in the background.

Tool: pty_spawn

Input:

{
  "args": [
    "npm",
    "run",
    "dev"
  ],
  "command": "npm",
  "description": "Start wrangler dev server",
  "title": "Dev Server",
  "workdir": "C:\\Users\\marv\\workspace\\web-push\\web-push-demo"
}

Error:

PTY spawn failed

Assistant (Build · MiniMax M2.5 Free · 7.0s)

Thinking:

The PTY spawn failed. Let me try using the regular bash tool instead.

Tool: bash

Input:

{}

Error:

Tool execution aborted

User

run pwsh in background and run npm run dev


Assistant (Build · MiniMax M2.5 Free · 38.7s)

Thinking:

The user wants me to run PowerShell in background and execute npm run dev inside it.

Tool: pty_spawn

Input:

{
  "args": [
    "-Command",
    "npm run dev"
  ],
  "command": "pwsh",
  "description": "Start PowerShell and run npm dev",
  "title": "PowerShell - npm dev",
  "workdir": "C:\\Users\\marv\\workspace\\web-push\\web-push-demo"
}

Output:

<pty_spawned>
ID: pty_de4e9361
Title: PowerShell - npm dev
Command: pwsh -Command npm run dev
Workdir: C:\Users\marv\workspace\web-push\web-push-demo
PID: 17544
Status: running
NotifyOnExit: false
</pty_spawned>

Assistant (Build · MiniMax M2.5 Free · 13.3s)

Thinking:

Good, the PTY is now running. Let me read the output to see what happened.

Tool: pty_read

Input:

{
  "id": "pty_de4e9361"
}

Output:

<pty_output id="pty_de4e9361" status="running">
00001| [?9001h[?1004h[?25l]0;C:\Program Files\PowerShell\7\pwsh.EXE[?25h]0;npm]0;npm run dev[?25l
00002| > [email protected] dev
00003| > wrangler dev[?25h[?25l▲ [WARNING] Proxy environment variables detected. We'll use your proxy for fetch requests.[?25h
00004|  ⛅️ wrangler 4.90.0
00005| ───────────────────
00006| Using secrets defined in .dev.vars
00007| [?25lYour Worker has access to the following bindings:
00008| BindingResourceMode
00009| env.SUBSCRIPTIONS (5d719287afde409cb0d1b14a6ac35b6f)KV Namespacelocal
00010| env.VAPID_PUBLIC_KEY ("BPmnIMURw_-4ZhdbSFwOo2omSCGYXsJm-SIe4...")       Environment Variable      local
00011| env.VAPID_SUBJECT ("mailto:[email protected]")Environment Variable      local
00012| env.VAPID_PRIVATE_KEY ("(hidden)")Environment Variable      local[?25h╭──────────────────────────────────────────────────────────────────────────────────────────────╮
00013| │  [b] open a browser [d] open devtools [e] open local explorer [c] clear console [x] to exit  │
00014| ╰──────────────────────────────────────────────────────────────────────────────────────────────╯
00015| ⎔ Starting local server...
00016| [?25l▲ [WARNING] Scheduled Workers are not automatically triggered during local development.  To manually trigger a scheduled event, run:
00017|     curl "http://127.0.0.1:8787/cdn-cgi/handler/scheduled"
00018|   For more details, see
00019|   https://developers.cloudflare.com/workers/configuration/cron-triggers/#test-cron-triggers-locally[?25h[wrangler:info] Ready on http://127.0.0.1:8787

(End of buffer - total 19 lines)
</pty_output>

Assistant (Build · MiniMax M2.5 Free · 7.9s)

Thinking:

The dev server is running successfully on http://127.0.0.1:8787


Lenguaje dominante
TypeScript
Estrellas
597
Forks
65
Merge medio
1 d 20 h
PR fusionados (30 d)
3

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de shekohex/opencode-pty

Todos los issues de shekohex/opencode-pty

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.