Glean

The harness as the context manager

Apr 28, 2026
The harness as the context manager
SummaryAI, from the source post

This post details four key changes in Glean's agent harness design to improve long-running agent performance and context management: 1. Programmatic Tool Calling (PTC) in sandboxes moves workflow logic into sandboxed code, keeping intermediate state in variables and files, enabling batching, parallelization, and more robust error recovery. 2. Sub-agents decompose agent loops into isolated execution contexts, each with its own context window, allowing for parallel analysis of large collections of items. 3. Compaction strategies preserve load-bearing conversation state while moving raw intermediate outputs to file systems, addressing context window limits over time. 4. Search-first discovery of skills decouples tool and skill discovery from schema hydration, fetching full definitions only at execution time by indexing skills and ranking them using enterprise graph signals. These changes collectively enhance context management, scalability, reliability, and efficiency for agents performing complex, multi-step tasks.

More from the Agent Orchestration Platform trail