Repository navigation
Find the Linux user session bus when agents drop its variables - #45
Merged
Merged
Conversation
Codex and the Cursor agent start stdio MCP servers with a reduced environment that has neither DBUS_SESSION_BUS_ADDRESS nor XDG_RUNTIME_DIR. The keychain library finds the Secret Service bus only through those variables, so `proofline mcp` reported the keychain as unavailable and could not use the credential that `proofline login` stored. When neither variable is set and /run/user/<uid>/bus is a socket, the CLI now points DBUS_SESSION_BUS_ADDRESS at it before any thread starts. An address or runtime directory in the environment still wins, and the PROOFLINE_TOKEN fallback message is unchanged. Entries that are already installed pick this up without a configuration change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mohsen1
marked this pull request as ready for review
November 7, 2026 07:09
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.
On Linux,
proofline mcpcould not read the stored sign-in when Codex or the Cursor agent started it. Both start stdio MCP servers with a reduced environment: Codex passesHOME LANG NODE_EXTRA_CA_CERTS PATH PWD SSL_CERT_FILE TERM, and the Cursor agent passesHOME PATH PWD TERM. The keychain library finds the Secret Service bus only throughDBUS_SESSION_BUS_ADDRESSor$XDG_RUNTIME_DIR/bus, so the server failed with:Change
credentials::default_session_busreturnsunix:path=/run/user/<uid>/buswhen neither variable is set and that path is a socket. systemd and elogind serve the user bus there. The uid comes from the owner of/proc/self.mainsetsDBUS_SESSION_BUS_ADDRESSto that address as its first statement, before the update check can start a thread. The keychain library opens the bus with libdbus'sConnection::new_session(), which reads the address only from the environment. In edition 2024set_varisunsafe, so the workspace lint moves fromforbidtodeny, and this one call carries#[expect(unsafe_code, reason = ...)]and aSAFETYcomment.PROOFLINE_TOKENfallback message is unchanged.proofline agent installalready wrote get the fix without a configuration change.Verification
cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass: 93 passed, 1 ignored, including the newcredentials::tests::user_bus_is_used_only_when_the_environment_names_no_bus.python3 -m unittest discover -s scripts -p 'test_*.py'passes.x86_64-unknown-linux-muslrelease build. A user bus ran at/run/user/0/buswith an unlockedgnome-keyring 46.1, and each host ran in a freshHOMEaftercurl -fsSL https://proofline.sh/cli | sh -s -- --setup:codex exec(codex-cli 0.167.0)not signed in to https://proofline.sh; run proofline login, or set PROOFLINE_TOKENproofline.shanswersHTTP 401(with only Codex's variables plus an HTTPS proxy)cursor-agent mcp list-tools proofline(2026.11.05-86047df)not signed in …The MCP configuration files that the installer wrote were byte-for-byte the same before and after.
Generated by Claude Code