Skip to content

Per-session working directory for gateway (OpenAI-compatible API) sessions #29531

@pmos69

Description

@pmos69

Problem

Hermes' working directory (terminal.cwdTERMINAL_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havearea/configConfig system, migrations, profilescomp/gatewayGateway runner, session dispatch, deliverytype/featureNew feature or request

    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