Skip to content

Commit 7b15470

Browse files
cliffhallclaude
andcommitted
fix: say the spawned server inherits the SDK's env safelist, not nothing
Copilot round 3 on #4921. A stdio child started by the SDK transport (and so by the Inspector) receives PATH, HOME, USER and the rest of the default safelist; it is the caller's other variables that do not reach it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent fb86c82 commit 7b15470

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎.claude/skills/client-smoke/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ That rule produces the three failures people actually hit:
9292

9393
### Environment variables
9494

95-
The spawned server does **not** inherit your shell's environment. Setting
95+
The spawned server gets only the SDK's default safelist from your shell
96+
(`PATH`, `HOME`, `USER` and the like), not the variables you set. Setting
9697
`MEMORY_FILE_PATH=… npx …` has no effect on the server; pass it with `-e`:
9798

9899
```sh

‎.claude/skills/testing/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ await client.close(); // this is what stops the child process
140140

141141
`src/sequentialthinking/__tests__/input-schema.test.ts` is the reference.
142142
`stderr: "pipe"` keeps the server's startup banner off the console. Pass a
143-
server's environment with the transport's `env` option; the child does not
144-
inherit the test process's variables.
143+
server's configuration with the transport's `env` option: the child inherits
144+
only the SDK's default safelist (`PATH`, `HOME`, `USER` and the like), not the
145+
other variables of the test process.
145146

146147
⚠️ **These tests run the last build, not your edit.** `npm test` does not build.
147148
A test that spawns `dist/index.js` passes or fails on whatever `tsc` last

0 commit comments

Comments
 (0)