Fix: local files in the browser (at least for Windows)
The Browser works for screenshoting websites, but when the LLM tries to display a local file that he created, it can't access the full directory on Windows.
IIUC, the agent tried to browse: url=./file.html--but it needs to know cwd to see that file correctly. Seems like a good issue to fix.
For the "how", we can probably do a little pre-detection here, instead of doing a try/except. e.g. if not url.startswith("http") url = cwd + url
@Redrum624 do you want to continue iterating on this PR? Or would you rather open an issue and have someone else get to it?
Updated it with your recommandations, works fine with "http" and local files. Did not use cwd because it would give this url .\opendevin\action\browse.py and the local file is in .\workspace, so I'm using os.path.abspath(os.curdir) to get the root path and add self.url which is .\workspace\index.html, for example, to display the local file.
Tell me if I'm missing anything here, I'm just a beginner in Python.
This LGTM! Thanks for the adjustments!