microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
342 stars 37 forks source link

Repeated incorrect code #2728

Open OzOkhotnik opened 2 days ago

OzOkhotnik commented 2 days ago

Type: Bug

Code specific I think. Co-pilot has suggested the following code four or five times (exactly the same) and it does not work. I've explicitly told it it does not work, but it continues to parrot the same responce. To fix, it needs to recognise that its proposed solution does not work and it needs to look wider for the solution. First essential step is to be able to recognise its previous answers - at the moment it doesn't seem to be using this context. There are other context issues that may be contributing - the model of my code it is working off is otfen dates as in I have changed some things but it does not recognise this in the solutions. Acknowledge you don't want to ingest the entire codebase each time, but maybe you can better incoporate the git commit logs to identify when changes have been made (maybe to relevent sections to the question) and update context then? Anyway, here is the code it keeps repeating - the problem is that it isn't catching the 401 error and preventing execution of checkAuthStatus

useEffect(() => { const checkAuth = async () => { try { const response = await axiosInstance.get("/api/check-auth"); if (response.status === 200 && response.data) { await dispatch(checkAuthStatus()).unwrap(); } } catch (error: any) { if (error.response && error.response.status === 401) { console.log("User is not authenticated."); } else { console.error("Error checking auth:", error); } } }; checkAuth(); }, [dispatch]);

Extension version: 0.23.2024111902 VS Code version: Code - Insiders 1.96.0-insider (91bf2f3b96a337c05fdd30dbfe609ae780b74706, 2024-11-19T05:04:26.087Z) OS version: Windows_NT x64 10.0.22635 Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|15.70GB (2.15GB free)| |Process Argv|--crash-reporter-id 105993e2-7ea4-4258-96d4-6b6d69f6f30d| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 vsaa593cf:30376535 py29gd2263:31024238 c4g48928:30535728 a9j8j154:30646983 962ge761:30841072 pythonnoceb:30776497 asynctok:30898717 dsvsc014:30777825 dsvsc015:30821418 pythonmypyd1:30859725 h48ei257:31000450 pythontbext0:30879054 cppperfnew:30980852 pythonait:30973460 f3je6385:31013174 dvdeprecation:31040973 dwnewjupyter:31046869 newcmakeconfigv2:31071590 nativerepl1:31134653 pythonrstrctxt:31093868 nativeloc1:31118317 cf971741:31144450 e80f6927:31120813 12bdf347:31141542 iacca1:31150324 notype1:31143044 dwcopilot:31158714 h409b430:31177054 cf1a2727:31183122 5b1c1929:31184661 ```