Surface socket bind errors; handle old-generation Gemini UA merge order - #512
Open
zhulinchng wants to merge 1 commit into
Open
Surface socket bind errors; handle old-generation Gemini UA merge order#512zhulinchng wants to merge 1 commit into
zhulinchng wants to merge 1 commit into
Conversation
- claude_pty: carry AF_UNIX bind failures out on the server thread so the launch error names the path and reason instead of a bare missing socket. - gemini: correct the UA-override comment for old merge-order builds. - tests: bind first-prompt sockets in short dirs (macOS tmp_path exceeds the AF_UNIX limit); skip Gemini wire-UA assertion with reason where the installed harness overwrites it; add bind-failure + runtime-env tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #511.
What changed
smart_routing/claude_pty.py: new_FirstPromptSocketThreadcarries an AF_UNIX bind failure outward asbind_error;run_claude_ptyincludes the socket path and reason in itsRuntimeError(keeps theClaude was not launchedsuffix). A long$HOMEno longer fails silently.agents/gemini.py: corrected therender_env_overlaycomment — a customUser-AgentinGEMINI_CLI_CUSTOM_HEADERSonly wins on harness builds with the fixed merge order; older builds send their defaultGeminiCLI/...UA. Header itself still sent (forward-compatible; provider routing header unaffected).mkdtempdir mirroring production (_short_socket_dir); Gemini wire-UA assertion stays strict on fixed generations and skips with reason on old ones; newtest_bind_failure_names_the_reasonandtest_carries_custom_headers_override.flowchart TD A[serve_first_prompt_socket] --> B{bind AF_UNIX path} B -->|ok| C[serve hook protocol] B -->|OSError| D[record thread.bind_error, exit] D --> E[launch error: path + reason + '; Claude was not launched'] F[tests bind in short dir] --> CVerification
main(see macOS: first-prompt socket fails silently on long paths; Gemini UA override dropped by old harness generations #511); new regression test proven fail-before viagit stash(AttributeError: 'Thread' object has no attribute 'bind_error'pre-fix).pytest --ignore=tests/test_e2e.py --ignore=tests/test_e2e_tracing.py: 2266 passed, 8 skipped (was 2262 passed, 7 skipped, 3 failed). Includesruff check,ruff format --check,ty checkviatest_lint.py, plus live Gemini-wire and live PTY/socket harness tests.test_e2e*.pynot run — noUCODE_TEST_WORKSPACEbearer here.