Repository navigation
Commit 3bb83d3
fix(server): strip desktop launcher environment before providers start (#1766)
## Problem
Provider children inherit desktop placement and CDP settings from the development launcher.
Closes #1615 (`Closes #1615`).
## Change
Scrub every `T3CODE_DESKTOP_*` key at the existing server-start environment boundary, alongside inherited session IDs.
This covers adapters that re-inherit `process.env` and in-process SDKs; Electron retains its separate launcher environment.
Rename the helper and update its one startup call and existing test.
```ts
for (const key of Object.keys(environment)) {
if (key.toUpperCase().startsWith("T3CODE_DESKTOP_")) {
delete environment[key];
}
}
```
## Scope and approval
Host-approved, focused fix for the existing launcher leak; no UI, wire contract, or provider-specific implementation.
The initial per-provider environment patch was removed.
Claim was skipped at the host's direction after this refusal; the issue remains unassigned and untriaged:
```text
✗ Error: #1615 is parentless and still Untriaged 📥, and a claim moves it off the entry Status, so Standalone 📍 would be written by nobody's judgement.
Review the open trackers, projects, and slices with ghb work, then take one of the two moves:
home it ghb issue edit #1615 --parent ISSUE --no-relationship — use the truthful relationship flag
judge it ghb issue claim #1615 --standalone — records independence from the other open work
```
### Close conditions
- [x] **Children:** no `T3CODE_DESKTOP_*` values
## Verification
- [x] Focused tests: 17 passed, 0 failed
`vp test run apps/server/src/provider/providerSessionEnvironment.fork.test.ts apps/server/src/provider/providerSessionEnvironment.test.ts` → exit 0
The extended test covers current launcher keys, a future key with an empty value, case-insensitive matching, inherited session IDs, and preservation of PATH, credentials, and the non-prefix `T3CODE_DESKTOP` key.
- [x] Targeted typecheck: both packages passed
`vp run --filter @t3tools/provider-core --filter t3 typecheck` → exit 0
- [x] Targeted lint and formatting passed
- [x] Server production bundle passed
`vp run --filter t3 build:bundle` → exit 0
- [x] Fork gate: 762 script tests passed
`vp run fork:ci` → exit 0
## Grounding
**Claim:** with `T3CODE_DESKTOP_*` set on the server, its terminal and provider children see none.
- **Build:** local `ground/wave1` `e81b07cb04`
- **Contents:** heads of three wave-1 PRs
- **Server env:** two `T3CODE_DESKTOP_*` probe keys
- **Server environ:** both keys present
- **Plain shell:** `PPID` is the server; 0 keys
- **Claude turn:** Bash `env` reports `count=0 none`
- **Provider process environ:** 0 keys


**Not grounded:** Electron desktop placement and CDP debugging.
No server code reads `T3CODE_DESKTOP_*`; Electron keeps its own launcher environment.
Model/harness: gpt-6.1-sol / Pi.
## Fork trailers
Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: no
Co-authored-by: donjor <[email protected]>1 parent 545c871 commit 3bb83d3
3 files changed
Lines changed: 39 additions & 17 deletions
File tree
- apps/server/src
- cli
- provider
- packages/provider-core/src/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
60 | 77 | | |
61 | 78 | | |
62 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
0 commit comments