jsuagee
jsuagee2y ago

Issue with changes in typescript source code taking effect when using VScode

Hi all! I've been trying to edit a typescript file to log something to the console, but it seems that none of the changes that I'm making are taking any effect. I'm using VScode as my IDE. The code is from this neat project called ai-town, repository here: https://github.com/a16z-infra/ai-town I did a google search about it and found that it may have to do with the tsconfig.json files that are in the project, but I'm in deep water here, I have no prior background in any web programming. Regular programming yes, but not this. Any help, hints or advice I would really appreciate!
GitHub
GitHub - a16z-infra/ai-town: A MIT-licensed, deployable starter kit...
A MIT-licensed, deployable starter kit for building and customizing your own version of AI town - a virtual town where AI characters live, chat and socialize. - GitHub - a16z-infra/ai-town: A MIT-l...
10 Replies
jamwt
jamwt2y ago
@jsuagee hey! can you share the code and let us know which file it's in? we're pretty familiar with the AI town codebase and when you say console, you mean the browser's javascript console under developer tools? or a command line, console, or convex console?
jsuagee
jsuageeOP2y ago
I was editing the file here https://github.com/a16z-infra/ai-town/blob/main/convex/conversation.ts Basically I replaced the next to last line
//return description === '1';
return false;
//return description === '1';
return false;
in the function walkAway(). I was atttempting to prolongue a conversation between two of the characters. If the change took effect then I think that two characters in a conversation should never leave the conversation. That wasn't what happened though. Is there a better way for me to share the code with you that you might prefer more?
GitHub
ai-town/convex/conversation.ts at main · a16z-infra/ai-town
A MIT-licensed, deployable starter kit for building and customizing your own version of AI town - a virtual town where AI characters live, chat and socialize. - a16z-infra/ai-town
jsuagee
jsuageeOP2y ago
I was checking through the browser console. I didn't even know about the convex console? Oh, I was trying to log something after line 181 in that same file, which is in a function called converse() that I believe gets called repeatedly in a conversation.
jamwt
jamwt2y ago
is npx convex dev running in the background?
jsuagee
jsuageeOP2y ago
I ran npm run dev, which I think runs convex dev. Let me check
jamwt
jamwt2y ago
great! I think it does so, this function runs inside the backend the right place to watch those logs is in the convex dashboard if you run npx convex dashboard it should open up your browser and load the dashboard associated with your AI Town there is a logs panel there that shows you the console logs of jobs running in the background on this backend and that's where you (hopefully!) see your logging reflected just keep npx convex dev (via npm run dev is fine) running in the background so that as you change the files in your convex/ folder convex is automatically live-updating your backend
jsuagee
jsuageeOP2y ago
Ok, let me check OK cool, I can see the console log statements now. Awesome Thank you!
jamwt
jamwt2y ago
great! no problem. thanks for trying out AI town and convex let us know if we can help more
jsuagee
jsuageeOP2y ago
How do I shut down these processes on convex? There's a couple of cron jobs that are scheduled to repeat every 60 seconds One of them is recoverThinkingAgents for example
ballingt
ballingt2y ago
The good news is you shouldn't need to for a while, you can see the Convex quota you're using for this in the dashboard. But to disable these you'll need to comment out the cron jobs in convex/crons.ts while npm run dev is running. The strong version of this is deleting the Convex deployment in the Convex dashboard, which isn't too extreme because you can export the data if you want it and the only setup work you'll have to do when you want to start it up again is creating a new project and pasting in those environment variables. A Disable Cron Jobs button or even a big OFF switch for everything sound useful, we're thinking about this kind of thing too.

Did you find this page helpful?