hide-org / hide

🤖 Headless IDE for AI agents
https://hide.sh
MIT License
112 stars 5 forks source link

pkg/files: use relative paths in listed files #113

Open artmoskvin opened 17 hours ago

artmoskvin commented 17 hours ago

This PR addressed the bug report https://github.com/hide-org/hide-sdk/issues/22. As noted in the report, the list files endpoint returns absolute paths. Using those paths with other endpoints results in failures because the endpoints expect relative paths. We use relative paths by design aiming to abstract the internal file organisation.

The absolute paths were coming from the file tree walk that we do when listing files. I fixed the issue by using a relative path for File creation. It was not trivial to decide when to extract the relative path. We make multiple calls in the tree walk function, some of them expect absolute path, other – relative. It would be great to review this block and to simplify it.

I also simplified test assertions which required reordering of the wanted files.