fix(prompt): use HOME env var over expanduser for system prompt - #7
Open
liuhao1024 wants to merge 1 commit into
Open
liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
Fixes NousResearch#63093 The system prompt reported 'User home directory: /opt/data' (CWD) instead of the actual HOME value '/opt/data/home' in container environments. os.path.expanduser('~') may return incorrect paths in some container setups; HOME env var is the authoritative source.
liuhao1024
pushed a commit
that referenced
this pull request
Aug 15, 2026
…ovider Cancelling the API-key prompt mid-wizard (Enter → 'Cancelled.') let the wizard continue through Terminal/Gateway/Tools and finish 'successfully' with no model configured — the user exits believing they're set up, then hits a broken chat. _print_setup_summary() (called by every setup path: full, quick, blank-slate, portal) now probes resolve_provider() and, when nothing is configured, prints an unmissable warning with the two one-line fixes (hermes model / hermes setup --portal). Consumer-onboarding audit finding #7 (sev 4), Aug 2026.
liuhao1024
pushed a commit
that referenced
this pull request
Aug 15, 2026
… (re-review #7) - website/docs/user-guide/configuration.md (en) and the zh-Hans translation gain a 'Session Stall Watchdog' section: default 300, 0=disabled, notify-only semantics (never kills the turn — contrast gateway_timeout), one notification per stall episode, and the exact stall message text so it is greppable. - cli-config.yaml.example: the two in-agent compression timeout keys (compression.context_timeout_seconds / compression.context_total_ceiling_seconds) are shown as commented lines next to session_stall_timeout's example for discoverability.
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?
Fixes a bug where the system prompt reported an incorrect "User home directory" value in container environments. The prompt displayed
/opt/data(the CWD) instead of the actual$HOMEvalue/opt/data/home.The root cause:
os.path.expanduser('~')may return incorrect paths in some container setups where the$HOMEenvironment variable is the authoritative source. This PR prioritizes$HOMEoveros.path.expanduser('~').Related Issue
Fixes NousResearch#63093
Type of Change
Changes Made
agent/prompt_builder.py: ChangedUser home directory: {os.path.expanduser('~')}toUser home directory: {os.environ.get('HOME', os.path.expanduser('~'))}(1 line)tests/agent/test_prompt_builder.py: Added regression testtest_build_environment_hints_uses_home_env_over_expanduser(13 lines)How to Test
$HOMEdiffers from CWD (e.g.,HOME=/opt/data/home, CWD=/opt/data)localterminal backendUser home directory: /opt/data/home(matching$HOME) instead of/opt/dataTest coverage:
pytest tests/agent/test_prompt_builder.py -k "uses_home_env"should pass.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A