Plugins can drive the session directly, with per-plugin budgets#
Code-based plugin hooks get a full in-process API to drive the session, budgeted per plugin.
What's wrong with this entry?
Plugin hooks written in code now get an in-process API for talking to the running session: status lines and toasts, asking the user a question, reading session messages and turn count, listing and spawning agents, calling and listing tools, registering new tools, and calling MCP servers. Every one of those is budgeted so a misbehaving plugin cannot flood you. Nothing in this build sets a flag for the surface as a whole, so it is present for everyone on 2.1.242.
- Toasts past the eighth in a session are dropped to the debug log, with a single warning toast to say so.
- Asking the user a question is refused past a per-session count and within a minimum interval of the previous question.
- Spawning agents is capped both per session and by how many run at once.
- Tool registration is capped per plugin, refuses reserved MCP server names, and refuses to shadow an MCP server you already have configured. Success and failure are measured, including the cases where no registrar exists yet and where the tool is registered but not yet visible.
- The build also ships a separate worker script entry point for running these hooks outside the main process.
plugin_function_hooks_register_tool
Strings lifted out of the shipped bundle, so the claim above can be checked against them.