DevoxxGenie 1.16.0: run_script Code Mode and Leaner Long Conversations
DevoxxGenie 1.16.0 is a minor release with two changes that both save tokens. The agent can now batch many tool calls into one JavaScript step, and adding your whole project to a conversation no longer makes every follow-up prompt more expensive than the last.
๐งฉ run_script: batch tool calls in one JavaScript step (experimental)โ
In agent mode, every tool call is a model round trip, and every raw result stays in chat memory. For a question like "which controllers don't have a test?" that means dozens of calls and a context window full of search results the model only needed a name from.
With the new run_script tool, the model writes a short JavaScript snippet instead. It calls other tools as await tools.search_files({ ... }), loops and filters over the results, and returns only what it prints:
const missing = [];
for (const name of controllers) {
const hits = await tools.search_files({ pattern: `class ${name}Test`, path: "src/test/java" });
if (!hits.includes(`${name}Test`)) missing.push(name);
}
text(missing.join("\n"));
- Scripts run in a sandboxed QuickJS engine compiled to plain Java bytecode: no Node.js, file system, network or timers, a 128 MiB memory cap and a 30-second JavaScript time budget.
- Every call inside a script goes through the same tool toggles, approval dialogs, command blacklist and activity rows as a direct call.
run_scriptcounts as one call toward Max tool calls per prompt; calls inside a script are capped by a new Max tool calls per script setting (default 100).- It's off by default. Turn it on under Settings โ Tools โ DevoxxGenie โ Agent โ Built-in Tools โ run_script (Experimental).
Code mode was suggested and implemented by @omarmahamid (#1352, #1353). Thank you, Omar! For how it works, the sandbox and when to use it, read the dedicated post: run_script: Let the Agent Batch Its Tool Calls in JavaScript, or the Agent Mode docs.
๐ง "Add Project" context is sent once, not with every messageโ
When you clicked Add Project, DevoxxGenie copied the full project snapshot into the text of every prompt you sent, and chat memory kept each copy. After five prompts, the conversation history held five copies of your project, most of them out of date.
That had three effects:
- The context window filled up far too early. The real conversation was small, but the duplicated project text wasn't.
- Every stale copy was sent again on each request, so you paid for it again on each request.
- With a large project, the second prompt could fail with "prompt too long". The snapshot is truncated to the model's context window, so a single copy can be about as big as the window. This looked like "my project is too big for the model" when the real cause was duplication.
Now the snapshot is sent exactly once per request, in a <ProjectFilesContext> section of the system prompt. The system prompt is a single message at the top of chat memory and is replaced, not appended to, so the project is never duplicated:
- Adding the project mid-conversation adds the section without touching earlier turns, and removing it removes the section from the next request.
- The agent/MCP tool loop includes it on every request in the loop.
- OpenAI o1 models, which don't accept a system message, get it in their per-message
<SystemPrompt>block. - CLI and ACP runners get it once per request in a
<project_context>block.
The snapshot is still sent with every request while it's active (the model needs it), so remove the project once you're done with it to save input tokens.
A bonus fix: restored conversations get their system prompt backโ
Conversations restored from the history dropdown only contain your messages and the answers, with no system message. Until now, a restored conversation silently ran without your persona, DEVOXXGENIE.md, CLAUDE.md/AGENTS.md or the tool instructions. The same check that keeps the project section up to date now installs the current system prompt before the next prompt, so restored conversations behave like fresh ones.
Thanks to @SamyNassiem for tracking this down and for the end-to-end tests that run the real memory and message classes over several turns (#1363, #1364). This is the first step of a longer effort to make long sessions smarter. A token-budgeted memory window and conversation compaction are next.
๐ Documentationโ
The plugin reference guides were brought in line with the current UI, token-cost and context-window examples were refreshed, and the Agent Mode page now documents run_script in full.
๐ Thank you, contributorsโ
- @omarmahamid:
run_scriptcode mode - @SamyNassiem: sending project context once via the system prompt, and restoring the system prompt for restored conversations
Getting itโ
DevoxxGenie 1.16.0 is available from the JetBrains Marketplace; update it from Settings โ Plugins. The full list of changes is in the changelog and the GitHub release.
