State-Aware Sandbox Protocol Learning
Teach language agents environment awareness by supervising tool calls with hidden thought blocks containing active sandbox state variables.
Time
Compute level
Resources
Prerequisites
Scope
The Gap
Section 6.4 notes that the model demonstrates 'insufficient familiarity with sandbox ID management' (forgetting to initialize) and often misuses the Python execution tool for tasks better suited for the web scraper (e.g., reading PDFs). This indicates the SFT data lacks explicit supervision on environment state management.
Limitation
The model treats tool calls as stateless function invocations rather than managing a persistent environment, leading to runtime errors (timeouts, uninitialized sandboxes) and inefficient tool selection.
Proposed Solution
Augment the SFT dataset (Section 5.1) with 'State-of-Mind' tokens. Before generating a tool call action A_t, force the model to generate a hidden thought block explicitly listing: 1) Active Sandbox ID, 2) Estimated Latency, and 3) Tool Suitability Score. Fine-tune the model to predict these state variables, effectively teaching it to maintain an internal representation of the OS environment and choose tools based on system constraints (e.g., preferring scraping over Python for large text to avoid timeouts).
Why This Matters
Drastically improves robustness and success rates in complex coding environments, preventing trivial failures caused by state desynchronization.
How to Get Started
- Modify the supervised fine-tuning dataset to inject state-of-mind thought tokens prior to tool execution actions.
- Define the target state variables including sandbox ID, estimated latency, and tool suitability score.
- Fine-tune the base model to predict these internal state representations alongside standard actions.
- Benchmark tool selection accuracy and error recovery rates on tasks involving complex environment constraints.
Code linked to this paper on Hugging Face: github.com/MiroMindAI/MiroThinker
Suggested by AI. Adapt it to your setup.
Has This Been Done?
State-Aware Runtime for Long-Horizon LLM Agents touches upon runtime state awareness conceptually, but none of the listed papers explore fine-tuning a model to explicitly generate state-of-mind tokens including active sandbox IDs, estimated latency, and tool suitability scores before tool execution.
- State-Aware Runtime for Long-Horizon LLM Agents: A Conceptual Framework and Research Agenda · 2026 · 1 citations
We searched OpenAlex for “Teach language agents environment awareness by supervising tool calls with hidden thought blocks containing active sandbox state variables.” and “State-Aware Sandbox Protocol Learning” and an AI compared the idea with the top 10 results. A small search can miss relevant work.
Source Paper
MiroThinker: Pushing the Performance Boundaries of Open-Source Research Agents via Model, Context, and Interactive ScalingMiroMind Team, Song Bai, Lidong Bing +51 more · 2025
MiroThinker v1.0 is an open-source research agent designed to push performance boundaries through 'interactive scaling,' where the model is trained to handle deeper and more frequent agent-environment interactions. By utilizing a 256K context window and a three-stage training pipeline involving SFT, DPO, and Reinforcement Learning (GRPO), the agent achieves state-of-the-art results on benchmarks like GAIA and BrowseComp, rivaling proprietary models like GPT-5-high.
Related Ideas
- Semantic Policy Firewall for Runtime SandboxesAgentScope 1.0: A Developer-Centric Framework for Building Agentic Applications🟡Fairly easy
- Hermetic Harness-Agent Environment Isolation Against Dependency-Mediated Answer LeakageSage S2.1 Flash Technical Report🟡Fairly easy
- Evaluating Continual Agent Adaptation on Open-World Human-in-the-Loop WorkloadsMetaClaw: Just Talk -- An Agent That Meta-Learns and Evolves in the Wild⛔Very hard
- Executable Programmatic Verifiers for Robust Micro-Skill Lifecycle ManagementTokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents🟡Fairly easy
- Off-Policy Correction for Asynchronous Agent RLGLM-5: from Vibe Coding to Agentic Engineering🟠Medium