Skip to content

[Bug]: Telegram/gateway ignores profile working directory (pwd returns ~/.hermes/hermes-agent) #7663

@craftpip

Description

@craftpip

Bug Description

Fresh install, no prior setup.

I installed hermes and directly created a profile:

hermes profile create fern

I had already installed the gateway earlier, and I use:

fern gateway restart

after every config/env change to make sure everything reloads.


I expected the profile directory:

/home/craftpip/.hermes/profiles/fern

to act as the working directory.

But running:

pwd

always returns:

/home/craftpip/.hermes/hermes-agent


what i tried

1. profile config

File:
/home/craftpip/.hermes/profiles/fern/config.yaml

Config:

terminal:
  backend: local
  cwd: /home/craftpip/.hermes/profiles/fern

Restarted gateway:

fern gateway restart

No change.


2. .env (both global + profile)

Set:

MESSAGING_CWD=/home/craftpip/.hermes/profiles/fern
TERMINAL_CWD=/home/craftpip/.hermes/profiles/fern

Restarted gateway again:

fern gateway restart

Inside session:

echo $MESSAGING_CWD
echo $TERMINAL_CWD

Output is correct:

/home/craftpip/.hermes/profiles/fern

But:

pwd

still shows:

/home/craftpip/.hermes/hermes-agent


3. reset / restart attempts

  • /reset
  • /new
  • fern gateway restart after each change
  • killed processes manually (pkill -f hermes)

No change.


current state

Env is clearly being picked up, but terminal execution ignores it:

MESSAGING_CWD = correct
TERMINAL_CWD = correct
pwd = wrong


question

  • Is this expected behavior?
  • Are profiles not meant to control working directory?
  • Or is gateway/session overriding cwd internally?

Right now there is no way to make Telegram mode respect a specific working directory, even with explicit config + env.

Need clarification or correct way to control cwd.

Steps to Reproduce

.

Expected Behavior

.

Actual Behavior

.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Telegram

Operating System

Ubuntu 24

Python Version

3.11

Hermes Version

v0.8.0

Relevant Logs / Traceback

Root Cause Analysis (optional)

No response

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

    type/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