Skip to content

A relative OSW_CRED_FILEPATH resolves against the MCP client's working directory #197

Description

@LukasGold

_resolve_cred_file in src/osw/service/config.py returns an explicitly configured credential path unchanged, apart from the ~ expansion added in #196. A relative value is therefore resolved against the process working directory.

For the CLI that is correct and intended: the user typed the command in that directory.

For the osw-mcp server it is not. The working directory is chosen by the MCP client, and the server does not control it. OSW_MCP_CRED_FILEPATH=accounts.pwd.yaml in a server entry points at an unpredictable location. This is the same unpredictability that _validate_state_dir already rejects for OSW_STATE_DIR, which requires an absolute path.

The failure is loud rather than silent: the run stops with "does not exist". So this is a usability problem, not a correctness problem.

Related decision: #194 asked that relative paths stay accepted, which is why #196 did not change this.

Possible fix: reject a relative credential path when the adapter is osw-mcp, matching the state_dir rule. config.log_prefix() already distinguishes the two adapters. A decision is needed on whether the rule should differ per adapter, or whether the error should only be a warning.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions