run_code: process.stdout writes from agent code corrupt the stdio transport
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- tooling
Direzione di ricerca
Start at packages/wdio-session/src/exec/context.ts lines 180-200 where process is handed to agent code, and compare with the console.* reassignment in src/server.ts to see why one is captured and the other is not. Option 1 is the stated home: make the context's stdout/stderr write into the same capture that exec already uses, which also means checking every write still reaching the real stdio JSON-RPC stream. The tricky part is Option 2's process-wide swap and concurrent sessions, so expect reading the transport code before deciding. Done looks like a run_code call whose agent code writes to process.stdout leaving the MCP connection intact.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Target: feature/v5. Depends on: #197 (run_code exists only in #197, on feature/v5), and webdriverio/webdriverio#16495 for the engine fix.
Problem. Code run by run_code runs in the MCP server's own process. @wdio/session routes console inside exec to its output capture, but the context also exposes process, and process.stdout.write isn't captured. src/server.ts reassigns only console.* to stderr (src/server.ts:100). One process.stdout.write('…') in agent-written code puts bytes into the stdio JSON-RPC stream and breaks the connection.
This isn't specific to the model being malicious: libraries imported with await import(…) inside run_code can write to stdout too.
Fix. Blocked on webdriverio/webdriverio#16495 (opt-in restricted exec context without process). That is the right home: it protects the stdio transport and the CLI's JSON output alike. On release, bump @wdio/session and add a test that process.stdout.write inside run_code doesn't reach the transport.
Interim. Swapping process.stdout.write inside the MCP server was rejected: the swap is process-wide, so it races the transport's own writes and concurrent sessions. Until the bump, document the hazard in the run_code tool description.
Acceptance
- After the bump: a test shows that
process.stdout.writeinsiderun_codedoes not reach the transport.
- Lingua principale
- TypeScript
- Stelle
- 45
- Fork
- 20
- Merge medio
- 2g 9h
- PR unite (30g)
- 16
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di webdriverio/mcp
-
Issue templates with a required 'MCP client' fieldForse già presa @Winify l’ha presa 4 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
webdriverio/mcp#208 ·
I maintainer di solito rispondono entro 2 giorni
-
v5: record per-step code from the @wdio/session agent history and drop MCP's per-action templatesAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
webdriverio/mcp#214 ·
I maintainer di solito rispondono entro 2 giorni
-
Generated code skips switch_context, rotate_device, hide_keyboard, switch_tab and emulate_deviceForse già presa @VB-Blue l’ha presa 2 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
webdriverio/mcp#213 ·
I maintainer di solito rispondono entro 2 giorni
-
WDIO_MCP_TOOLS=code: a fixed code-mode tool set (session, navigate, snapshot, query_docs, run_code)Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
webdriverio/mcp#212 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 3/5 Mezza giornata Idoneità per principianti 65/100
webdriverio/mcp#206 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di webdriverio/mcp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
rel: fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Deltares/fews-web-oc#2400 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
ardia-browser/ardia#4426 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timeForse già presa @bardrop l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
pnp/cli-microsoft365#7713 ·
I maintainer di solito rispondono entro 1 giorno
-
Diagram: Journey Type: Bug / Error
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
mermaid-js/mermaid-v13#1293 ·
I maintainer di solito rispondono entro 1 giorno