openwork icon indicating copy to clipboard operation
openwork copied to clipboard

[Bug]: Path validation failure in Telegram Bot on Windows

Open changanxile opened this issue 7 months ago • 1 comments

Summary

The Telegram Bot interface triggers a path validation error in Windows environments. Even for plain text messages, the backend fails the "Directory must stay within workspace root" validation during workspace initialization due to the //?/ prefix.

To Reproduce

Image Image Image Image

Expected behavior

The Telegram Bot should be able to process messages normally in a Windows environment. Sending plain text messages (e.g., "Hello") should not trigger any path validation errors, as they do not involve file system operations.

Actual behavior

Sending any message to the bot triggers the following error: "Directory must stay within workspace root: //?/g:/project/openwork_project".

It appears that the backend fails to validate the workspace root when the path is prefixed with //?/ (Windows UNC long path format), causing a validation failure even for simple text interactions.

Screenshots (optional)

No response

OW version & Desktop info (optional)

No response

Additional context (optional)

No response

changanxile avatar Apr 16 '26 07:04 changanxile

Opened a fix here: https://github.com/different-ai/openwork/pull/1460 This normalizes Windows verbatim and UNC-style workspace paths before the router's workspace-root scope check, and adds a focused regression test for the path handling logic.

pascalandr avatar Apr 16 '26 14:04 pascalandr