Skip to content

fix(cli): honor explicit workspace cwd for local backends - #50649

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/50017-desktop-local-cwd
Closed

LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/50017-desktop-local-cwd

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • honor launcher-provided HERMES_CWD before falling back to os.getcwd() for local backends
  • keep exporting the resolved workspace through TERMINAL_CWD so Desktop/TUI tool calls follow the selected project
  • add cwd regression coverage for the config bridge and the real load_cli_config() path

Testing

  • uv run --frozen pytest tests/cli/test_cwd_env_respect.py tests/cli/test_cli_init.py -q
  • uv run --frozen ruff check cli.py tests/cli/test_cwd_env_respect.py tests/cli/test_cli_init.py
  • git diff --check

Fixes #50017

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels Jun 22, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused fix. Current main now provides the requested Desktop workspace behavior through session-specific cwd propagation, so this PR is redundant.

Automated hermes-sweeper review evidence:

  • Desktop resolves the selected workspace and includes it in session.create: apps/desktop/src/app/session/hooks/use-session-actions/index.ts:196-206.
  • The gateway validates, stores, registers, and persists that explicit session cwd: tui_gateway/server.py:1861-1887.
  • Regression coverage verifies both cwd propagation and preservation of a clicked workspace target: apps/desktop/src/app/session/hooks/use-session-actions.test.tsx:178-184 and :660-672.
  • This shipped in 59686df8fe1b4f499f48b83877f6d7db2f9de8d6 (fix(desktop): preserve sidebar workspace targets across new drafts), following the related project-cwd fix 095b9eed3.

The linked issue #50017 was already closed as implemented with this session-specific behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [Desktop] windows: cwd directory is the home directory by default, even with project directory set differently

3 participants