Skip to content

feat: upgrade AI tools, fix Windows ESM, add calculate/runCode/fetchP…#9

Open
IshekKhal wants to merge 1 commit into
open-devhub:mainfrom
IshekKhal:feature/upgrade-ai-tools
Open

feat: upgrade AI tools, fix Windows ESM, add calculate/runCode/fetchP…#9
IshekKhal wants to merge 1 commit into
open-devhub:mainfrom
IshekKhal:feature/upgrade-ai-tools

Conversation

@IshekKhal
Copy link
Copy Markdown

What this PR does

Significantly upgrades the AI system's capability, answer quality, and tool coverage — without changing the infrastructure or increasing operating costs.


Changes

New tools

  • calculate — evaluates math expressions, algebra, unit conversions, trig, and stats via mathjs. The model now uses this for all numeric work instead of computing in its head.
  • runCode — executes JavaScript in a sandboxed Node.js vm context with a 3s timeout. Used for logic puzzles, algorithms, and code verification.
  • fetchPage — fetches and parses any URL into readable text using turndown (already a project dependency). Lets the model read full pages instead of just search snippets.
  • searchNews — dedicated news search using Exa's neural search with a 7-day recency filter. Fixes stale/hallucinated answers for "latest news" queries.

Improved existing tools

  • get-search.js: upgraded from fast to neural search type, results increased from 3→5, highlight length increased from 500→1500 chars.

Tuned AI parameters in askai.js

  • temperature: 0.8 → 0.4 (more accurate on reasoning and math)
  • maxOutputTokens: 640 → 2000 (no more cut-off answers)
  • stepCountIs: 5 → 15 (supports multi-step tool chains)
  • System prompt updated to instruct the model when to use each tool

Bug fix

  • handleCommands.js: fixed ERR_UNSUPPORTED_ESM_URL_SCHEME crash on Windows by wrapping dynamic import paths with pathToFileURL().href

Testing

Tested locally on Windows with Node.js v25. Bot connects, commands resolve, and all new tools are reachable via the AI tool chain.

Copy link
Copy Markdown
Member

@calebephrem calebephrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, excellent work
but, we've already cleared some of the commands out in PR #8 tho, since we wanted pawgrammer to be ai only bot
we've split the files you added back into the two other bots we have (panda and quill). all coding and documentation commands go to quill; rule and macros go to panda bot.
also, the ++ prefix command is now used for panda's macro and rules command

Comment thread src/commands/ai/askai.js
temperature: 0.8,
maxOutputTokens: 640,
temperature: 0.4,
maxOutputTokens: 2000,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this one is alittle bit too much

Comment on lines +79 to +83
"- `++persona list`",
"- `++persona current`",
"- `++persona who`",
"- `++persona set debugcoach`",
"- `++persona motivator`",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're not using ++ as prefix from now on because this prefix is for macros on panda bot, #18

Comment thread src/commands/docs/mdn.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feature is handled by quill now, #10

Comment thread src/commands/docs/wiki.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for this one

Comment thread src/tools/run-code.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running code, ai code suggestions, fixing errors etc is why quill is made for

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all rules are also handled by panda bot now, #18

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all macros/references are now handled by pandabot, #18

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github repo and user commands are also handled by quill #10

@IshekKhal IshekKhal force-pushed the feature/upgrade-ai-tools branch from 0aa8e7b to 1d1768e Compare April 24, 2026 07:10
@IshekKhal IshekKhal force-pushed the feature/upgrade-ai-tools branch from 1d1768e to be5c697 Compare April 24, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants