Repository navigation
Conversation
…m code in a QuickJS runner of its own Agents write a short JavaScript or TypeScript program that calls pap.startTask, pap.connections, pap.tools, pap.call, pap.finishTask and pap.feedback, so one model turn can look through several accounts at once and answer with only what it needs. Every call still goes through the gate and into the activity log. The script runs in QuickJS (WebAssembly) in a process of its own with an empty environment, with limits on its time, memory, output and calls kept by the api. The MCP server and the built-in agent's sub-agents both use it; read and run are merged into pap.call, and the pre-task failsafe is gone.
…c takes a sandbox's id, and that pap.feedback goes in a script Found running the built-in agent on the demo workspace: both models gave sandbox_exec the name they had just made a sandbox with, a script running calls at once couldn't tell which one failed, and a sub-agent called pap.feedback as a tool of its own.
The MCP instructions and script tool, the built-in agent's prompts, tools and log notes, the script answers, the errors and what pap.tools gives are each about 60% shorter: what a tool does in detail stays in its own description, which pap.tools gives when it is needed. On the demo workspace, Claude answered every case as before with 31% fewer input tokens.
An empty answer woken by an event, not by the person, is kept as no words: the page already shows no answer without them, and the log replays none to the model, which can't send an empty message. One to the person still says it had nothing to say.
…-cli-planning # Conflicts: # packages/api/src/harness/thread-task.ts
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents now have one tool,
script: a short JavaScript or TypeScript program whosepapfunctions (startTask,connections,tools,call,finishTask,feedback) replace the seven MCP tools. One model turn can look through several accounts at once withPromise.all, go through what it found in code, and answer with only what it needs, rather than a model call per tool call. Everypap.callstill goes throughrunAgentTool, so access, tasks and the activity log are unchanged;readandrunare merged into it.Scripts run in QuickJS (WebAssembly) in a runner process of its own, started with an empty environment and used for one script; a spare is kept ready, so a script starts in about 15 ms. The api keeps the limits a broken runner can't get around (150 s wall clock, 2 MB output, 200 calls, 8 at once), and the runner the memory, stack and CPU ones. Sucrase strips TypeScript types without moving lines, so errors point at the agent's own line numbers.
Also:
scripttoo, without starting or finishing tasks, and an interrupted script is never run again, since it may have written something.script), and with itrunAgentTool'sreadOnlyoption; a call of a tool no longer listed is told the tool list changed.scriptand thepapfunctions.After deploy, connected MCP clients need to fetch the tool list again: those that handle
list_changeddo so on their next call; others need reconnecting.Open workspace in Conductor