Skip to content

Commit 946d236

Browse files
mmhiyokoclaude
andauthored
fix: use ~/.agent-browser for socket files instead of TMPDIR (#180)
* fix: use ~/.agent-browser for socket files instead of TMPDIR This fixes issue #163 where different TMPDIR values (common with tmux/screen/VSCode/IntelliJ) caused the CLI and daemon to use different socket paths. Socket directory priority: 1. AGENT_BROWSER_SOCKET_DIR (explicit override) 2. $XDG_RUNTIME_DIR/agent-browser (Linux standard) 3. ~/.agent-browser (fallback, like Docker Desktop) Both CLI (Rust) and daemon (Node.js) now use the same logic. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: session list now looks in correct socket directory - Make get_socket_dir() public in connection.rs - Update session list to use get_socket_dir() instead of temp_dir() - Update pid file pattern from agent-browser-{session}.pid to {session}.pid - Add tmpdir fallback to daemon.ts when homedir is unavailable Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test: add unit tests for socket directory resolution Add comprehensive tests for get_socket_dir/getSocketDir to verify: - AGENT_BROWSER_SOCKET_DIR takes priority - Empty strings are ignored (fixes Rust/TypeScript consistency) - XDG_RUNTIME_DIR fallback works correctly - Home directory fallback when env vars unset Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cb37630 commit 946d236

6 files changed

Lines changed: 401 additions & 30 deletions

File tree

cli/Cargo.lock

Lines changed: 173 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ license = "Apache-2.0"
88
[dependencies]
99
serde = { version = "1.0", features = ["derive"] }
1010
serde_json = "1.0"
11+
dirs = "5.0"
1112

1213
[target.'cfg(unix)'.dependencies]
1314
libc = "0.2"

0 commit comments

Comments
 (0)