From b7ac9d9c0169e34321c252412ea1a43e79e86e52 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Mon, 24 Mar 2025 19:31:30 +0500 Subject: [PATCH 1/7] Commuity forum script added --- baseai/baseai.config.ts | 2 +- .../community-forum/data/forum-topics.json | 302 ++++++++++++++++++ baseai/memory/community-forum/index.ts | 42 +++ package.json | 4 +- scripts/fetchSolvedQuestions.js | 101 ++++++ 5 files changed, 449 insertions(+), 2 deletions(-) create mode 100644 baseai/memory/community-forum/data/forum-topics.json create mode 100644 baseai/memory/community-forum/index.ts create mode 100644 scripts/fetchSolvedQuestions.js diff --git a/baseai/baseai.config.ts b/baseai/baseai.config.ts index f0ee748f5..41bcc3979 100644 --- a/baseai/baseai.config.ts +++ b/baseai/baseai.config.ts @@ -1,4 +1,4 @@ -import type { BaseAIConfig } from 'baseai'; +import type {BaseAIConfig} from 'baseai'; export const config: BaseAIConfig = { log: { diff --git a/baseai/memory/community-forum/data/forum-topics.json b/baseai/memory/community-forum/data/forum-topics.json new file mode 100644 index 000000000..960fb9688 --- /dev/null +++ b/baseai/memory/community-forum/data/forum-topics.json @@ -0,0 +1,302 @@ +[ + { + "topic_id": 2416, + "title": "I am not able to reactivate my subscription", + "question": "

\"image\"
image1524×786 62 KB

\n

I have been trying to contact support for the last two days. No response. Please somebody help me

", + "solution": "

Hello @PriNova

\n

Thank you for your kind assistance. The issue is resolved.

" + }, + { + "topic_id": 2390, + "title": "Where to enter the cupon code", + "question": "

When signing up for cody pro and if i have a cupon code, where do I use it ?

", + "solution": "

Hi you can do that here: Cody by Sourcegraph

\n

You should see an “Add Promotional code” button. If you don’t please let me know.

" + }, + { + "topic_id": 2275, + "title": "Updating Cody search index... hangs forever", + "question": "

Suddenly, Cody stopped working for a repository that worked well for 6 months.

\n

Updating Cody search index for…

\n

Hang here, version 1.72.0.
\nI have deleted the cache, reinstalled the extension, and reinstalled VS Code.
\nNo success. Only with one repository, this happens.
\nTried to reindex, and hangs forever

", + "solution": "

I have been on this for two weeks. Now, I believe it is not directly related to Cody.

\n\n

I had Python Extension deactivated, and activating it fixed the problem.

" + }, + { + "topic_id": 2349, + "title": "Locked out until 4/4, even after paying", + "question": "

I ran out of monthly quota on free… so I paid…
\nbut I still can’t chat anymore until 4/4?

\n

\"image\"
image994×283 8.82 KB

", + "solution": "

Nevermind. I guess it just took a while after paying for it to unlock.

" + }, + { + "topic_id": 2330, + "title": "Copy Button Missing in Cody – Any Fix?", + "question": "

Hi, I was using Cody and noticed that the copy button is no longer available. It used to be there before, but now it’s completely gone, along with all the previous ones. I’m not sure what caused this. Is there a way to restore it?

", + "solution": "

Hey @davidjaner1

\n

The Copy button was introduced again via PR fix(webview): show copy button in web clients by abeatrix · Pull Request #7310 · sourcegraph/cody and available in the next Web update.

\n

Thank you for your patience and happy programming

" + }, + { + "topic_id": 2315, + "title": "Change the plan", + "question": "

Good day. I accidentally paid for the Enterprise Starter plan. Please change it to the Pro plan. My email lexus657@gmail.com.

", + "solution": "

I got a message back. What we can do is cancel the subscription and you need to resubscribe.
\nWhat do you think?

" + }, + { + "topic_id": 1983, + "title": "Any plans to add o3-mini?", + "question": "

I’ve been reading rave reviews about OpenAI’s latest model o3-mini.

\n

Any plans to add it to Cody soon?

", + "solution": "

You guys are quick! o3-mini has been added \":sunglasses:\"

\n

\"Screenshot
Screenshot 2025-02-01 200901480×324 14 KB

" + }, + { + "topic_id": 2200, + "title": "Hitting Limits Due to Model Switching", + "question": "

First time hitting limits on Cody and as others experienced I learned that the unlimited usage isn’t really unlimited. Looking up the history of this forum I saw this:

\n
\n

My personal suggestion, try to make 1 chat request per minute, if you don’t get the right answer don’t give it multiple queries per minute, at least not often to avoid being flagged by some automated process.

\n
\n

I just switched models because I wasn’t getting a satisfactory answer and I wasn’t even spamming or asking non-programming related questions. I don’ think it’s fair to limit users in this way while claiming unlimited for coding.

", + "solution": "

Update: My ban was overturned. It appears that was related to “problematic code”.

\n

Below is the reply I received:

\n
\n

Thank you for contacting Sourcegraph.

\n

Based on reports, feedback, and reports we got, we strongly suspect that we have done some over-banning and are working to correct that by rolling back bans that may have been overly aggressive and fixing the problematic code to address those bans.

\n

Please update your plugin/extension to the latest stable version of Cody and then try logging in and out again. You should be good to go.

\n

If you still have issues after the update, please let us know, and we will investigate further.

\n

We apologize for the inconvenience.

\n
\n

Thank you Sourcegraph for the resolution. I hope in the future users will be given at least a warning before banning.

" + }, + { + "topic_id": 2259, + "title": "Claude 3.7 Sonnet does not show in model list ES plan", + "question": "

I am having issues with Claude 3.7 Sonnet: It does not show on my available model list.
\nI use enterprise starter plan. Do I need also pro plan to access Sonnet 3.7?
\n

\"image\"
image1533×741 62.2 KB

", + "solution": "

Hey @vbvictor

\n

All models available on Pro will be rollout out gradually to Enterprise Starters. The team is already aware of it and working on it.

\n

Sorry for the inconvenience.

" + }, + { + "topic_id": 2222, + "title": "Can not Enable Cody in VSCode", + "question": "

When Enable Cody I see nothing except 3 dots

", + "solution": "

Yeah, it worked and I re-installed the extension as well. Thank you

" + }, + { + "topic_id": 2228, + "title": "Claude 3.7 Sonnet", + "question": "

Hey @PriNova ,

\n

Claude 3.7 Sonnet just dropped. Can we expect it to be added to Cody soon?

", + "solution": "

It’s already on Cody. You can try it.

\n

\"Screenshot_2025-02-24-23-07-28-51_e4424258c8b8649f6e67d283a50a2cbc\"
Screenshot_2025-02-24-23-07-28-51_e4424258c8b8649f6e67d283a50a2cbc720×1600 116 KB

" + }, + { + "topic_id": 570, + "title": "Custom command including multiple fixed files?", + "question": "

From the documentation at Commands - Sourcegraph docs and from experimenting it does not seem to be possible to create a custom command with more than one specific file as context? I know I can use a directory or the more “dynamic” options, but I would like to specify an exact set of files.

\n

Also, it was unexpected that the prompt is sent immediately and the LLM responds without asking for an initial command, but I guess that make sense if for things like: “fix typos and improve grammar in the comments of the selected code”.

\n

It’s easy to “program” by asking the LLM to wait for the first input before responding though.

", + "solution": "

This is available now \":tada:\"

\n

Wish they would make it possible/convenient to work programmatically with prompts though: Create custom prompt programmatically?

" + }, + { + "topic_id": 2174, + "title": "Private Instance Authentication issue with VSCode", + "question": "

I seem to have an issue that I can’t find any published reference to online. When I launch VSCode I see a error

\n
Connection to https://sourcegraph.[our private instance] failed.\nPlease check your access token and network connection.\"\n
\n

With buttons to “Get Token” and “Reload Window”. Clicking on get token opens a link to https://sourcegraph.[our private instance]/users/[my username]/settings with an input to override global and organization settings. There are no overrides defined. Switching to Access Tokens shows a valid token that I generated for VSCode. I’ve tested this token using cURL and it works, however back in VSCode the Access Token in the extension settings is readonly and appears to be pre-populated (the instance URL is editable and set to the correct value). Clicking on “Authenticate account” returns a 401 error (as seen in the extension Runtime Status in the extension manager). According to the changelog in version 2.2.17 the auth was “fixed” to not require editing settings.json but now I find myself in a state where I can’t provide an updated Auth token. Is this a thing that is managed by our private instance?

", + "solution": "

Hey @jasonsperske

\n

Thank you for reporting this issue.
\nPlease forward this issue over your Enterprise support channel or via support@sourcegraph.com.

\n

Sorry for the inconvenience.

" + }, + { + "topic_id": 2115, + "title": "Security Question", + "question": "

In another service, I came across a statement indicating that requests are routed through their AWS infrastructure even when a custom API key is used.
\nThey don’t have the ability to direct-route from the service to my enterprise deployment.

\n

Does the same behavior occur in Cody?

", + "solution": "

As far as I know then if you are using your own API key and model configuration with cody.dev.models then request is directly made to your provider. Of course, maybe some additional processing may happen in the background to fetch the context and send some telemetry data but overall the processed promopt/request should be sent to your deployment directly.

" + }, + { + "topic_id": 2101, + "title": "Keep getting error: This file has been restricted by an admin. Autocomplete, commands, and other Cody features are disabled", + "question": "

I am getting the error This file has been restricted by an admin. Autocomplete, commands, and other Cody features are disabled.
\nconsistently.
\nI am on cody version: 7.66.0, Jetbrains Pycharm pro: 2024.3.2, windows 11.
\nI have tried everything to restart IDE, change plugin version etc.
\nNothing’s working and it is very frustrating.

\n

I am trying hard to stay with cody even with this frustrating experience and on the verge to cancel my subscription. I hope you fix this soon.

\n

thanks,

", + "solution": "

I was able to get it working by downgrading to Pycharm version - 2024.2.5
\nPreviously I had the latest - 2024.3.2.
\nthanks all for your help and for looking into this.

" + }, + { + "topic_id": 2103, + "title": "Request Failed Issue", + "question": "

Hello,

\n

I am currently reviewing the application of an AI code editor based on our team’s code base.
\nWe are testing it under the Free plan, but we are facing difficulties as the same message keeps appearing repeatedly from the beginning.

\n

When I searched for the error code in the forum, I found previous responses stating that this occurs when trying to use Pro features in the Free version.
\nCould you clarify whether the Free version allows only basic chat functionality, or if there are any restrictions on its usage?

\n

I would appreciate your response.

\n

Thank you.

\n

\"image\"
image1920×953 27.6 KB

", + "solution": "

I have confirmed that it is working correctly.
\nThank you for your quick response.

" + }, + { + "topic_id": 2069, + "title": "Bug: VS Code File Name Bug", + "question": "

\"SCR-20250207-tygv\"
SCR-20250207-tygv776×1694 36 KB

\n

When chatting with Gemini 2.0 Pro, it gives the file name as “$FILEPATH:index.js”.

\n

Cody Version: 1.67.1738821693 Experimental

", + "solution": "

Hey @queaxtra

\n

The wrong file path naming is a known issue especially with the Google models. The team will have a look at it.

\n

Thank you.

" + }, + { + "topic_id": 1038, + "title": "Can't copy a piece of code in Chat Context", + "question": "

I tried Ctrl + C or opening Menu Context, but neither is working now. So, am I missing any settings ?
\nThank Team.

", + "solution": "

Hi bro !, i tried to delete all shortcuts of Copy Action in Editor Actions, after that i add again Ctrl + C and at the step delete all others actions which are at Ctrl + C, I choose Yes. Now i can press Ctrl + C to copy a chunk of code or any content in Cody Chat window.
\n

\"image\"
image1035×767 93.6 KB

\nI think there are some actions for Keymap CTRL + C to cause the error, this is not error from Cody Extension.
\nI mean that at the beginning, Copy have 2 keymaps those are Ctrl + C and Ctrl + Ins, Ctrl + C does not work but Ctrl + Ins still working \":rofl:\"

" + }, + { + "topic_id": 2028, + "title": "Rider 403 Forbidden", + "question": "

\"105757\"
105757908×719 72.4 KB

", + "solution": "

@jhlee8 here is what our team sent me

\n
\n

they were blocked because they are using a VPN, nothing related to their interaction with Cody. I will raise with the team if we are ready to allow VPNs again but for the moment the user should turn it off.

\n
\n

Please let us know regardless.

" + }, + { + "topic_id": 1718, + "title": "Support DeepSeek v3", + "question": "

Open source DeepSeek v3 claims SOTA performance on Codeforces. Might be a nice addition to the model stable.

", + "solution": "

It’s supported now and works well!

" + }, + { + "topic_id": 1970, + "title": "Side Panel Recommendation", + "question": "

\"SCR-20250129-uixx\"
SCR-20250129-uixx1920×1249 104 KB

\n

Can you make a side panel like Github Copilot does? It doesn’t work when it opens directly on the files, we keep going back and pasting. As I said, if it is done or can be done, it can be nice and increase functionality.

", + "solution": "

@queaxtra you can already move cody to the secondary sidepanel, you just need to move the github chat to another section and insert Cody in the sidebar. Have a look at my 3min video I show how todo this

\n \n \n \n
\n" + }, + { + "topic_id": 1857, + "title": "Cody plugin not working with GoLand EAP", + "question": "

There’s an EAP from JB that seems to fix the borked type references in GoLand.

\n

Cody plugin doesn’t work with new version. Kind of expected, but is there a workaround?
\n\"image\"

\n

Info on the bug is at
\nhttps://youtrack.jetbrains.com/issue/GO-17791

", + "solution": "

JB released an update to the GoLand EAP. The 7.12.1 nightly build plugin seems to work with Build #GO-251.17181.28, built on January 23, 2025.

" + }, + { + "topic_id": 1765, + "title": "Still breaking Jetbrains indexes", + "question": "

Still getting the issue where running GoLand with the Cody plugin breaks project indexes in the IDE on a daily basis. Symptom is that code fragments are underlined in red even though they’re valid, code navigation like jump to definition is broken. Have to run the commands to repair the IDE to fix. Sometimes it’s bad enough that I have to disable Cody in order for the repair to complete.

\n

When I get fed up and disable Cody, I don’t these errors as often. If I enable Cody, they start up again.

\n

Running the 7.9.0-nightly plugin in GoLand 2024.3.1
\nBuild #GO-243.22562.186, built on December 11, 2024
\nRuntime version: 21.0.5+8-b631.28 aarch64 (JCEF 122.1.9)
\nVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
\nToolkit: sun.lwawt.macosx.LWCToolkit
\nmacOS 15.2
\nGC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
\nMemory: 16000M
\nCores: 10
\nMetal Rendering is ON
\nRegistry:
\nide.completion.variant.limit=500
\nsuggest.all.run.configurations.from.context=FALSE
\nide.experimental.ui=true
\ni18n.locale=
\nterminal.new.ui=true
\nNon-Bundled Plugins:
\norg.asciidoctor.intellij.asciidoc (0.43.6)
\ncom.sourcegraph.jetbrains (7.9.0-nightly)
\ncom.intellij.tailwindcss (243.22562.117)

\n

Originally reported in Cody seems to break Jetbrains indexes

", + "solution": "

I uninstalled all the JB editors, reinstalled just GoLand, removed as many plugins as I could and this is still happening. I’m convinced that it’s not caused by Cody. I’ve opened a bug report with JB.

\n

https://youtrack.jetbrains.com/issue/GO-18031/GoLand-randomly-loses-type-definitions

" + }, + { + "topic_id": 1834, + "title": "VScode extension not working in SSH remote connection", + "question": "

The sourcegraph search extension Rev. 2.2.19 doesn’t work as a remote extension in an SSH host/container: The Authentication dialog is not available at all and if you try to search something, I get the following error: “The connection was closed before your search was completed. This may be due to a problem with a firewall, VPN or proxy, or a failure with the Sourcegraph server.”

\n

The locally installed extension works pretty well…

", + "solution": "

Hi, I have found a work-a-round that works for me: I patched the package.json of sourcegraph.sourcegraph and set “extensionKind”: [ “ui” ], and then reinstalled the extension.

\n

When I now establish a remote connection, Sourcegraph code search works fine with the local settings also in the remote workspace.

\n

I see no reason why the extension should be installed on the remote host at all. Maybe extensionKind:[ui] would be a good default setting for the next release?

" + }, + { + "topic_id": 1813, + "title": "Deep cody experimentalShell", + "question": "

This warning appears when I uninstall and install cody.However, the setting does not exist.I could not see it in the cody setting in visual studio tools and jetbrain rider settings.

\n

‘cody.agentic.context.experimentalShell’ to true

", + "solution": "

Hey @serdar

\n

Since the latest pre-release, the correct configurations you need to provide in the settings.json file are:

\n
\t\"cody.agentic.context\": {\n\t\t\"shell\": {\n\t\t\t\"allow\": [\n\t\t\t\t\"*\"\n\t\t\t],\n\t\t\t\"block\": [\n\t\t\t\t\"git\"\n\t\t\t]\n\t\t}\n\t}\n
\n

Where the base blocked commands are this:

\n
BASE_DISALLOWED_COMMANDS = [\n    'rm',\n    'chmod',\n    'shutdown',\n    'history',\n    'user',\n    'sudo',\n    'su',\n    'passwd',\n    'chown',\n    'chgrp',\n    'kill',\n    'reboot',\n    'poweroff',\n    'init',\n    'systemctl',\n    'journalctl',\n    'dmesg',\n    'lsblk',\n    'lsmod',\n    'modprobe',\n    'insmod',\n    'rmmod',\n    'lsusb',\n    'lspci',\n]\n
\n

I hope that helps

" + }, + { + "topic_id": 1796, + "title": "Cody agent chewing up CPU", + "question": "

Weird and I hope that it’s a one-off. I clicked “new chat” and got no response. The Cody agent seems like it’s hung.

\n

\"image\"
image923×191 15.2 KB

\n

This is GoLand with the latest nightly build of the plugin.

", + "solution": "

Thanks, @mdhender, for reporting. I sent this to the team. In the meantime, can you please switch back to the previous nightly or stable build?

" + }, + { + "topic_id": 1792, + "title": "Extremely laggy in vscode", + "question": "

I’m using Cody regularly and it’s been nothing short of amazing, but with every update it has been getting more and more lag. And by lag I don’t mean the generation speed or answer time, I just mean my whole Vscode comes to a stop whenever I interact with Cody

\n

So opening a Cody chat window means like 5 seconds where I can’t click on anything and my cursor even “hangs” and jumps around.
\nThen once the chat window opens, same thing, the chat window hangs while it autofills the text input with the context of the current file and current project.

\n

Then when I click to submit an answer, it hangs again. When I try to navigate through my files or even write some code manually while an answer is being generated → lag and I can’t do anything

\n

Same when I click on the “copy” button of a generated answer, or I click “apply”, etc. Basically every interaction I have with Cody generates lag. Even changing the extension’s settings.

\n

It has now gotten to the point where it’s significantly slowing down my work, so I just wanted to let you know and see if you were aware of the issue or not. I really like your product and I would rather not bother looking into an alternative if this lag issue could be easily fixed

", + "solution": "

You can delete the entire chat in the chat history tab and there is a trash bin symbol at the top “Delete All”

" + }, + { + "topic_id": 1713, + "title": "Copy button on responses", + "question": "

I want a copy button on Cody responses like chatgpt has. Sometimes I ask cody to make markdown documentation, and I can’t copy it, so I as it to put it in a code block, but its not smart enough to know to escape “```” to prevent it from closing the code block, so its really frustrating to have to format that. Plus, a million other reasons why we need that copy button!

", + "solution": "

Based on the internal priority list, it is considered to bring that feature into the original Cody extension.

" + }, + { + "topic_id": 1676, + "title": "Is there a plan to open up O1-1217?", + "question": "

Hello! OpenAI has recently provided access to the O1-1217 API. I would like to know if Cody has any plans to support users in using O1-1217.

", + "solution": "

Hey @wudizhe002

\n

We are currently providing only the OpenAI o1-mini, -preview models. The team is evaluating the o1-full model. But I can’t say for sure if it makes it into Cody.

\n

Thank you.

" + }, + { + "topic_id": 622, + "title": "Public SourceGraph code search does not find my public github repo anymore", + "question": "

I have added a “chat to this repo” batch to my public repo:

\n

\nIt links to:
\nhttps://sourcegraph.com/github.com/pbernet/akka_streams_tutorial

\n

This used to work (after a login), but now it does not find the repo anymore and this message appears:
\n“To access this repository, contact the Sourcegraph admin”

\n

Also in the public Sourcegraph this repo is not visible anymore.

\n

Thx
\nPaul

", + "solution": "

Sorry about this, thank you for flagging. We have ensured your repository has been re-added to the index. We’re also looking into making the repo chat more obvious when a user opens the “Chat with my repo” link, thanks for linking to us!

" + }, + { + "topic_id": 1556, + "title": "Cody plugin opening multiple issues on Github at once", + "question": "

Some weirdness with Cody yesterday. Working in GoLand 2024.3 (GO-243.21565.208, Cody v7.3.2) and got the pop-up about an IDE error while I was rewriting a section of code. Cody’s trained me to ignore that for as long as I can (sometimes it goes away with me interacting with it). I finally gave in and clicked to report the error.

\n

I think Cody opened 80+ issues on Github. They were all closed this morning as duplicates (not complaining about that and sorry for the triage work).

\n

I want to make Cody better, so I report errors. I’m a user, so I’m not going to go through the stack trace and figure out if it is a duplicate or not. Kinda maybe sorta wondering if there is a better way to do this.

", + "solution": "

Thank you for reporting @mdhender

\n

No worries, I was the one closing all those issues generated. lol
\nI already informed the team about that bug and they are aware of working on it.

" + }, + { + "topic_id": 1511, + "title": "Number of active access tokens exceeds limit", + "question": "

I get the error “Number of active access tokens exceeds limit”, when trying to authenticate with cody for vscode.
\nI’m using cody on two machines, one is working fine and the other is within a development docker container and I ahve to authenticate every day.

\n

So my two questions are: Why do i have to login every day and is there a way to authenticate more consitent? And can I manage my access tokens somewhere to delete unused ?

", + "solution": "

everytime you authenticate cody adds active access token go to your account and reduce them by clicking delete

" + }, + { + "topic_id": 1500, + "title": "The login page takes a long time to load", + "question": "

Sourcegraph encountered an unexpected error.

\n

The login page takes a long time to load, the login screen appears every time I reopen the vscode app. And almost all chat requests are unresponsive.

\n

\"image\"
image1167×377 10.8 KB

", + "solution": "

Hey everyone.

\n

The services have stabilized. All operations are functioning normally again.

\n

Thank you for your patience.

" + }, + { + "topic_id": 1290, + "title": "Plugin not loading", + "question": "

plugin version 7.0.13, i have pro version, ide version 2024.2.1

\n

in idea.log i see spam by this issue

\n

2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - Uncaught exception: SyntaxError: “undefined” is not valid JSON
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at JSON.parse ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at LocalStorageDB.get (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:132840:28)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at _AgentGlobalState.get (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:132796:26)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at LocalStorage.get (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:96677:29)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at LocalStorage.getClientState (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:96493:29)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at /home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:96500:34
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at Object. (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27465:34)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at Generator.next ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at /home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27504:71
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at new Promise ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at __awaiter3 (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27486:14)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at /home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27464:40
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at AsyncSerialScheduler. (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:26819:17)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at Generator.next ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at fulfilled (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:26784:28)

", + "solution": "

Hi @simonproud

\n

This is a known issue and the work around for now is rolling back to 7.0.6 to fix it.

\n

Updates will be made to the issue on GitHub.

\n

Thanks!

" + }, + { + "topic_id": 1254, + "title": "🪄 Prompt Library has VANISHED!", + "question": "

My prompts in my prompt library no longer show up in VS Code and I’m prompted to “Add a prompt”. When I click on that link, I am taken to my Sourcegraph account and see all of my existing prompts in my prompt library.

\n

I have tried signing out and in of my Sourcegraph account, both in VS Code and online - to no avail.

\n

Please help. \":man_bowing:\"

", + "solution": "

I’m just curious, do your prompts have “draft” mode selected?
\nIf so, they won’t show up in the UI.

" + }, + { + "topic_id": 1238, + "title": "Granular Access Control: Group or Repository-Level Tokens", + "question": "

Hello Sourcegraph community,

\n

I’m looking for a way to implement more granular access control in our Sourcegraph instance. Specifically, I need to create access tokens that are limited to either specific groups or repositories.

\n\n

Questions:

\n
    \n
  1. Is it possible to create repository-specific or group-based access tokens? as opposed to the personal token?
  2. \n
  3. If not, what’s the best alternative for implementing granular access control?
  4. \n
  5. Are there any upcoming features that might address this need?
  6. \n
\n

Any guidance or best practices would be greatly appreciated.

\n

Thank you!

", + "solution": "

Hello @VinAI

\n

This is a good question. The best channel for such questions is to mail support@sourcegraph.com.

\n

This seems to be more relevant to the enterprise support.

\n

Thank you.

" + }, + { + "topic_id": 1199, + "title": "Allow Attaching external Local file as Context", + "question": "

I am writing the backend and front end separately for a project. I want to speed up my frontend dev process by attaching a few files in the context of Cody AI of my frontend project. Right now, this cannot be done. I can only attach external links which is not suitable for this instance as the backend codebase is still being developed locally. Even if it was pushed to Git Hub, it would be private.

\n

It would be great if local files from a directory outside the codebase could be added as context.

\n

P.S: I am using Cody pro in Vscode.

", + "solution": "

@towfiqi if you open the local files within your vs code window you can reference them even if they are outside of the workspace. The key is to have them open and then they show up when you add @
\nHere are 2 screenshots where I show such a behavior, I simply hit ctrl + o and selected a file outside of the workspace and I am now able to ask it questions from Cody.
\nThis might be a hassle when you have many files that you need to reference from many folders but hey, it’s a workaround if you want to use it.
\n

\"load-files\"
load-files1244×1010 177 KB

\n
\"local-files\"
local-files1774×792 152 KB

" + }, + { + "topic_id": 928, + "title": "Not obvious to me how to search a part of a tree", + "question": "

I used to be able to navigate within a repo and search part of it (sub-folder path). Now it seems like I can’t do this. Nor can I find commits that show changes only to a part of a sub-path.

\n

I found that I can click a small button on the left of the folder that looks like [o] , I guess to “zoom” into that folder (Tooltips could be helpful)?

\n

But clicking on that doesn’t change the url or anything, and switching to the Commits tab still shows commits for the entire repo which is not very useful when I work with many monorepos every day.

", + "solution": "

For anyone else hitting this: the way to replicate the previous behavior is to click into the search box, and click on “Search in current directory” so it’ll pre-fill the file: query and refine the scope, then type in the query.

" + }, + { + "topic_id": 1140, + "title": "Web interface slooooow to respond", + "question": "

Please give me a button option to turn off the slow response. Perplexity gives me responses almost instantly but I’m finding cody a little better at coding.

\n

Been using the web interface only. As my code gets longer, 130 lines, it’s very frustrating having to wait such a long time as cody slowly types out its response. Trying to do a bunch of rewrites quickly becomes frustrating.

\n

Cody told me that it generates its responses almost instantly behind the scenes but that its creators purposely throtttle how fast it is presented to make it look like someone is typing back at me. It said they are doing that to make it feel more like I’m interacting with a human.

\n

I could care less about it feeling like a human is typing back at me. I need these code changes fast. I can’t be boiling a pot of coffie everytime I wait for cody to sloooowly type out its response.

\n

Going to have to go back to Perplexity for most of my coding and have Cody only do the final rewrite to get things done faster.

", + "solution": "

Hello @CodyCrumbs
\ndue to a long chat session, the reply slows down in that cases.

\n

Or do you experiences that with a fresh start of a conversation too?

" + }, + { + "topic_id": 1057, + "title": "What data is shared with SourceGraph", + "question": "

Do you have a data sharing policy covering things like the data used for training Cody?

", + "solution": "

Hey @gareth-rogers-healx we do. Here it is: Sourcegraph - Cody Enterprise Terms of Use

" + }, + { + "topic_id": 1060, + "title": "Cody chat slowdown issue", + "question": "

I don’t know if this question has been asked before, but I’m really annoyed with the cody chat slowdown issue, it’s most likely due to context, because it only slows down after a few big requests.
\nI would like to know if this problem can be fixed by customizing the extension (limiting the number of messages for context) and how to do it? (if such a thing is possible)

", + "solution": "

Hello @errorbuglag

\n

The chat lag is known to the dev team and they are working on it.
\nUntil now, it is advisable to chunk your task into smaller pieces and start a new session for every subtask.

\n

I hope that helps.

" + }, + { + "topic_id": 273, + "title": "Cody Pro Retention Duration", + "question": "

Dear Sourcegraph Team,

\n

As per Sourcegraph - Cody Enterprise Terms of Use, Sourcegraph collects prompts and responses:

\n
\n

For individual users accessing the Sourcegraph Cody extension via Sourcegraph.com, Sourcegraph also collects the following User Content to support and improve user experience, though none of it will be used to train any generally available models:

\n\n
\n

I’m assuming “individual users” includes Cody Pro users. Is there a fixed retention duration for this data at the Pro tier? Similar to how OpenAI states that they persist prompts for 30 days.

", + "solution": "

Hey @JeremyTCD

\n

I know it’s been a long time since we talked about our retention policy.

\n

We are still working on reconciling our data retention policy (30-45 days; we are still determining the time) in a standard way (for Free, Pro, and Enterprise users), not making it an upsell feature.

\n

That is all I have for now.

" + }, + { + "topic_id": 952, + "title": "Beta UX missing \"show aggregate results\"", + "question": "

It appears as though the “Beta UX” is missing the incredibly helpful “show aggregation results” functionality from the legacy ux

\n

\"Screenshot

\n

Is this functionality getting sunset? or has it just not been implemented in the new version yet?

", + "solution": "

@mnitschke heard back:

\n
\n

“Currently we still plan to add this, though it might not work exactly the same as before.”

\n
\n

That is all I know ATM.

" + }, + { + "topic_id": 980, + "title": "[BUG] Chat Window Content Disappears While LLM is Responding - 1.32.4", + "question": "

Hi \":wave:\" The chat window disappears and never reappears again. I am using the latest version of Cody, but I also tested several earlier versions, and the issue persists. I reindexed the entire project but it didn’t help. The files are located in different folders (repos) but within the same VSCode workspace. The window does not disappear when adding a single file to context. I have reset both the extension and VSCode multiple times. No errors in the logs.

\n

Video: Watch Cody Error 1 | Streamable

", + "solution": "

Hey @Marc

\n

Thank you for reporting the issue.
\nDid you update to the latest Cody version 1.32.4?

\n

What are your specs, specifically the RAM size?

" + }, + { + "topic_id": 983, + "title": "Custom command context not working anymore", + "question": "

Hi Sourcegraph Cody Team,

\n

The custom command provided by the documentation aren’t working anymore. Here is the link to the documentation:

\n\n

For this example, I am using the commit message generation command. It seems, that cody tries to open a file with the name, which is defined in the “command” property in the cody.json file:
\n

\"image\"
image1589×648 59.3 KB

\n

I am using Cody 1.32.4

", + "solution": "

This issue seems to be fixed in the pre-release version v1.33.1724858199, as the git diff is being used correctly \":grinning:\"

\n

\"image\"
image769×530 54.3 KB

" + }, + { + "topic_id": 947, + "title": "How to use \"chatPreInstruction\" in browser Cody chat?", + "question": "

Cody has a settings file for visual studio code - config.json in which I can write the settings I need, among them there is “chatPreInstruction”, is it possible to use this setting in the browser and if it is possible, how?

", + "solution": "

Great question. At this time, there isn’t, but I will make sure the product team sees this in the weekly community feedback report.

\n

Besides that missing feature, are you enjoying Cody for Web?

" + }, + { + "topic_id": 860, + "title": "Cody language completion for gleam", + "question": "

I am using gleam and I would love to have more language support for this language. it is basically trying to use javascript syntax when it doesn’t have a pattern to copy from in the source project.

\n

Anything I can do to help.

\n

Thanks

", + "solution": "

I was able to change the sg.nvim plugon to use the claude 3.5 and it is much better. I was able to solve a hard mode exercism question with only a little correction.

\n

Thank you!

" + }, + { + "topic_id": 876, + "title": "Cant sign in to cody", + "question": "

Sometimes its telling me 502: bad gateway, and sometimes nothing at all

", + "solution": "

Its working now, great job Sourcegraph team \":grin:\"\":saluting_face:\"

" + }, + { + "topic_id": 858, + "title": "JetBrains plugin v6.0.16 incompatible after 2024.2 update of IDE", + "question": "

GoLand 2024.2
\nBuild #GO-242.20224.306, built on August 6, 2024
\nRuntime version: 21.0.3+13-b509.4 aarch64 (JCEF 122.1.9)
\nVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
\nToolkit: sun.lwawt.macosx.LWCToolkit
\nmacOS 14.5
\nGC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
\nMemory: 16000M
\nCores: 10
\nMetal Rendering is ON
\nRegistry:
\nide.completion.variant.limit=500
\nsuggest.all.run.configurations.from.context=true
\nide.experimental.ui=true
\nNon-Bundled Plugins:
\norg.asciidoctor.intellij.asciidoc (0.42.2)
\ncom.intellij.tailwindcss (242.20224.204)

\n

\"image\"

", + "solution": "

@mdhender

\n

We’ve published stable version 6.0.25 in the marketplace which will fix the issue. Please let us know either way.

" + }, + { + "topic_id": 771, + "title": "When i try to login from IDE: Unexpected Error Not found: /post-sign-up", + "question": "

when i try to login from Intellij (github or google), i’m redirected to
\nhttps://sourcegraph.com/post-sign-up?returnTo=%2Fuser%2Fsettings%2Ftokens%2Fnew%2Fcallback%3FrequestFrom%3DJETBRAINS-63342&signin=OpenIDConnect

\n

Unexpected Error Not found: /post-sign-up

\n

I’m logged in on sourcegraph page.

", + "solution": "

I was able to find a way to get it to work.
\nUncheck experimental webapp on the sourcegraph console.
\nOddly it was enabled by default on my case.
\nIt probably is on yours as well.

" + } +] \ No newline at end of file diff --git a/baseai/memory/community-forum/index.ts b/baseai/memory/community-forum/index.ts new file mode 100644 index 000000000..dbd080269 --- /dev/null +++ b/baseai/memory/community-forum/index.ts @@ -0,0 +1,42 @@ +import {MemoryI} from '@baseai/core'; +const memoryForum = (): MemoryI => ({ + name: 'community-forum', + description: + 'Solved questions and answers from the Sourcegraph community forum', + documents: { + meta: doc => { + // For a single JSON file containing all topics + // We'll extract metadata from the content + try { + // The content might be a JSON string with all topics + const topics = JSON.parse(doc.content); + + // Return basic metadata about this collection + // Convert count to string to satisfy the Record type + return { + url: 'https://community.sourcegraph.com/', + name: 'Sourcegraph Community Forum - Solved Topics', + count: String(topics.length) // Convert to string + }; + } catch (e) { + // If parsing fails, return basic info + // Add count property with a default value to match the structure + return { + url: 'https://community.sourcegraph.com/', + name: doc.name, + count: '0' + }; + } + } + }, + // Track the single JSON file + git: { + enabled: true, + include: ['baseai/memory/community-forum/data/forum-topics.json'], + gitignore: true, + deployedAt: '', + embeddedAt: '' + } +}); + +export default memoryForum; diff --git a/package.json b/package.json index ac6527a64..adf408352 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "lint": "next lint", "baseai": "baseai", "sync": "npx baseai@latest deploy -m docs", - "llmstxt": "node scripts/llms-txt-generator.js" + "llmstxt": "node scripts/llms-txt-generator.js", + "fetch-solved-questions": "node scripts/fetchSolvedQuestions.js", + "sync-community-forum": "npm run fetch-solved-questions && git add baseai/memory/community-forum/data/forum-topics.json && git commit -m 'Update community forum data' && npx baseai@latest deploy -m community-forum" }, "browserslist": "defaults, not ie <= 11", "dependencies": { diff --git a/scripts/fetchSolvedQuestions.js b/scripts/fetchSolvedQuestions.js new file mode 100644 index 000000000..32d205076 --- /dev/null +++ b/scripts/fetchSolvedQuestions.js @@ -0,0 +1,101 @@ +const fs = require('fs'); +const path = require('path'); + +// Function to fetch solved topics +async function fetchSolvedTopics() { + try { + const searchUrl = + 'https://community.sourcegraph.com/search.json?q=status:solved'; + const response = await fetch(searchUrl); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const data = await response.json(); + return data.posts; + } catch (error) { + console.error('Error fetching solved topics:', error); + return []; + } +} + +// Function to fetch full topic details +async function fetchTopicDetails(topicId) { + try { + const topicUrl = `https://community.sourcegraph.com/t/${topicId}.json`; + const response = await fetch(topicUrl); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const data = await response.json(); + return data; + } catch (error) { + console.error(`Error fetching topic ${topicId}:`, error); + return null; + } +} + +// Function to process and save solved questions and answers +async function processAndSaveSolvedQuestions() { + const solvedTopics = await fetchSolvedTopics(); + const results = []; + + for (const topic of solvedTopics) { + const topicDetails = await fetchTopicDetails(topic.topic_id); + + if ( + topicDetails && + topicDetails.post_stream && + topicDetails.post_stream.posts + ) { + const posts = topicDetails.post_stream.posts; + + // Extract the question (first post) + const question = posts[0].cooked; + + // Find the accepted answer - look specifically for the post with accepted_answer: true + let solution = null; + + const acceptedAnswerPost = posts.find( + post => post.accepted_answer === true + ); + + if (acceptedAnswerPost) { + solution = acceptedAnswerPost.cooked; + } else if (posts.length > 1) { + // If no post is marked as accepted_answer, use the first reply as a fallback + solution = posts[1].cooked; + } + + if (question && solution) { + results.push({ + topic_id: topic.topic_id, + title: topicDetails.title, + question, + solution + }); + } + } + } + + // Create the data directory if it doesn't exist + const dataDir = path.join( + __dirname, + '../baseai/memory/community-forum/data' + ); + if (!fs.existsSync(dataDir)) { + fs.mkdirSync(dataDir, {recursive: true}); + } + + // Save all topics in a single JSON file + fs.writeFileSync( + path.join(dataDir, 'forum-topics.json'), + JSON.stringify(results, null, 2) + ); + + console.log( + 'Solved questions and answers saved to baseai/memory/community-forum/data/forum-topics.json' + ); +} + +// Run the script +processAndSaveSolvedQuestions(); From 490f7e1b8a918a42b0b7779836f27a914f39f57e Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Thu, 3 Apr 2025 23:48:11 +0500 Subject: [PATCH 2/7] Added Forum for community --- .../community-forum/data/forum-topics.json | 308 ++---------------- src/app/admin/add-forum-post/page.tsx | 96 ++++++ src/app/api/add-forum-post/route.ts | 185 +++++++++++ src/components/ui/input.tsx | 24 ++ src/middleware.ts | 9 +- 5 files changed, 335 insertions(+), 287 deletions(-) create mode 100644 src/app/admin/add-forum-post/page.tsx create mode 100644 src/app/api/add-forum-post/route.ts create mode 100644 src/components/ui/input.tsx diff --git a/baseai/memory/community-forum/data/forum-topics.json b/baseai/memory/community-forum/data/forum-topics.json index 960fb9688..c4695659f 100644 --- a/baseai/memory/community-forum/data/forum-topics.json +++ b/baseai/memory/community-forum/data/forum-topics.json @@ -1,302 +1,42 @@ [ { - "topic_id": 2416, - "title": "I am not able to reactivate my subscription", - "question": "

\n

I have been trying to contact support for the last two days. No response. Please somebody help me

", - "solution": "

Hello @PriNova

\n

Thank you for your kind assistance. The issue is resolved.

" + "url": "https://community.sourcegraph.com/t/updating-cody-search-index-hangs-forever/2275", + "title": "Troubleshooting updating cody search index... hangs forever", + "answer": "I have been on this for two weeks. Now, I believe it is not directly related to Cody. I had Python Extension deactivated, and activating it fixed the problem." }, { - "topic_id": 2390, - "title": "Where to enter the cupon code", - "question": "

When signing up for cody pro and if i have a cupon code, where do I use it ?

", - "solution": "

Hi you can do that here: Cody by Sourcegraph

\n

You should see an “Add Promotional code” button. If you don’t please let me know.

" + "url": "https://community.sourcegraph.com/t/claude-3-7-sonnet-does-not-show-in-model-list-es-plan/2259", + "title": "Troubleshooting claude 3.7 sonnet does not show in model list es plan", + "answer": "Hey @vbvictor All models available on Pro will be rollout out gradually to Enterprise Starters. The team is already aware of it and working on it. Sorry for the inconvenience." }, { - "topic_id": 2275, - "title": "Updating Cody search index... hangs forever", - "question": "

Suddenly, Cody stopped working for a repository that worked well for 6 months.

\n

Updating Cody search index for…

\n

Hang here, version 1.72.0.
\nI have deleted the cache, reinstalled the extension, and reinstalled VS Code.
\nNo success. Only with one repository, this happens.
\nTried to reindex, and hangs forever

", - "solution": "

I have been on this for two weeks. Now, I believe it is not directly related to Cody.

\n\n

I had Python Extension deactivated, and activating it fixed the problem.

" + "url": "https://community.sourcegraph.com/t/security-question/2115", + "title": "Troubleshooting security question", + "answer": "As far as I know then if you are using your own API key and model configuration with cody.dev.models then request is directly made to your provider. Of course, maybe some additional processing may happen in the background to fetch the context and send some telemetry data but overall the processed pr…" }, { - "topic_id": 2349, - "title": "Locked out until 4/4, even after paying", - "question": "

I ran out of monthly quota on free… so I paid…
\nbut I still can’t chat anymore until 4/4?

\n

", - "solution": "

Nevermind. I guess it just took a while after paying for it to unlock.

" + "url": "https://community.sourcegraph.com/t/vscode-extension-not-working-in-ssh-remote-connection/1834", + "title": "Troubleshooting vscode extension not working in ssh remote connection", + "answer": "Hi, I have found a work-a-round that works for me: I patched the package.json of sourcegraph.sourcegraph and set “extensionKind”: [ “ui” ], and then reinstalled the extension. When I now establish a remote connection, Sourcegraph code search works fine with the local settings also in the remote wor…" }, { - "topic_id": 2330, - "title": "Copy Button Missing in Cody – Any Fix?", - "question": "

Hi, I was using Cody and noticed that the copy button is no longer available. It used to be there before, but now it’s completely gone, along with all the previous ones. I’m not sure what caused this. Is there a way to restore it?

", - "solution": "

Hey @davidjaner1

\n

The Copy button was introduced again via PR fix(webview): show copy button in web clients by abeatrix · Pull Request #7310 · sourcegraph/cody and available in the next Web update.

\n

Thank you for your patience and happy programming

" + "url": "https://community.sourcegraph.com/t/hitting-limits-due-to-model-switching/2200", + "title": "Troubleshooting hitting limits due to model switching", + "answer": "Update: My ban was overturned. It appears that was related to “problematic code”. Below is the reply I received: Thank you for contacting Sourcegraph. Based on reports, feedback, and reports we got, we strongly suspect that we have done some over-banning and are working to correct that by rollin…" }, { - "topic_id": 2315, - "title": "Change the plan", - "question": "

Good day. I accidentally paid for the Enterprise Starter plan. Please change it to the Pro plan. My email lexus657@gmail.com.

", - "solution": "

I got a message back. What we can do is cancel the subscription and you need to resubscribe.
\nWhat do you think?

" + "url": "https://community.sourcegraph.com/t/change-the-plan/2315", + "title": "Troubleshooting change the plan", + "answer": "I got a message back. What we can do is cancel the subscription and you need to resubscribe. What do you think?" }, { - "topic_id": 1983, - "title": "Any plans to add o3-mini?", - "question": "

I’ve been reading rave reviews about OpenAI’s latest model o3-mini.

\n

Any plans to add it to Cody soon?

", - "solution": "

You guys are quick! o3-mini has been added \":sunglasses:\"

\n

" + "url": "https://community.sourcegraph.com/t/extremely-laggy-in-vscode/1792", + "title": "Troubleshooting extremely laggy in vscode", + "answer": "You can delete the entire chat in the chat history tab and there is a trash bin symbol at the top “Delete All”" }, { - "topic_id": 2200, - "title": "Hitting Limits Due to Model Switching", - "question": "

First time hitting limits on Cody and as others experienced I learned that the unlimited usage isn’t really unlimited. Looking up the history of this forum I saw this:

\n
\n

My personal suggestion, try to make 1 chat request per minute, if you don’t get the right answer don’t give it multiple queries per minute, at least not often to avoid being flagged by some automated process.

\n
\n

I just switched models because I wasn’t getting a satisfactory answer and I wasn’t even spamming or asking non-programming related questions. I don’ think it’s fair to limit users in this way while claiming unlimited for coding.

", - "solution": "

Update: My ban was overturned. It appears that was related to “problematic code”.

\n

Below is the reply I received:

\n
\n

Thank you for contacting Sourcegraph.

\n

Based on reports, feedback, and reports we got, we strongly suspect that we have done some over-banning and are working to correct that by rolling back bans that may have been overly aggressive and fixing the problematic code to address those bans.

\n

Please update your plugin/extension to the latest stable version of Cody and then try logging in and out again. You should be good to go.

\n

If you still have issues after the update, please let us know, and we will investigate further.

\n

We apologize for the inconvenience.

\n
\n

Thank you Sourcegraph for the resolution. I hope in the future users will be given at least a warning before banning.

" - }, - { - "topic_id": 2259, - "title": "Claude 3.7 Sonnet does not show in model list ES plan", - "question": "

I am having issues with Claude 3.7 Sonnet: It does not show on my available model list.
\nI use enterprise starter plan. Do I need also pro plan to access Sonnet 3.7?
\n

", - "solution": "

Hey @vbvictor

\n

All models available on Pro will be rollout out gradually to Enterprise Starters. The team is already aware of it and working on it.

\n

Sorry for the inconvenience.

" - }, - { - "topic_id": 2222, - "title": "Can not Enable Cody in VSCode", - "question": "

When Enable Cody I see nothing except 3 dots

", - "solution": "

Yeah, it worked and I re-installed the extension as well. Thank you

" - }, - { - "topic_id": 2228, - "title": "Claude 3.7 Sonnet", - "question": "

Hey @PriNova ,

\n

Claude 3.7 Sonnet just dropped. Can we expect it to be added to Cody soon?

", - "solution": "

It’s already on Cody. You can try it.

\n

" - }, - { - "topic_id": 570, - "title": "Custom command including multiple fixed files?", - "question": "

From the documentation at Commands - Sourcegraph docs and from experimenting it does not seem to be possible to create a custom command with more than one specific file as context? I know I can use a directory or the more “dynamic” options, but I would like to specify an exact set of files.

\n

Also, it was unexpected that the prompt is sent immediately and the LLM responds without asking for an initial command, but I guess that make sense if for things like: “fix typos and improve grammar in the comments of the selected code”.

\n

It’s easy to “program” by asking the LLM to wait for the first input before responding though.

", - "solution": "

This is available now \":tada:\"

\n

Wish they would make it possible/convenient to work programmatically with prompts though: Create custom prompt programmatically?

" - }, - { - "topic_id": 2174, - "title": "Private Instance Authentication issue with VSCode", - "question": "

I seem to have an issue that I can’t find any published reference to online. When I launch VSCode I see a error

\n
Connection to https://sourcegraph.[our private instance] failed.\nPlease check your access token and network connection.\"\n
\n

With buttons to “Get Token” and “Reload Window”. Clicking on get token opens a link to https://sourcegraph.[our private instance]/users/[my username]/settings with an input to override global and organization settings. There are no overrides defined. Switching to Access Tokens shows a valid token that I generated for VSCode. I’ve tested this token using cURL and it works, however back in VSCode the Access Token in the extension settings is readonly and appears to be pre-populated (the instance URL is editable and set to the correct value). Clicking on “Authenticate account” returns a 401 error (as seen in the extension Runtime Status in the extension manager). According to the changelog in version 2.2.17 the auth was “fixed” to not require editing settings.json but now I find myself in a state where I can’t provide an updated Auth token. Is this a thing that is managed by our private instance?

", - "solution": "

Hey @jasonsperske

\n

Thank you for reporting this issue.
\nPlease forward this issue over your Enterprise support channel or via support@sourcegraph.com.

\n

Sorry for the inconvenience.

" - }, - { - "topic_id": 2115, - "title": "Security Question", - "question": "

In another service, I came across a statement indicating that requests are routed through their AWS infrastructure even when a custom API key is used.
\nThey don’t have the ability to direct-route from the service to my enterprise deployment.

\n

Does the same behavior occur in Cody?

", - "solution": "

As far as I know then if you are using your own API key and model configuration with cody.dev.models then request is directly made to your provider. Of course, maybe some additional processing may happen in the background to fetch the context and send some telemetry data but overall the processed promopt/request should be sent to your deployment directly.

" - }, - { - "topic_id": 2101, - "title": "Keep getting error: This file has been restricted by an admin. Autocomplete, commands, and other Cody features are disabled", - "question": "

I am getting the error This file has been restricted by an admin. Autocomplete, commands, and other Cody features are disabled.
\nconsistently.
\nI am on cody version: 7.66.0, Jetbrains Pycharm pro: 2024.3.2, windows 11.
\nI have tried everything to restart IDE, change plugin version etc.
\nNothing’s working and it is very frustrating.

\n

I am trying hard to stay with cody even with this frustrating experience and on the verge to cancel my subscription. I hope you fix this soon.

\n

thanks,

", - "solution": "

I was able to get it working by downgrading to Pycharm version - 2024.2.5
\nPreviously I had the latest - 2024.3.2.
\nthanks all for your help and for looking into this.

" - }, - { - "topic_id": 2103, - "title": "Request Failed Issue", - "question": "

Hello,

\n

I am currently reviewing the application of an AI code editor based on our team’s code base.
\nWe are testing it under the Free plan, but we are facing difficulties as the same message keeps appearing repeatedly from the beginning.

\n

When I searched for the error code in the forum, I found previous responses stating that this occurs when trying to use Pro features in the Free version.
\nCould you clarify whether the Free version allows only basic chat functionality, or if there are any restrictions on its usage?

\n

I would appreciate your response.

\n

Thank you.

\n

", - "solution": "

I have confirmed that it is working correctly.
\nThank you for your quick response.

" - }, - { - "topic_id": 2069, - "title": "Bug: VS Code File Name Bug", - "question": "

\n

When chatting with Gemini 2.0 Pro, it gives the file name as “$FILEPATH:index.js”.

\n

Cody Version: 1.67.1738821693 Experimental

", - "solution": "

Hey @queaxtra

\n

The wrong file path naming is a known issue especially with the Google models. The team will have a look at it.

\n

Thank you.

" - }, - { - "topic_id": 1038, - "title": "Can't copy a piece of code in Chat Context", - "question": "

I tried Ctrl + C or opening Menu Context, but neither is working now. So, am I missing any settings ?
\nThank Team.

", - "solution": "

Hi bro !, i tried to delete all shortcuts of Copy Action in Editor Actions, after that i add again Ctrl + C and at the step delete all others actions which are at Ctrl + C, I choose Yes. Now i can press Ctrl + C to copy a chunk of code or any content in Cody Chat window.
\n


\nI think there are some actions for Keymap CTRL + C to cause the error, this is not error from Cody Extension.
\nI mean that at the beginning, Copy have 2 keymaps those are Ctrl + C and Ctrl + Ins, Ctrl + C does not work but Ctrl + Ins still working \":rofl:\"

" - }, - { - "topic_id": 2028, - "title": "Rider 403 Forbidden", - "question": "

", - "solution": "

@jhlee8 here is what our team sent me

\n
\n

they were blocked because they are using a VPN, nothing related to their interaction with Cody. I will raise with the team if we are ready to allow VPNs again but for the moment the user should turn it off.

\n
\n

Please let us know regardless.

" - }, - { - "topic_id": 1718, - "title": "Support DeepSeek v3", - "question": "

Open source DeepSeek v3 claims SOTA performance on Codeforces. Might be a nice addition to the model stable.

", - "solution": "

It’s supported now and works well!

" - }, - { - "topic_id": 1970, - "title": "Side Panel Recommendation", - "question": "

\n

Can you make a side panel like Github Copilot does? It doesn’t work when it opens directly on the files, we keep going back and pasting. As I said, if it is done or can be done, it can be nice and increase functionality.

", - "solution": "

@queaxtra you can already move cody to the secondary sidepanel, you just need to move the github chat to another section and insert Cody in the sidebar. Have a look at my 3min video I show how todo this

\n \n \n \n
\n" - }, - { - "topic_id": 1857, - "title": "Cody plugin not working with GoLand EAP", - "question": "

There’s an EAP from JB that seems to fix the borked type references in GoLand.

\n

Cody plugin doesn’t work with new version. Kind of expected, but is there a workaround?
\n\"image\"

\n

Info on the bug is at
\nhttps://youtrack.jetbrains.com/issue/GO-17791

", - "solution": "

JB released an update to the GoLand EAP. The 7.12.1 nightly build plugin seems to work with Build #GO-251.17181.28, built on January 23, 2025.

" - }, - { - "topic_id": 1765, - "title": "Still breaking Jetbrains indexes", - "question": "

Still getting the issue where running GoLand with the Cody plugin breaks project indexes in the IDE on a daily basis. Symptom is that code fragments are underlined in red even though they’re valid, code navigation like jump to definition is broken. Have to run the commands to repair the IDE to fix. Sometimes it’s bad enough that I have to disable Cody in order for the repair to complete.

\n

When I get fed up and disable Cody, I don’t these errors as often. If I enable Cody, they start up again.

\n

Running the 7.9.0-nightly plugin in GoLand 2024.3.1
\nBuild #GO-243.22562.186, built on December 11, 2024
\nRuntime version: 21.0.5+8-b631.28 aarch64 (JCEF 122.1.9)
\nVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
\nToolkit: sun.lwawt.macosx.LWCToolkit
\nmacOS 15.2
\nGC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
\nMemory: 16000M
\nCores: 10
\nMetal Rendering is ON
\nRegistry:
\nide.completion.variant.limit=500
\nsuggest.all.run.configurations.from.context=FALSE
\nide.experimental.ui=true
\ni18n.locale=
\nterminal.new.ui=true
\nNon-Bundled Plugins:
\norg.asciidoctor.intellij.asciidoc (0.43.6)
\ncom.sourcegraph.jetbrains (7.9.0-nightly)
\ncom.intellij.tailwindcss (243.22562.117)

\n

Originally reported in Cody seems to break Jetbrains indexes

", - "solution": "

I uninstalled all the JB editors, reinstalled just GoLand, removed as many plugins as I could and this is still happening. I’m convinced that it’s not caused by Cody. I’ve opened a bug report with JB.

\n

https://youtrack.jetbrains.com/issue/GO-18031/GoLand-randomly-loses-type-definitions

" - }, - { - "topic_id": 1834, - "title": "VScode extension not working in SSH remote connection", - "question": "

The sourcegraph search extension Rev. 2.2.19 doesn’t work as a remote extension in an SSH host/container: The Authentication dialog is not available at all and if you try to search something, I get the following error: “The connection was closed before your search was completed. This may be due to a problem with a firewall, VPN or proxy, or a failure with the Sourcegraph server.”

\n

The locally installed extension works pretty well…

", - "solution": "

Hi, I have found a work-a-round that works for me: I patched the package.json of sourcegraph.sourcegraph and set “extensionKind”: [ “ui” ], and then reinstalled the extension.

\n

When I now establish a remote connection, Sourcegraph code search works fine with the local settings also in the remote workspace.

\n

I see no reason why the extension should be installed on the remote host at all. Maybe extensionKind:[ui] would be a good default setting for the next release?

" - }, - { - "topic_id": 1813, - "title": "Deep cody experimentalShell", - "question": "

This warning appears when I uninstall and install cody.However, the setting does not exist.I could not see it in the cody setting in visual studio tools and jetbrain rider settings.

\n

‘cody.agentic.context.experimentalShell’ to true

", - "solution": "

Hey @serdar

\n

Since the latest pre-release, the correct configurations you need to provide in the settings.json file are:

\n
\t\"cody.agentic.context\": {\n\t\t\"shell\": {\n\t\t\t\"allow\": [\n\t\t\t\t\"*\"\n\t\t\t],\n\t\t\t\"block\": [\n\t\t\t\t\"git\"\n\t\t\t]\n\t\t}\n\t}\n
\n

Where the base blocked commands are this:

\n
BASE_DISALLOWED_COMMANDS = [\n    'rm',\n    'chmod',\n    'shutdown',\n    'history',\n    'user',\n    'sudo',\n    'su',\n    'passwd',\n    'chown',\n    'chgrp',\n    'kill',\n    'reboot',\n    'poweroff',\n    'init',\n    'systemctl',\n    'journalctl',\n    'dmesg',\n    'lsblk',\n    'lsmod',\n    'modprobe',\n    'insmod',\n    'rmmod',\n    'lsusb',\n    'lspci',\n]\n
\n

I hope that helps

" - }, - { - "topic_id": 1796, - "title": "Cody agent chewing up CPU", - "question": "

Weird and I hope that it’s a one-off. I clicked “new chat” and got no response. The Cody agent seems like it’s hung.

\n

\n

This is GoLand with the latest nightly build of the plugin.

", - "solution": "

Thanks, @mdhender, for reporting. I sent this to the team. In the meantime, can you please switch back to the previous nightly or stable build?

" - }, - { - "topic_id": 1792, - "title": "Extremely laggy in vscode", - "question": "

I’m using Cody regularly and it’s been nothing short of amazing, but with every update it has been getting more and more lag. And by lag I don’t mean the generation speed or answer time, I just mean my whole Vscode comes to a stop whenever I interact with Cody

\n

So opening a Cody chat window means like 5 seconds where I can’t click on anything and my cursor even “hangs” and jumps around.
\nThen once the chat window opens, same thing, the chat window hangs while it autofills the text input with the context of the current file and current project.

\n

Then when I click to submit an answer, it hangs again. When I try to navigate through my files or even write some code manually while an answer is being generated → lag and I can’t do anything

\n

Same when I click on the “copy” button of a generated answer, or I click “apply”, etc. Basically every interaction I have with Cody generates lag. Even changing the extension’s settings.

\n

It has now gotten to the point where it’s significantly slowing down my work, so I just wanted to let you know and see if you were aware of the issue or not. I really like your product and I would rather not bother looking into an alternative if this lag issue could be easily fixed

", - "solution": "

You can delete the entire chat in the chat history tab and there is a trash bin symbol at the top “Delete All”

" - }, - { - "topic_id": 1713, - "title": "Copy button on responses", - "question": "

I want a copy button on Cody responses like chatgpt has. Sometimes I ask cody to make markdown documentation, and I can’t copy it, so I as it to put it in a code block, but its not smart enough to know to escape “```” to prevent it from closing the code block, so its really frustrating to have to format that. Plus, a million other reasons why we need that copy button!

", - "solution": "

Based on the internal priority list, it is considered to bring that feature into the original Cody extension.

" - }, - { - "topic_id": 1676, - "title": "Is there a plan to open up O1-1217?", - "question": "

Hello! OpenAI has recently provided access to the O1-1217 API. I would like to know if Cody has any plans to support users in using O1-1217.

", - "solution": "

Hey @wudizhe002

\n

We are currently providing only the OpenAI o1-mini, -preview models. The team is evaluating the o1-full model. But I can’t say for sure if it makes it into Cody.

\n

Thank you.

" - }, - { - "topic_id": 622, - "title": "Public SourceGraph code search does not find my public github repo anymore", - "question": "

I have added a “chat to this repo” batch to my public repo:

\n

\nIt links to:
\nhttps://sourcegraph.com/github.com/pbernet/akka_streams_tutorial

\n

This used to work (after a login), but now it does not find the repo anymore and this message appears:
\n“To access this repository, contact the Sourcegraph admin”

\n

Also in the public Sourcegraph this repo is not visible anymore.

\n

Thx
\nPaul

", - "solution": "

Sorry about this, thank you for flagging. We have ensured your repository has been re-added to the index. We’re also looking into making the repo chat more obvious when a user opens the “Chat with my repo” link, thanks for linking to us!

" - }, - { - "topic_id": 1556, - "title": "Cody plugin opening multiple issues on Github at once", - "question": "

Some weirdness with Cody yesterday. Working in GoLand 2024.3 (GO-243.21565.208, Cody v7.3.2) and got the pop-up about an IDE error while I was rewriting a section of code. Cody’s trained me to ignore that for as long as I can (sometimes it goes away with me interacting with it). I finally gave in and clicked to report the error.

\n

I think Cody opened 80+ issues on Github. They were all closed this morning as duplicates (not complaining about that and sorry for the triage work).

\n

I want to make Cody better, so I report errors. I’m a user, so I’m not going to go through the stack trace and figure out if it is a duplicate or not. Kinda maybe sorta wondering if there is a better way to do this.

", - "solution": "

Thank you for reporting @mdhender

\n

No worries, I was the one closing all those issues generated. lol
\nI already informed the team about that bug and they are aware of working on it.

" - }, - { - "topic_id": 1511, - "title": "Number of active access tokens exceeds limit", - "question": "

I get the error “Number of active access tokens exceeds limit”, when trying to authenticate with cody for vscode.
\nI’m using cody on two machines, one is working fine and the other is within a development docker container and I ahve to authenticate every day.

\n

So my two questions are: Why do i have to login every day and is there a way to authenticate more consitent? And can I manage my access tokens somewhere to delete unused ?

", - "solution": "

everytime you authenticate cody adds active access token go to your account and reduce them by clicking delete

" - }, - { - "topic_id": 1500, - "title": "The login page takes a long time to load", - "question": "

Sourcegraph encountered an unexpected error.

\n

The login page takes a long time to load, the login screen appears every time I reopen the vscode app. And almost all chat requests are unresponsive.

\n

", - "solution": "

Hey everyone.

\n

The services have stabilized. All operations are functioning normally again.

\n

Thank you for your patience.

" - }, - { - "topic_id": 1290, - "title": "Plugin not loading", - "question": "

plugin version 7.0.13, i have pro version, ide version 2024.2.1

\n

in idea.log i see spam by this issue

\n

2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - Uncaught exception: SyntaxError: “undefined” is not valid JSON
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at JSON.parse ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at LocalStorageDB.get (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:132840:28)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at _AgentGlobalState.get (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:132796:26)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at LocalStorage.get (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:96677:29)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at LocalStorage.getClientState (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:96493:29)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at /home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:96500:34
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at Object. (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27465:34)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at Generator.next ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at /home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27504:71
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at new Promise ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at __awaiter3 (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27486:14)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at /home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:27464:40
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at AsyncSerialScheduler. (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:26819:17)
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at Generator.next ()
\n2024-10-24 09:43:25,012 [3786054] WARN - #com.sourcegraph.cody.agent.CodyAgent - at fulfilled (/home/dev/.local/share/JetBrains/PhpStorm2024.2/Sourcegraph/agent/index.js:26784:28)

", - "solution": "

Hi @simonproud

\n

This is a known issue and the work around for now is rolling back to 7.0.6 to fix it.

\n

Updates will be made to the issue on GitHub.

\n

Thanks!

" - }, - { - "topic_id": 1254, - "title": "🪄 Prompt Library has VANISHED!", - "question": "

My prompts in my prompt library no longer show up in VS Code and I’m prompted to “Add a prompt”. When I click on that link, I am taken to my Sourcegraph account and see all of my existing prompts in my prompt library.

\n

I have tried signing out and in of my Sourcegraph account, both in VS Code and online - to no avail.

\n

Please help. \":man_bowing:\"

", - "solution": "

I’m just curious, do your prompts have “draft” mode selected?
\nIf so, they won’t show up in the UI.

" - }, - { - "topic_id": 1238, - "title": "Granular Access Control: Group or Repository-Level Tokens", - "question": "

Hello Sourcegraph community,

\n

I’m looking for a way to implement more granular access control in our Sourcegraph instance. Specifically, I need to create access tokens that are limited to either specific groups or repositories.

\n
    \n
  • Use case: Using Cody CLI to run some AI workloads in a containerized environment. Using someone’s personal token for use with Cody CLI has significant drawback (what if the individual providing the token leaves the company? etc.)
  • \n
\n

Questions:

\n
    \n
  1. Is it possible to create repository-specific or group-based access tokens? as opposed to the personal token?
  2. \n
  3. If not, what’s the best alternative for implementing granular access control?
  4. \n
  5. Are there any upcoming features that might address this need?
  6. \n
\n

Any guidance or best practices would be greatly appreciated.

\n

Thank you!

", - "solution": "

Hello @VinAI

\n

This is a good question. The best channel for such questions is to mail support@sourcegraph.com.

\n

This seems to be more relevant to the enterprise support.

\n

Thank you.

" - }, - { - "topic_id": 1199, - "title": "Allow Attaching external Local file as Context", - "question": "

I am writing the backend and front end separately for a project. I want to speed up my frontend dev process by attaching a few files in the context of Cody AI of my frontend project. Right now, this cannot be done. I can only attach external links which is not suitable for this instance as the backend codebase is still being developed locally. Even if it was pushed to Git Hub, it would be private.

\n

It would be great if local files from a directory outside the codebase could be added as context.

\n

P.S: I am using Cody pro in Vscode.

", - "solution": "

@towfiqi if you open the local files within your vs code window you can reference them even if they are outside of the workspace. The key is to have them open and then they show up when you add @
\nHere are 2 screenshots where I show such a behavior, I simply hit ctrl + o and selected a file outside of the workspace and I am now able to ask it questions from Cody.
\nThis might be a hassle when you have many files that you need to reference from many folders but hey, it’s a workaround if you want to use it.
\n


\n

" - }, - { - "topic_id": 928, - "title": "Not obvious to me how to search a part of a tree", - "question": "

I used to be able to navigate within a repo and search part of it (sub-folder path). Now it seems like I can’t do this. Nor can I find commits that show changes only to a part of a sub-path.

\n

I found that I can click a small button on the left of the folder that looks like [o] , I guess to “zoom” into that folder (Tooltips could be helpful)?

\n

But clicking on that doesn’t change the url or anything, and switching to the Commits tab still shows commits for the entire repo which is not very useful when I work with many monorepos every day.

", - "solution": "

For anyone else hitting this: the way to replicate the previous behavior is to click into the search box, and click on “Search in current directory” so it’ll pre-fill the file: query and refine the scope, then type in the query.

" - }, - { - "topic_id": 1140, - "title": "Web interface slooooow to respond", - "question": "

Please give me a button option to turn off the slow response. Perplexity gives me responses almost instantly but I’m finding cody a little better at coding.

\n

Been using the web interface only. As my code gets longer, 130 lines, it’s very frustrating having to wait such a long time as cody slowly types out its response. Trying to do a bunch of rewrites quickly becomes frustrating.

\n

Cody told me that it generates its responses almost instantly behind the scenes but that its creators purposely throtttle how fast it is presented to make it look like someone is typing back at me. It said they are doing that to make it feel more like I’m interacting with a human.

\n

I could care less about it feeling like a human is typing back at me. I need these code changes fast. I can’t be boiling a pot of coffie everytime I wait for cody to sloooowly type out its response.

\n

Going to have to go back to Perplexity for most of my coding and have Cody only do the final rewrite to get things done faster.

", - "solution": "

Hello @CodyCrumbs
\ndue to a long chat session, the reply slows down in that cases.

\n

Or do you experiences that with a fresh start of a conversation too?

" - }, - { - "topic_id": 1057, - "title": "What data is shared with SourceGraph", - "question": "

Do you have a data sharing policy covering things like the data used for training Cody?

", - "solution": "

Hey @gareth-rogers-healx we do. Here it is: Sourcegraph - Cody Enterprise Terms of Use

" - }, - { - "topic_id": 1060, - "title": "Cody chat slowdown issue", - "question": "

I don’t know if this question has been asked before, but I’m really annoyed with the cody chat slowdown issue, it’s most likely due to context, because it only slows down after a few big requests.
\nI would like to know if this problem can be fixed by customizing the extension (limiting the number of messages for context) and how to do it? (if such a thing is possible)

", - "solution": "

Hello @errorbuglag

\n

The chat lag is known to the dev team and they are working on it.
\nUntil now, it is advisable to chunk your task into smaller pieces and start a new session for every subtask.

\n

I hope that helps.

" - }, - { - "topic_id": 273, - "title": "Cody Pro Retention Duration", - "question": "

Dear Sourcegraph Team,

\n

As per Sourcegraph - Cody Enterprise Terms of Use, Sourcegraph collects prompts and responses:

\n
\n

For individual users accessing the Sourcegraph Cody extension via Sourcegraph.com, Sourcegraph also collects the following User Content to support and improve user experience, though none of it will be used to train any generally available models:

\n
    \n
  • User Prompts
  • \n
  • LLM Prompts
  • \n
  • Responses
  • \n
\n
\n

I’m assuming “individual users” includes Cody Pro users. Is there a fixed retention duration for this data at the Pro tier? Similar to how OpenAI states that they persist prompts for 30 days.

", - "solution": "

Hey @JeremyTCD

\n

I know it’s been a long time since we talked about our retention policy.

\n

We are still working on reconciling our data retention policy (30-45 days; we are still determining the time) in a standard way (for Free, Pro, and Enterprise users), not making it an upsell feature.

\n

That is all I have for now.

" - }, - { - "topic_id": 952, - "title": "Beta UX missing \"show aggregate results\"", - "question": "

It appears as though the “Beta UX” is missing the incredibly helpful “show aggregation results” functionality from the legacy ux

\n

\"Screenshot

\n

Is this functionality getting sunset? or has it just not been implemented in the new version yet?

", - "solution": "

@mnitschke heard back:

\n
\n

“Currently we still plan to add this, though it might not work exactly the same as before.”

\n
\n

That is all I know ATM.

" - }, - { - "topic_id": 980, - "title": "[BUG] Chat Window Content Disappears While LLM is Responding - 1.32.4", - "question": "

Hi \":wave:\" The chat window disappears and never reappears again. I am using the latest version of Cody, but I also tested several earlier versions, and the issue persists. I reindexed the entire project but it didn’t help. The files are located in different folders (repos) but within the same VSCode workspace. The window does not disappear when adding a single file to context. I have reset both the extension and VSCode multiple times. No errors in the logs.

\n

Video: Watch Cody Error 1 | Streamable

", - "solution": "

Hey @Marc

\n

Thank you for reporting the issue.
\nDid you update to the latest Cody version 1.32.4?

\n

What are your specs, specifically the RAM size?

" - }, - { - "topic_id": 983, - "title": "Custom command context not working anymore", - "question": "

Hi Sourcegraph Cody Team,

\n

The custom command provided by the documentation aren’t working anymore. Here is the link to the documentation:

\n\n

For this example, I am using the commit message generation command. It seems, that cody tries to open a file with the name, which is defined in the “command” property in the cody.json file:
\n

\n

I am using Cody 1.32.4

", - "solution": "

This issue seems to be fixed in the pre-release version v1.33.1724858199, as the git diff is being used correctly \":grinning:\"

\n

" - }, - { - "topic_id": 947, - "title": "How to use \"chatPreInstruction\" in browser Cody chat?", - "question": "

Cody has a settings file for visual studio code - config.json in which I can write the settings I need, among them there is “chatPreInstruction”, is it possible to use this setting in the browser and if it is possible, how?

", - "solution": "

Great question. At this time, there isn’t, but I will make sure the product team sees this in the weekly community feedback report.

\n

Besides that missing feature, are you enjoying Cody for Web?

" - }, - { - "topic_id": 860, - "title": "Cody language completion for gleam", - "question": "

I am using gleam and I would love to have more language support for this language. it is basically trying to use javascript syntax when it doesn’t have a pattern to copy from in the source project.

\n

Anything I can do to help.

\n

Thanks

", - "solution": "

I was able to change the sg.nvim plugon to use the claude 3.5 and it is much better. I was able to solve a hard mode exercism question with only a little correction.

\n

Thank you!

" - }, - { - "topic_id": 876, - "title": "Cant sign in to cody", - "question": "

Sometimes its telling me 502: bad gateway, and sometimes nothing at all

", - "solution": "

Its working now, great job Sourcegraph team \":grin:\"\":saluting_face:\"

" - }, - { - "topic_id": 858, - "title": "JetBrains plugin v6.0.16 incompatible after 2024.2 update of IDE", - "question": "

GoLand 2024.2
\nBuild #GO-242.20224.306, built on August 6, 2024
\nRuntime version: 21.0.3+13-b509.4 aarch64 (JCEF 122.1.9)
\nVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
\nToolkit: sun.lwawt.macosx.LWCToolkit
\nmacOS 14.5
\nGC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
\nMemory: 16000M
\nCores: 10
\nMetal Rendering is ON
\nRegistry:
\nide.completion.variant.limit=500
\nsuggest.all.run.configurations.from.context=true
\nide.experimental.ui=true
\nNon-Bundled Plugins:
\norg.asciidoctor.intellij.asciidoc (0.42.2)
\ncom.intellij.tailwindcss (242.20224.204)

\n

\"image\"

", - "solution": "

@mdhender

\n

We’ve published stable version 6.0.25 in the marketplace which will fix the issue. Please let us know either way.

" - }, - { - "topic_id": 771, - "title": "When i try to login from IDE: Unexpected Error Not found: /post-sign-up", - "question": "

when i try to login from Intellij (github or google), i’m redirected to
\nhttps://sourcegraph.com/post-sign-up?returnTo=%2Fuser%2Fsettings%2Ftokens%2Fnew%2Fcallback%3FrequestFrom%3DJETBRAINS-63342&signin=OpenIDConnect

\n

Unexpected Error Not found: /post-sign-up

\n

I’m logged in on sourcegraph page.

", - "solution": "

I was able to find a way to get it to work.
\nUncheck experimental webapp on the sourcegraph console.
\nOddly it was enabled by default on my case.
\nIt probably is on yours as well.

" + "url": "https://community.sourcegraph.com/t/error-403-workspaces-forbidden-user-is-banned/2438", + "title": "Troubleshooting error: 403 workspaces forbidden user is banned", + "answer": "Hey @serverside-is in this case, please contact support@sourcegraph.com via e-mail for further clarification, since have no access to this data. They can help you better there than here." } ] \ No newline at end of file diff --git a/src/app/admin/add-forum-post/page.tsx b/src/app/admin/add-forum-post/page.tsx new file mode 100644 index 000000000..a643e92ea --- /dev/null +++ b/src/app/admin/add-forum-post/page.tsx @@ -0,0 +1,96 @@ +'use client' + +import { useState } from 'react' +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" + +export default function AddForumPost() { + const [url, setUrl] = useState('') + const [status, setStatus] = useState<{ + type: 'idle' | 'loading' | 'success' | 'error', + message: string + }>({ type: 'idle', message: '' }) + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + + if (!url) { + setStatus({ + type: 'error', + message: 'Please enter a forum post URL' + }) + return + } + + setStatus({ type: 'loading', message: 'Processing forum post...' }) + + try { + const response = await fetch('/docs/api/add-forum-post', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ url }), + }) + + const data = await response.json() + + if (!response.ok) { + throw new Error(data.error || 'Failed to add forum post') + } + + setStatus({ + type: 'success', + message: 'Forum post added successfully!' + }) + setUrl('') + } catch (error) { + console.error('Error adding forum post:', error) + setStatus({ + type: 'error', + message: error instanceof Error ? error.message : 'An unknown error occurred' + }) + } + } + + return ( +
+

Add Community Forum Post

+ +
+
+
+

+ Enter the URL of a Sourcegraph community forum post. +

+ +
+ setUrl(e.target.value)} + /> + +
+
+ + {status.message && ( +
+ {status.message} +
+ )} +
+
+
+ ) +} diff --git a/src/app/api/add-forum-post/route.ts b/src/app/api/add-forum-post/route.ts new file mode 100644 index 000000000..d15eb0de0 --- /dev/null +++ b/src/app/api/add-forum-post/route.ts @@ -0,0 +1,185 @@ +import {NextRequest, NextResponse} from 'next/server'; +import fs from 'fs'; +import path from 'path'; + +// Helper function to convert HTML to plain text +function htmlToText(html: string): string { + // Remove HTML tags + let text = html.replace(/<[^>]*>/g, ' '); + + // Replace HTML entities + text = text + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, "'") + .replace(/ /g, ' '); + + // Replace multiple spaces with a single space + text = text.replace(/\s+/g, ' '); + + // Trim leading and trailing spaces + return text.trim(); +} + +export async function POST(request: NextRequest) { + try { + const {url} = await request.json(); + + if (!url) { + return NextResponse.json({error: 'URL is required'}, {status: 400}); + } + + // Extract the topic ID from the URL + let topicUrl = url; + + // Ensure the URL ends with .json + if (!topicUrl.endsWith('.json')) { + topicUrl = `${topicUrl}.json`; + } + + // Fetch the topic data + const response = await fetch(topicUrl); + + if (!response.ok) { + return NextResponse.json( + { + error: `Failed to fetch topic: ${response.status} ${response.statusText}` + }, + {status: 500} + ); + } + + const topicData = await response.json(); + + if ( + !topicData.post_stream || + !topicData.post_stream.posts || + topicData.post_stream.posts.length === 0 + ) { + return NextResponse.json( + {error: 'Invalid topic data format'}, + {status: 400} + ); + } + + const posts = topicData.post_stream.posts; + + // Find the accepted answer + let solution = null; + + // First check if there's an accepted_answer object at the root level with excerpt + if (topicData.accepted_answer && topicData.accepted_answer.excerpt) { + // Use the excerpt directly as it's already in plain text + solution = htmlToText(topicData.accepted_answer.excerpt); + + } else { + // If no excerpt, try to find the post with the matching post_number + let solutionHtml = null; + + if ( + topicData.accepted_answer && + topicData.accepted_answer.post_number + ) { + const acceptedPost = posts.find( + post => + post.post_number === + topicData.accepted_answer.post_number + ); + if (acceptedPost) { + solutionHtml = acceptedPost.cooked; + } + } + + // If still no solution, try the post.accepted_answer property + if (!solutionHtml) { + const acceptedAnswerPost = posts.find( + post => post.accepted_answer === true + ); + + if (acceptedAnswerPost) { + solutionHtml = acceptedAnswerPost.cooked; + } else if (posts.length > 1) { + // If no post is marked as accepted_answer, use the first reply as a fallback + solutionHtml = posts[1].cooked; + } + } + + if (solutionHtml) { + solution = htmlToText(solutionHtml); + } + } + + if (!solution) { + return NextResponse.json( + { + error: 'Could not extract solution from the topic' + }, + {status: 400} + ); + } + + // Extract the original URL without .json + const originalUrl = url.endsWith('.json') + ? url.substring(0, url.length - 5) + : url; + + // Create a more descriptive title + const descriptiveTitle = topicData.title + ? `Troubleshooting ${topicData.title.toLowerCase()}` + : posts[0].topic_slug.replace(/-/g, ' '); + + // Create the new entry with the target structure + const newEntry = { + url: originalUrl, + title: descriptiveTitle, + answer: solution + }; + + // Read the existing data + const dataFilePath = path.join( + process.cwd(), + 'baseai/memory/community-forum/data/forum-topics.json' + ); + let existingData = []; + + try { + const fileContent = fs.readFileSync(dataFilePath, 'utf8'); + existingData = JSON.parse(fileContent); + } catch (error) { + console.error('Error reading forum-topics.json:', error); + // If file doesn't exist or is empty, we'll start with an empty array + } + + // Check if the topic already exists (by URL) + const existingIndex = existingData.findIndex( + item => item.url === newEntry.url + ); + + if (existingIndex !== -1) { + // Update existing entry + existingData[existingIndex] = newEntry; + } else { + // Add new entry + existingData.push(newEntry); + } + + // Write the updated data back to the file + fs.writeFileSync(dataFilePath, JSON.stringify(existingData, null, 2)); + + return NextResponse.json({ + success: true, + message: 'Forum post added successfully', + entry: newEntry + }); + } catch (error) { + console.error('Error processing forum post:', error); + return NextResponse.json( + { + error: 'Failed to process forum post' + }, + {status: 500} + ); + } +} diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx new file mode 100644 index 000000000..d43e9b600 --- /dev/null +++ b/src/components/ui/input.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import { cn } from "@/lib/utils" + +export interface InputProps + extends React.InputHTMLAttributes { } + +const Input = React.forwardRef( + ({ className, type, ...props }, ref) => { + return ( + + ) + } +) +Input.displayName = "Input" + +export { Input } diff --git a/src/middleware.ts b/src/middleware.ts index 9c237a9e8..254398f27 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,5 +1,5 @@ -import type { NextRequest } from 'next/server'; -import { NextResponse } from 'next/server'; +import type {NextRequest} from 'next/server'; +import {NextResponse} from 'next/server'; import docsConfig from '../docs.config.js'; const {updatedRedirectsData} = require('./data/redirects.ts'); @@ -137,5 +137,8 @@ export function middleware(request: NextRequest) { } export const config = { - matcher: ['/((?!api|_next/static|_next/image|assets|favicon.ico|sw.js).*)'] + matcher: [ + '/((?!api|_next/static|_next/image|assets|favicon.ico|sw.js).*)', + '/admin/:path*' + ] }; From 87021e962b3f23d8e5254ffd130b6d980fb732ae Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Wed, 9 Apr 2025 00:37:11 +0500 Subject: [PATCH 3/7] Updated layout --- .../add-forum-post => community-forum}/page.tsx | 0 src/components/Layout.tsx | 16 +++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) rename src/app/{admin/add-forum-post => community-forum}/page.tsx (100%) diff --git a/src/app/admin/add-forum-post/page.tsx b/src/app/community-forum/page.tsx similarity index 100% rename from src/app/admin/add-forum-post/page.tsx rename to src/app/community-forum/page.tsx diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index b0d3ac8bd..34927f0af 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -103,6 +103,7 @@ function Header() { export function Layout({ children }: { children: React.ReactNode }) { let pathname = usePathname(); let isHomePage = pathname === '/'; + let isCommunityForumPage = pathname === '/community-forum'; return (
@@ -112,13 +113,14 @@ export function Layout({ children }: { children: React.ReactNode }) { {/* {isHomePage && } */}
-
-
-
-
- -
-
+ {!isCommunityForumPage && +
+
+
+
+ +
+
} {children}
From 311282835b2ff2e3cf91ba6ccbe65c56ab7b31f1 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Wed, 9 Apr 2025 00:51:12 +0500 Subject: [PATCH 4/7] Refactoring --- .../community-forum/data/forum-topics.json | 35 ------ package.json | 4 +- scripts/fetchSolvedQuestions.js | 101 ------------------ 3 files changed, 1 insertion(+), 139 deletions(-) delete mode 100644 scripts/fetchSolvedQuestions.js diff --git a/baseai/memory/community-forum/data/forum-topics.json b/baseai/memory/community-forum/data/forum-topics.json index c4695659f..68afc4368 100644 --- a/baseai/memory/community-forum/data/forum-topics.json +++ b/baseai/memory/community-forum/data/forum-topics.json @@ -3,40 +3,5 @@ "url": "https://community.sourcegraph.com/t/updating-cody-search-index-hangs-forever/2275", "title": "Troubleshooting updating cody search index... hangs forever", "answer": "I have been on this for two weeks. Now, I believe it is not directly related to Cody. I had Python Extension deactivated, and activating it fixed the problem." - }, - { - "url": "https://community.sourcegraph.com/t/claude-3-7-sonnet-does-not-show-in-model-list-es-plan/2259", - "title": "Troubleshooting claude 3.7 sonnet does not show in model list es plan", - "answer": "Hey @vbvictor All models available on Pro will be rollout out gradually to Enterprise Starters. The team is already aware of it and working on it. Sorry for the inconvenience." - }, - { - "url": "https://community.sourcegraph.com/t/security-question/2115", - "title": "Troubleshooting security question", - "answer": "As far as I know then if you are using your own API key and model configuration with cody.dev.models then request is directly made to your provider. Of course, maybe some additional processing may happen in the background to fetch the context and send some telemetry data but overall the processed pr…" - }, - { - "url": "https://community.sourcegraph.com/t/vscode-extension-not-working-in-ssh-remote-connection/1834", - "title": "Troubleshooting vscode extension not working in ssh remote connection", - "answer": "Hi, I have found a work-a-round that works for me: I patched the package.json of sourcegraph.sourcegraph and set “extensionKind”: [ “ui” ], and then reinstalled the extension. When I now establish a remote connection, Sourcegraph code search works fine with the local settings also in the remote wor…" - }, - { - "url": "https://community.sourcegraph.com/t/hitting-limits-due-to-model-switching/2200", - "title": "Troubleshooting hitting limits due to model switching", - "answer": "Update: My ban was overturned. It appears that was related to “problematic code”. Below is the reply I received: Thank you for contacting Sourcegraph. Based on reports, feedback, and reports we got, we strongly suspect that we have done some over-banning and are working to correct that by rollin…" - }, - { - "url": "https://community.sourcegraph.com/t/change-the-plan/2315", - "title": "Troubleshooting change the plan", - "answer": "I got a message back. What we can do is cancel the subscription and you need to resubscribe. What do you think?" - }, - { - "url": "https://community.sourcegraph.com/t/extremely-laggy-in-vscode/1792", - "title": "Troubleshooting extremely laggy in vscode", - "answer": "You can delete the entire chat in the chat history tab and there is a trash bin symbol at the top “Delete All”" - }, - { - "url": "https://community.sourcegraph.com/t/error-403-workspaces-forbidden-user-is-banned/2438", - "title": "Troubleshooting error: 403 workspaces forbidden user is banned", - "answer": "Hey @serverside-is in this case, please contact support@sourcegraph.com via e-mail for further clarification, since have no access to this data. They can help you better there than here." } ] \ No newline at end of file diff --git a/package.json b/package.json index adf408352..ac6527a64 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,7 @@ "lint": "next lint", "baseai": "baseai", "sync": "npx baseai@latest deploy -m docs", - "llmstxt": "node scripts/llms-txt-generator.js", - "fetch-solved-questions": "node scripts/fetchSolvedQuestions.js", - "sync-community-forum": "npm run fetch-solved-questions && git add baseai/memory/community-forum/data/forum-topics.json && git commit -m 'Update community forum data' && npx baseai@latest deploy -m community-forum" + "llmstxt": "node scripts/llms-txt-generator.js" }, "browserslist": "defaults, not ie <= 11", "dependencies": { diff --git a/scripts/fetchSolvedQuestions.js b/scripts/fetchSolvedQuestions.js deleted file mode 100644 index 32d205076..000000000 --- a/scripts/fetchSolvedQuestions.js +++ /dev/null @@ -1,101 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -// Function to fetch solved topics -async function fetchSolvedTopics() { - try { - const searchUrl = - 'https://community.sourcegraph.com/search.json?q=status:solved'; - const response = await fetch(searchUrl); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - const data = await response.json(); - return data.posts; - } catch (error) { - console.error('Error fetching solved topics:', error); - return []; - } -} - -// Function to fetch full topic details -async function fetchTopicDetails(topicId) { - try { - const topicUrl = `https://community.sourcegraph.com/t/${topicId}.json`; - const response = await fetch(topicUrl); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - const data = await response.json(); - return data; - } catch (error) { - console.error(`Error fetching topic ${topicId}:`, error); - return null; - } -} - -// Function to process and save solved questions and answers -async function processAndSaveSolvedQuestions() { - const solvedTopics = await fetchSolvedTopics(); - const results = []; - - for (const topic of solvedTopics) { - const topicDetails = await fetchTopicDetails(topic.topic_id); - - if ( - topicDetails && - topicDetails.post_stream && - topicDetails.post_stream.posts - ) { - const posts = topicDetails.post_stream.posts; - - // Extract the question (first post) - const question = posts[0].cooked; - - // Find the accepted answer - look specifically for the post with accepted_answer: true - let solution = null; - - const acceptedAnswerPost = posts.find( - post => post.accepted_answer === true - ); - - if (acceptedAnswerPost) { - solution = acceptedAnswerPost.cooked; - } else if (posts.length > 1) { - // If no post is marked as accepted_answer, use the first reply as a fallback - solution = posts[1].cooked; - } - - if (question && solution) { - results.push({ - topic_id: topic.topic_id, - title: topicDetails.title, - question, - solution - }); - } - } - } - - // Create the data directory if it doesn't exist - const dataDir = path.join( - __dirname, - '../baseai/memory/community-forum/data' - ); - if (!fs.existsSync(dataDir)) { - fs.mkdirSync(dataDir, {recursive: true}); - } - - // Save all topics in a single JSON file - fs.writeFileSync( - path.join(dataDir, 'forum-topics.json'), - JSON.stringify(results, null, 2) - ); - - console.log( - 'Solved questions and answers saved to baseai/memory/community-forum/data/forum-topics.json' - ); -} - -// Run the script -processAndSaveSolvedQuestions(); From 689f4a4238636dfdcf25e78757899a3fc33f2c1d Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Wed, 9 Apr 2025 01:21:03 +0500 Subject: [PATCH 5/7] Updated middlewara --- src/middleware.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/middleware.ts b/src/middleware.ts index 254398f27..dc0ed19cd 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,5 +1,5 @@ -import type {NextRequest} from 'next/server'; -import {NextResponse} from 'next/server'; +import type { NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import docsConfig from '../docs.config.js'; const {updatedRedirectsData} = require('./data/redirects.ts'); @@ -137,8 +137,5 @@ export function middleware(request: NextRequest) { } export const config = { - matcher: [ - '/((?!api|_next/static|_next/image|assets|favicon.ico|sw.js).*)', - '/admin/:path*' - ] + matcher: ['/((?!api|_next/static|_next/image|assets|favicon.ico|sw.js).*)', '/community-forum'] }; From 4844ce00e371471d6a1416eb81ffd5565fa14e7b Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Wed, 9 Apr 2025 01:21:56 +0500 Subject: [PATCH 6/7] Refactoring --- baseai/baseai.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseai/baseai.config.ts b/baseai/baseai.config.ts index 41bcc3979..f0ee748f5 100644 --- a/baseai/baseai.config.ts +++ b/baseai/baseai.config.ts @@ -1,4 +1,4 @@ -import type {BaseAIConfig} from 'baseai'; +import type { BaseAIConfig } from 'baseai'; export const config: BaseAIConfig = { log: { From 0f46d313eb4469b433e9272079fc250ee2138f56 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Wed, 9 Apr 2025 22:20:10 +0500 Subject: [PATCH 7/7] Fixed type issues --- src/app/api/add-forum-post/route.ts | 6 +++--- src/app/community-forum/page.tsx | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/api/add-forum-post/route.ts b/src/app/api/add-forum-post/route.ts index d15eb0de0..2ba64ef81 100644 --- a/src/app/api/add-forum-post/route.ts +++ b/src/app/api/add-forum-post/route.ts @@ -83,7 +83,7 @@ export async function POST(request: NextRequest) { topicData.accepted_answer.post_number ) { const acceptedPost = posts.find( - post => + (post: { post_number: number }) => post.post_number === topicData.accepted_answer.post_number ); @@ -95,7 +95,7 @@ export async function POST(request: NextRequest) { // If still no solution, try the post.accepted_answer property if (!solutionHtml) { const acceptedAnswerPost = posts.find( - post => post.accepted_answer === true + (post: { accepted_answer: boolean }) => post.accepted_answer === true ); if (acceptedAnswerPost) { @@ -154,7 +154,7 @@ export async function POST(request: NextRequest) { // Check if the topic already exists (by URL) const existingIndex = existingData.findIndex( - item => item.url === newEntry.url + (item: { url: string }) => item.url === newEntry.url ); if (existingIndex !== -1) { diff --git a/src/app/community-forum/page.tsx b/src/app/community-forum/page.tsx index a643e92ea..30d2d748e 100644 --- a/src/app/community-forum/page.tsx +++ b/src/app/community-forum/page.tsx @@ -25,7 +25,8 @@ export default function AddForumPost() { setStatus({ type: 'loading', message: 'Processing forum post...' }) try { - const response = await fetch('/docs/api/add-forum-post', { + const basePath = process.env.VERCEL_ENV === 'production' ? '/docs' : '' + const response = await fetch(`${basePath}/api/add-forum-post`, { method: 'POST', headers: { 'Content-Type': 'application/json',