agent-ops-patterns / gallery / OpenHands map / how it decides
How OpenHands decides
This card covers the OpenHands agent SDK, the library that the OpenHands command-line tool and OpenHands Cloud are built on, and not the OpenHands app or its screens. On its default settings the SDK never stops to ask for your approval, even after an app gives the agent tools to run commands and edit files. An app built on it can turn approvals on, but deciding when the work is done and what to remember stays with plain code and AI models.
What it does without asking you
-
Does it ask you before it runs a command or edits a file?
Decided by plain code Only if the app turns on an approval policy; the default policy never asks.
agent.py:1164-1169· decision D16 in the full map -
If you send a new message instead of answering, does that count as a yes?
Decided by plain code It can: when the conversation runs again, it attempts the waiting actions before it looks at your new message, without asking again.
agent.py:713-722· decision D18 in the full map -
When a helper agent it starts pauses for approval, and the app gave it no approval check of its own, who answers?
Decided by nobody Nobody: the helper is run again and attempts its waiting actions without asking anyone.
manager.py:468-471· decision D41 in the full map
How it decides it is done
-
How does it decide it has finished?
Decided by plain code A reply with visible text and no request to use a tool marks the run finished.
response_dispatch.py:270· decision G1 in the full map -
When you use its goal feature, who decides the goal is met?
Decided by an AI model A judge model reads the conversation and gives the verdict.
judge.py:59-79· decision G13 in the full map
Limits and memory
-
How long can it keep going before it is stopped?
Decided by plain code Each run is capped at 500 steps unless the app changes the cap.
local_conversation.py:2024-2046· decision F1 in the full map -
Is there a spending limit?
Decided by plain code Only if the app sets one; it is off by default.
local_conversation.py:726-727· decision F2 in the full map -
When the history gets too long, who decides what to remember?
Decided by an AI model A summarizing model writes a summary of the part being dropped from view; nothing checks whether the summary is accurate or complete, and if the model returns no text the part is dropped with no summary.
llm_summarizing_condenser.py:264-276· decision F9 in the full map -
What does it save for next time, and does anything check it?
Decided by an AI model The model writes its own memory notes; in its two-part memory mode (one part for the project, one for you) its instructions say not to save secrets, and the code that loads the notes back does not scan them for secrets.
static.py:149· decision I2 in the full map
Three problems in the code
-
1. A new message can count as approval
When the approval policy calls for it, the agent pauses before an action until the app approves or rejects it. If you send a new message instead, and the app then runs the conversation again without rejecting, the waiting action is attempted as if you had approved it. A message saying "wait, not that" does not by itself cancel the action.
Reported; a fix is proposed, not merged (#5092), checked 2026-11-15.
Where:
local_conversation.py:1981-1988,agent.py:713-722. How we checked: the code was re-read at the source version named above; the sentences were checked by an independent AI reviewer from another company (OpenAI Codex, read-only) in four rounds on 2026-10-18. -
2. The goal judge can read "false" as done
With the goal feature, a judge model is asked for a short structured reply that includes a "complete" field. The code turns that field into yes or no with a Python conversion (bool) that counts any non-empty text as yes, including the word "false". So if the judge writes "false" as text in that field, the goal is marked complete.
Reported; a fix is proposed, not merged (#5492), checked 2026-11-15.
Where:
judge.py:128. How we checked: the code was re-read at the source version named above; the sentences were checked by an independent AI reviewer from another company (OpenAI Codex, read-only) in four rounds on 2026-10-18. -
3. A secret inside a tool request is recorded unmasked
You can register secrets, such as service access keys, so they are masked in text replies that contain no request to use a tool. When the model puts a registered secret into a request to use a tool, such as a shell command, the details of that request are written to the conversation record without masking, and when the model gives no summary of the request, the automatic summary repeats them. Anyone who can read that record can read the key.
Reported; no linked fix found (#5525), checked 2026-11-15.
Where:
agent.py:1374-1379,agent.py:1243-1245. How we checked: the code was re-read at the source version named above; the sentences were checked by an independent AI reviewer from another company (OpenAI Codex, read-only) in four rounds on 2026-10-18.