ContextFlow: Hierarchical Task-State Alignment for Long-Horizon Embodied Agents

Shuhan Guo, Kun Zhang, Haifei Liu, Xingyu Gao, Yongqi Zhang, Yaqing Wang, Quanming YaoarXiv 2026 · arXiv

TL;DR

As embodied AI agents tackle longer, more complex tasks, the primary bottleneck shifts from executing basic skills to keeping the high-level planner and low-level executors synchronized. This paper introduces ContextFlow, an inspectable alignment layer that uses explicit "stage contracts" and targeted, scoped updates to prevent common coordination failures without resorting to expensive, full-system replanning.

What Problem Does This Paper Address?

Modern embodied agents (like household robots) are increasingly adept at delegating subtasks—such as "navigate to the kitchen" or "find a mug"—to specialized sub-agents called executors. However, as these executors grow more capable, a critical systemic issue emerges: task-state misalignment.

This happens when the high-level planner, the robot's memory, the live sensory data, and the active executor fall out of sync. For instance, a robot might get stuck in a broad "search room" phase even though its camera clearly sees the target object right in front of it (a failure called stage lock). Conversely, it might prematurely jump to the next phase before verifying the current one is actually done (unsupported handoff).

Figure 1: Task-state misalignment in embodied agents. (a) A typical embodied-agent workflow maintains task progress through planning, perception, memory, expert execution, and monitor- guided updates. (b) A mismatch state arises when live evidence and memory support approaching the sink, while the planner and executor remain in a broad search stage. This illustrates stage lock and executor-context mismatch caused by inconsistent task-state interpretation.

Traditional architectures typically handle these discrepancies by wiping the slate clean and replanning from scratch, which is highly inefficient and discards successfully completed progress.

Methods

ContextFlow introduces an intermediate, contract-based alignment layer that sits squarely between high-level planning and grounded execution.

Figure 2: Overview of CONTEXTFLOW as an inspectable alignment layer between high-level plan- ning and grounded expert execution. Stage contracts expose planner commitments; memory records short-term subtask context and task-level history; expert executors perform local closed-loop exe- cution; the asynchronous monitor converts observations and executor status into evidence packets; and the planner applies scoped updates. The visible alignment board summarizes the active stage, expected evidence, live evidence, memory context, alignment decision, and plan diff.

The framework relies on three core pillars:

  1. Stage Contracts: Lightweight commitments that explicitly define what a specific stage aims to achieve, what evidence is required to transition out of it, and which executor type is qualified to handle it.
  2. Asynchronous Monitor & Evidence Packets: A continuous monitoring system that translates heterogeneous runtime signals (observations, executor status, memory records) into structured "evidence packets."
  3. Scoped Updates: Instead of a binary success/fail trigger that forces total replanning, ContextFlow interprets the evidence packet against the active contract to choose one of five precise, localized actions:
  4. Continue: Keep going because evidence is still insufficient.
  5. Refine: Sharpen the evidence requirements if the contract is too vague.
  6. Transfer: Keep the semantic goal but switch to a better-suited executor.
  7. Promote: Advance the task frontier because downstream evidence is already met.
  8. Repair: Fix only the broken "suffix" of a plan while preserving the successfully validated "prefix" steps.

Datasets

The authors evaluated ContextFlow on R2R-CE (Room-to-Room in Continuous Environments), a standard benchmark for continuous vision-language navigation. To rigorously test their framework, they evaluated it under two distinct conditions:

  • Native Condition: Evaluated using the original, long-horizon route instructions.
  • Mechanism-Sensitive Stress Condition: A newly constructed diagnostic split where instructions were rewritten to explicitly expose task-state transitions. This split specifically stress-tested the system against four key failure modes: unsupported handoff, stage lock, executor-context mismatch, and over-scoped repair.

Key Insights and Ideas

  • Local competence does not equal global progress: A specialist executor might be perfectly functional locally (e.g., continuing to explore a room) while completely failing the global task context (e.g., ignoring that the target object was already found).
  • Surgical fixes over total resets: When a robot hits a snag, it shouldn't forget everything it did right. By isolating the failure to an unsupported suffix of the plan, ContextFlow preserves validated progress.
  • Inspectability is crucial for debugging: By introducing a "Visible Alignment Board," the framework makes the internal reasoning of the robot transparent, showing exactly why a specific update (like an executor transfer or stage promotion) was chosen.
Figure 3: Observable task-state failure cases used to construct the diagnostic split. Each panel pairs a native trajectory pattern with the corresponding CONTEXTFLOW update: (A) block unsupported handoff by continuing or refining evidence, (B) promote a stale frontier when downstream evidence is visible, (C) transfer the still-valid stage to a better expert and repair the suffix, and (D) repair only the contradicted suffix while preserving validated prefix context. The bottom row summarizes the case-to-update mapping and an asynchronous executor-context conflict.

Key Results

  • Native R2R-CE Benchmark: ContextFlow achieved a 40.00% Success Rate (SR), vastly outperforming baselines like BUMBLE (16.67% SR) and MoMa-LLM (3.33% SR).
  • Improved Endpoint Control: It dramatically reduced early stopping (dropping to 30.00% compared to BUMBLE's 53.33% and MoMa-LLM's 83.33%), proving that the robot is much better at verifying it actually reached the goal before halting.
  • Stress Benchmark: ContextFlow maintained its 40.00% SR, whereas BUMBLE plummeted to 6.67% and MoMa-LLM stayed at 3.33%. Notably, in handoff-sensitive scenarios, ContextFlow achieved a 62.50% within-type SR, demonstrating the power of contract-based verification.

Limitations and Future Work

  • Dependency on Underlying Perception: ContextFlow is an alignment layer, meaning it is still fundamentally bottlenecked by the quality of the underlying perception and executor modules. Noisy sensors or incorrect executor feedback can still result in misleading evidence packets.
  • Coarse Abstractions: The current stage-contract abstraction is lightweight and might be too coarse for tasks requiring highly precise geometric, safety, or symbolic constraints.
  • Evaluation Scope: The evaluation was heavily focused on navigation and route-following. The authors note that validating this approach across broader task families, such as complex mobile manipulation, remains important future work.

Summary updated

Abstract

Long-horizon embodied agents increasingly delegate navigation, search, approach, and manipulation to specialist executors. As these executors become stronger, the main bottleneck shifts from local skill execution to maintaining a coherent task frontier across planning, monitoring, memory, and execution. We study task-state misalignment, a task-level consistency failure in which the planner's active stage, runtime evidence, remembered context, and delegated executor no longer justify the same next-step decision. This failure can lead to unsupported handoffs, stage lock, executor-context mismatch, and unnecessary replanning. We propose ContextFlow, an inspectable alignment framework that represents stages as explicit contracts, converts runtime observations into evidence packets, and applies scoped updates including continue, refine, transfer, promote, and repair. ContextFlow keeps specialist executors responsible for local closed-loop control while making task-frontier alignment explicit and auditable. Experiments and demonstration traces on long-horizon embodied tasks illustrate how evidence-grounded scoped updates diagnose and mitigate recurring task-state failures.
BibTeX
@misc{guo2026contextflow,
  author = {Shuhan Guo and Kun Zhang and Haifei Liu and Xingyu Gao and Yongqi Zhang and Yaqing Wang and Quanming Yao},
  title = {{ContextFlow: Hierarchical Task-State Alignment for Long-Horizon Embodied Agents}},
  year = {2026},
  eprint = {2605.19314},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.19314},
}
Figure