Skip to content

Integration hot loading#185

Draft
brandomr wants to merge 6 commits into
devfrom
integration-loader
Draft

Integration hot loading#185
brandomr wants to merge 6 commits into
devfrom
integration-loader

Conversation

@brandomr
Copy link
Copy Markdown
Contributor

@brandomr brandomr commented Apr 1, 2026

Experiment Overview

This PR is EXPERIMENTAL: it attempts to address a challenge we have with adhoc-api: the actual code running agent remains pretty "dumb" to the integration after it calls the draft/consult integration tool(s). In long ReAct loops you see behavior where the Beaker agent struggles but doesn't re-call those tools.

Instead, I propose a new experiment: provide the agent tools to load/unload integration docs straight into it's context window via auto_context.

The upside to this is that the agent seems to perform better overall with the integration. The downside is that the ReAct loop ends up with more tokens and costs more. Also, the agent has to remember to properly unload the integration otherwise that info will persist in the system prompt.

Additionally, if this proves viable we can remove adhoc-api altogether as a dependency.

Issues and Challenges

I tried to automatically unload the integration at the end of the ReAct loop, but in certain contexts, such as Biome, the agent always presents a plan before doing work. With Claude Sonnet 4.6 it doesn't call final_answer or ask_user it just ends the ReAct loop. So understanding how and when to automatically prune the context is very tricky. The workaround is the
unload_integration_docs tool, but I have concerns about the agent reliably calling this tool when appropriate. In my tests with sonnet 4.6 it did it flawlessly though.

Worst case, the agent doesn't unload the integration and we reach summarization sooner.

Testing

I tested this with the integration-loader branch of Biome https://github.com/jataware/biome/tree/integration-loader where the draft/consult integration docs tools are disabled and the agent only uses the load/unload tooling.

@brandomr brandomr requested a review from mattprintz April 1, 2026 18:44
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.

1 participant