Problem
Hermes' working directory (terminal.cwd → TERMINAL_CWD) is process-global. The gateway serves many concurrent sessions — the OpenAI-compatible /v1/chat/completions endpoint, messaging platforms — from a single process, all sharing that one cwd. An individual API-driven session has no way to operate in its own working directory: the file, terminal, and code_execution tools all resolve against the single global value.
This makes per-project or per-conversation workflows impossible for any client of the OpenAI-compatible API — every concurrent session is pinned to the same directory.
Prior art that doesn't close this gap
Observation
The per-session-cwd machinery already exists — for ACP. register_task_env_overrides plus per-task_id resolution gives an ACP session its own working directory while its tools run. It is simply not exposed to OpenAI-compatible API sessions.
Proposal
Allow an OpenAI-compatible API session to specify a working directory, routed through the same per-task override mechanism the ACP adapter already uses, so that:
Open questions for maintainers
Happy to implement this once there's a steer on the preferred transport.
Problem
Hermes' working directory (
terminal.cwd→TERMINAL_CWD) is process-global. The gateway serves many concurrent sessions — the OpenAI-compatible/v1/chat/completionsendpoint, messaging platforms — from a single process, all sharing that one cwd. An individual API-driven session has no way to operate in its own working directory: thefile,terminal, andcode_executiontools all resolve against the single global value.This makes per-project or per-conversation workflows impossible for any client of the OpenAI-compatible API — every concurrent session is pinned to the same directory.
Prior art that doesn't close this gap
terminal.cwd/TERMINAL_CWD— global, fixed at gateway startup./set-workspace(feat(cli): add /set-workspace command to change session cwd #23535) — registeredcli_only=True; runs in the interactive CLI REPL and mutates the global env var, so it neither reaches API sessions nor isolates concurrent ones.register_task_env_overrides+ per-task_idpath resolution infile_tools(_resolve_path_for_task). That path is exclusive to the ACP adapter.--resume, not for concurrent isolation.Observation
The per-session-cwd machinery already exists — for ACP.
register_task_env_overridesplus per-task_idresolution gives an ACP session its own working directory while its tools run. It is simply not exposed to OpenAI-compatible API sessions.Proposal
Allow an OpenAI-compatible API session to specify a working directory, routed through the same per-task override mechanism the ACP adapter already uses, so that:
file,terminal, andcode_executiontools resolve against that session's directory;AGENTS.md/.hermes.md/.cursorrules) follows the same directory (cf. [Bug]: ACP session cwd is used for tool execution but not for project context file discovery #11515, the analogous ACP gap);Open questions for maintainers
/set-workspace?Happy to implement this once there's a steer on the preferred transport.