CodeWebChat icon indicating copy to clipboard operation
CodeWebChat copied to clipboard

Save/Apply context loop results in no valid paths

Open vanderstack opened this issue 1 year ago • 11 comments

I'm on windows if it matters. When I add the entire docs folder to my context, then save the context to the context json I get the following entry with a single path representing a directory:

  {
    "name": "docs-folder",
    "paths": [
      "docs"
    ]
  }

When I attempt to apply this context from the json file I am told no valid paths are found.

vanderstack avatar Jun 20 '25 18:06 vanderstack

As I'm unable to reproduce on linux: does it work on other root directories in your project? Are you using multi-root folder workspace?

robertpiosik avatar Jun 20 '25 23:06 robertpiosik

It does not work on other root directories, nor does it work on other non-root directories, anything that is not a concrete file path fails to be detected.

I'm not using the project as a "workspace" i've opened it as a folder from the repository root, so my immediate children include /packages and /docs

I will attempt to diagnose on my end and see if I provide a root cause or PR, but it may take a few days

vanderstack avatar Jun 20 '25 23:06 vanderstack

It sounds like OS issue. On it.

Thanks for the bug report!

robertpiosik avatar Jun 21 '25 00:06 robertpiosik

Should be now fixed in 1.114.0, please let me know if all is fine now on your end.

robertpiosik avatar Jun 21 '25 00:06 robertpiosik

Unfortunately this isn't resolved.

I've modified an existing saved context to create this context:

    "name": "Foo",
    "paths": [
      "docs\\context",
      "docs\\plans\\00001-remove-events",
      "docs\\plans\\templates",
      "docs\\readme.md"
    ]

this has 1 file "readme,md" and 2 subdirectories "context", and "plans". context contains files and plans contains two subdirectories which contain files.

When i restore this context i get a message that the context is successfully applied, however the only context is the docs\readme.md file.

I've also tried changing from "docs\\context" to each of these

"docs/context"
"docs\\context\\*"
"docs\\context\\**"
"docs\\context\\*.*" 
"\\docs\\context\\*"
"\\docs\\context\\**"
"\\docs\\context\\*.*" 

to see if the glob pattern characters would result in files being selected without success.

vanderstack avatar Jun 22 '25 19:06 vanderstack

as a workaround I am having success with opening the files and using the VSCode built in feature of selecting all open editor windows and copying the relative path for each and manually adding them to a context, but this has additional overhead when new files are added to a directory, thankfully this is fairly infrequent for my use case.

vanderstack avatar Jun 22 '25 19:06 vanderstack

I can see we need to normalize saved paths on windows to use forward slashes. On it.

robertpiosik avatar Jun 23 '25 00:06 robertpiosik

Please verify if things are working in 1.123.0

robertpiosik avatar Jun 23 '25 00:06 robertpiosik

I've used the save context feature to create a new context and it is saved with the correct slashes:

  {
    "name": "Docs",
    "paths": [
      "src/Admin.Web.Storybook/docs/test-product-requirements.md",
      "src/Admin.Web.Storybook/README.md",
      "src/Admin.Web/docs",    <------------ this is a directory
      "src/Admin.Web/README.md",
      "README.md"
    ]
  }

The entry "src/Admin.Web/docs", is a directory with the following structure Image

When I use the apply context feature the concretely referenced files are applied to the context correctly:

      "src/Admin.Web.Storybook/docs/test-product-requirements.md",
      "src/Admin.Web.Storybook/README.md",
      "src/Admin.Web/README.md",
      "README.md"

Unfortunately the directory "src/Admin.Web/docs" and its subdirectories and files are not

vanderstack avatar Jun 23 '25 22:06 vanderstack

I'm able to reproduce it and I'm working on a fix. Until it is fixed, you can work in WSL, if you can.

robertpiosik avatar Jun 24 '25 10:06 robertpiosik

Hi, thanks for your patience! This should be now fixed in 1.137.0.

robertpiosik avatar Jul 04 '25 17:07 robertpiosik