questionPending
@forge/monorepo / backend/src / questionPending
Function: questionPending()
questionPending(
question):AgentPlatformError
Defined in: backend/src/hitl/service.ts:380
The signal a tool raises to park its run on a question — #163.
A tool cannot pause a run by itself, and it must not block waiting for a person: a delegate that awaited a human reply would hold a worker slot for as long as someone takes to read, which is the entire thing the durable runtime exists to avoid. So the tool stores the question, throws this, and returns control.
The engine recognises the question_pending code, tells the model the run is parked, and emits
question.requested — the event the worker turns into waiting-for-question. Exactly the path an approval
takes, which is the point: the two halves of "ask a human something" should not work differently.
Thrown rather than returned because it has to survive the tool registry, which flattens a delegate's throw
into a ToolResult error. A distinguishing code is what makes that flattening lossless.