Repository navigation
Conversation
Addresses @lorencato23 review on PR NousResearch#102192: - Fail closed when socket.gethostname() raises OSError or returns empty - Add regression tests for gethostname failure modes - Document hostname as host anchoring, not authentication boundary - Add same-hostname/different-profile test to make limitation visible
PR #102436 — harden hostname anchoring against gethostname failuresVerdict: Looks good. Thoughtful host-anchoring for DB-synced prompts with honest scoping (anchoring, not auth — stated in the comment) and fail-closed behavior on unreadable hostnames. What the change does
Non-blocking
Tests: The same-host/different-profile test pins the anchoring-vs-auth boundary explicitly. Good. |
This branch has not been deployed
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.
What does this PR do?
Addresses @lorencato23 review hardening points on PR #102192 (stop synchronized sessions from misidentifying the active host).
Changes
**Fail closed when raises ** — the previous code silently skipped the hostname check when failed, which meant a local stored prompt could be treated as verified when it shouldn't be. Now we reject the stored prompt.
Fail closed when returns empty string — same conservative behavior: reject the stored prompt rather than silently treating it as verified.
Regression tests for failure modes — added tests in both and covering:
Document hostname as host anchoring, not authentication — added comments explaining that hostname is a useful human-readable signal but not a globally unique gateway identity (two cloned VMs can share a hostname).
Same-hostname/different-profile test — makes the remaining limitation visible and prevents future overclaiming of the guarantee.
Type of Change
How to Test
Related