Repository navigation
Conversation
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?
The local runtime prompt names the operating system and home directory but omits effective identity and the actual terminal shell. This leaves the agent to infer privileges from names and to assume the user's login shell or Linux interfaces on macOS.
Extend the existing startup environment block with the local bash backend, a cheap POSIX effective-UID snapshot, and a short macOS/BSD compatibility note. Explicitly distinguish process identity from sudo availability, authorization and remote privileges. Remote backends continue to receive only their own environment block.
Related Issue
Searched existing effective-UID/environment reports; the matching results concern updater ownership and container UID mapping rather than the local agent prompt.
Type of Change
Changes Made
hermes_platform/host/identity.py: read-only identity snapshot, no subprocesses, environment-variable input or sudo probes.agent/prompt_builder.py: use the existing environment block; avoid changing any past context or per-call tool surface.tests/agent/test_environment_execution_identity.py: native-host identity/macOS checks and remote-host separation.How to Test
Before patching: two new native-macOS tests failed; the remote-isolation case passed. After patching: 60 tests passed, one platform-specific test skipped on macOS. All 14 lint/code-health checks pass on the independent branch.
Limitations
The identity is a new-session snapshot; it is not refreshed by mutating a cached conversation prefix. Windows elevation is deliberately not inferred from POSIX UID rules. No claim is made that this prompt addition has yet improved a held-out model benchmark.
Checklist
python scripts/check: all 14 checks pass on this branch.Only synthetic reproductions are included. No private session, credentials, host inventory or security scan output is published.