Skip to content

Commit ea025cd

Browse files
fix: Codex 26.602+ pipe discovery (backslash separator)
Codex Desktop 26.602+ creates pipes as 'codex-browser-use\<uuid>' instead of 'codex-browser-use-<uuid>'. PowerShell Get-ChildItem treats backslash as a directory separator and silently skips these pipes, causing 'no pipes found' or 'all pipes failed' errors. - Switch to [System.IO.Directory]::GetFileSystemEntries + substring extraction to discover both old and new format pipes - extractUUID handles both '-' and '\' separators - Raise spurious warning threshold from >1 to >2 pipes (coexistence is normal during Codex upgrades) Smoke tested: get_info, create_tab, navigate, screenshot, close_tab all pass against Codex Desktop 26.602.3474.0. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 23fb954 commit ea025cd

5 files changed

Lines changed: 33 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.5.0] - 2026-06-05
6+
7+
### Fixed
8+
9+
- **Pipe discovery broken after Codex Desktop 26.602+**: Newer Codex versions create pipe names with backslash separators (`codex-browser-use\<uuid>`) which PowerShell's `Get-ChildItem` treats as directories and skips. Switched to `[System.IO.Directory]::GetFileSystemEntries` and manual prefix stripping to discover both formats.
10+
- **`extractUUID` updated** to strip both `-` and `\` separators after the `codex-browser-use` prefix.
11+
- **Pipe warning threshold** raised from >1 to >2, since old-format and new-format pipes legitimately coexist during Codex upgrades.
12+
513
## [0.3.0] - 2026-05-19
614

715
### Fixed

ROADMAP.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# ROADMAP
22

3+
## v1.5.0 — Codex 26.602+ Pipe Discovery Fix (2026-06-05)
4+
5+
Codex Desktop 26.602+ changed pipe naming from `codex-browser-use-<uuid>` to `codex-browser-use\<uuid>`. The old PowerShell `Get-ChildItem` discovery treated `\` as a directory separator and missed new-format pipes entirely.
6+
7+
### Fixed
8+
- [x] **DISC-01** `discovery.go``Get-ChildItem``[System.IO.Directory]::GetFileSystemEntries` + substring extraction
9+
- [x] **DISC-02** `discovery.go``extractUUID` handles both `-` and `\` separators
10+
- [x] **DISC-03** `client.go` — Warning threshold `> 1``> 2` (old + new pipes coexist normally)
11+
12+
### Verified
13+
- Smoke test: `get_info``create_tab``navigate``screenshot``close_tab`
14+
- All existing unit tests pass (`go test ./...`)
15+
- go vet clean
16+
17+
---
18+
319
## v0.3.0 — Bug Fixes from Cross-Audit (2026-05-19)
420

521
30 bugs found by parallel audit. Fixed in 4 batches.

internal/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func Connect(pipeName string, logger *log.Logger) (*Client, error) {
5555
// The pipe prefix namespace is flat: any local process can create pipes with
5656
// the "codex-browser-use-" prefix. When multiple pipes exist, an attacker
5757
// could register a fake pipe before the legitimate Codex Desktop starts.
58-
if len(pipes) > 1 && logger != nil {
58+
if len(pipes) > 2 && logger != nil {
5959
logger.Printf("Warning: multiple codex-browser-use pipes found (%d). This may indicate stale or unauthorized pipes.", len(pipes))
6060
}
6161

internal/discovery/discovery.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ type PipeInfo struct {
1616
UUID string
1717
}
1818

19-
// DiscoverCodexPipes lists Windows named pipes matching codex-browser-use-*
19+
// DiscoverCodexPipes lists Windows named pipes matching codex-browser-use*
20+
// Uses [System.IO.Directory]::GetFiles instead of Get-ChildItem because newer
21+
// Codex versions create pipes with backslash separators (e.g. "codex-browser-use\<uuid>")
22+
// which Get-ChildItem treats as directories and skips.
2023
func DiscoverCodexPipes() ([]PipeInfo, error) {
2124
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
2225
defer cancel()
2326
cmd := exec.CommandContext(ctx, "powershell", "-NoProfile", "-Command",
24-
"Get-ChildItem '\\\\.\\pipe\\' | Select-Object -ExpandProperty Name")
27+
"$d='\\\\.\\pipe\\'; [System.IO.Directory]::GetFileSystemEntries($d) | Where-Object { $_ -like '*codex-browser*' } | ForEach-Object { $_.Substring($d.Length) }")
2528
out, err := cmd.Output()
2629
if err != nil {
2730
return nil, fmt.Errorf("enumerate pipes: %w", err)
@@ -41,8 +44,8 @@ func parsePipeList(output string) []PipeInfo {
4144
return pipes
4245
}
4346

44-
// extractUUID strips the "codex-browser-use-" prefix from a pipe name.
45-
// Returns "" if the name has no separator after the prefix.
47+
// extractUUID strips the "codex-browser-use" prefix (and separator) from a pipe name.
48+
// Handles both old format "codex-browser-use-<uuid>" and new format "codex-browser-use\<uuid>".
4649
func extractUUID(name string) string {
4750
rest := strings.TrimPrefix(name, codexPipePrefix)
4851
if len(rest) > 0 && (rest[0] == '-' || rest[0] == '\\') {

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@delicious233/codex-browser-bridge",
3-
"version": "0.3.0",
3+
"version": "1.5.0",
44
"private": false,
55
"description": "MCP server that exposes Codex Desktop's Chrome browser bridge for Claude Code and other agents.",
66
"bin": {

0 commit comments

Comments
 (0)