Closed-Loop Robot Agent Harness #3486
easydunker
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add an opt-in agent harness that closes the loop between model decisions and observed robot outcomes while preserving dimOS's existing
@skilland MCP tool model.The proposed harness changes would be:
The goal is to make robot interactions observable and outcome-aware without replacing standard agent tools with a new action protocol.
Motivation
The current
McpClientis a conventional LangGraph tool-using agent. It discovers@skillmethods as MCP tools, keeps conversation history in process memory, and lets the model decide when to call observation tools.This works well for general tool use, but physical execution has additional semantics. For example,
navigate_with_textcan callset_goal()and immediately return that navigation has started. The return confirms command acceptance, not that the robot reached its destination. Later controller feedback is not durably tied to the model tool call that started the motion.The current runtime therefore cannot reliably reconstruct:
Goals
@skill, MCP, RPC, module, blueprint, and typed-stream behavior.Non-goals
Emergency stop and low-level safety paths must remain independent of the model, journal, and harness.
Proposed design
Standard tool recording
Every call passing through the harness is recorded, including observation, query, speech, computation, and physical tools. A call remains a standard tool call and receives exactly one standard result.
The durable record should include:
Recording occurs at the dispatch boundary. Calls made directly by another MCP client are outside this guarantee unless that path is routed through the same recorder.
Harness-managed world snapshots
The harness captures a snapshot:
A navigation-oriented snapshot initially contains:
Snapshot fields may be missing or stale, and that state must remain explicit. Large camera, point-cloud, and map values are stored as artifact references rather than inline data.
The model receives a size-bounded projection, not raw high-rate streams. It may still call tools such as
observe()when it needs a current image, more detail, or a different viewpoint.Pre-dispatch world validation
Each model turn is bound to the ID of the snapshot used to build its context. Before dispatching a managed physical action, the harness captures a second, fresh snapshot and compares the action-relevant state with the decision snapshot.
This is not a byte-for-byte comparison of the whole world. Each managed action declares the fields and tolerances that must still hold, for example:
If the declared preconditions still hold, the harness records the successful check and dispatches the unchanged standard tool call. If they do not, the harness does not invoke the physical skill. It records the failed check, returns one standard tool result such as
precondition_changed, and begins a new model turn using the fresh snapshot.A failed precondition check does not create a robot action because physical execution never began.
The validator only determines whether declared assumptions remain valid. Route feasibility, collision checking, and low-level safety remain responsibilities of their existing planners and controllers.
Managed robot actions
dimOS already supports
instantandbackgroundskill lifecycles and capability declarations through@skill. This proposal should extend those concepts rather than introduce a parallel lifecycle.For a bounded background action, optional metadata needs to identify:
This metadata must not change the tool's MCP name, description, argument schema, or normal calling convention. Skills without it remain ordinary tools.
The harness tracks physical execution through:
REQUESTED: dispatch began and the tool call was recorded.ACCEPTED: the controller accepted the command.RUNNING: correlated feedback reports ongoing execution.VERIFYING: terminal feedback caused a fresh snapshot capture.SUCCEEDED: feedback and observed state establish the requested outcome.FAILED: execution failed or verification disproved success.UNKNOWN: execution timed out or the evidence is inconclusive.The immediate standard tool result reports what the synchronous invocation established: rejection, acceptance, or true synchronous completion. If it reports acceptance, the later physical outcome is a correlated runtime event supplied to the next model turn, not a second result for the same tool call.
Closed-loop flow
For a bounded action such as navigation:
Ordinary tools continue through the normal model/tool loop. The initial harness accepts at most one new managed physical action in a decision step. Continuous behaviors need different decision-boundary semantics and are deferred until the bounded-action design is validated.
Durable event model
The mission journal stores ordered, versioned events such as:
MODEL_TURN_STARTED;WORLD_SNAPSHOT_CAPTURED;MODEL_RESPONSE_RECORDED;TOOL_CALL_RECORDED;ACTION_PRECONDITION_CHECKED;TOOL_RESULT_RECORDED;ROBOT_ACTION_STARTED;ROBOT_ACTION_PROGRESS; andROBOT_ACTION_OUTCOME.Each event includes a sequence number, timestamp, mission ID, and relevant tool-call or robot-action IDs. SQLite is sufficient for the first version. The journal is for causal reconstruction and evaluation, not a new source of conversational memory.
Failure behavior
UNKNOWNafter timeout.Compatibility
Risks and open questions
UNKNOWNrather than creating false confidence.@skill, in an adapter registry, or supports both.All reactions