Skip to content

[Bug]: cwd is lost during docker init, making hermes effectively unusable #35472

@0xCA

Description

@0xCA

Bug Description

hermes chat starts in /opt/data instead of a specified workdir
New init scripts perform cd to /opt/data without going back afterwards

Steps to Reproduce

  1. docker run --rm -it -w '/workdir_1' docker.io/nousresearch/hermes-agent:latest hermes chat --toolsets file,memory,skills
    or Podman:
exec podman run --rm -it \
  --name $CONTAINER_NAME \
  --uidmap "+$HERMES_UID:@$(id -u):1" \
  --gidmap "+$HERMES_GID:@$(id -g):1" \
  --security-opt=no-new-privileges \
  -e OPENROUTER_API_KEY \
  -e HERMES_INFERENCE_PROVIDER=openrouter \
  -e HERMES_YOLO_MODE=0 \
  -e HERMES_TUI=1 \
  -e HERMES_UID \
  -e HERMES_GID \
  -e HERMES_WORKSPACE_DIR=$CONTAINER_WORKSPACE \
  -v "$TUI_DIR/1:/opt/hermes/ui-tui/packages/hermes-ink/dist:rw,U" \
  -v "$TUI_DIR/2:/opt/hermes/ui-tui/dist:rw,U" \
  -v "$DATA_DIR:/opt/data:rw" \
  -v "$WORKSPACE:$CONTAINER_WORKSPACE:rw" \
  -w "$CONTAINER_WORKSPACE" \
  docker.io/nousresearch/hermes-agent:latest \
  hermes chat --toolsets file,memory,skills
  1. hermes shows cwd as /opt/data instead of /workdir_1

Expected Behavior

cwd to be preserved as /workdir_1

Actual Behavior

cwd is /opt/data

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Irrelevant

Operating System

Debian 13

Python Version

No response

Hermes Version

0.15.1

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

without storing and restoring cwd

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundarea/dockerDocker image, Compose, packagingbackend/dockerDocker container executioncomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions