OpenProgram Docs

Unified Agent method execution

Web UI POST /api/function/{name} Model tool call no REST endpoint dispatch_forced_tool_call Runtime-block wrapper Agent method wrapper runtime.exec(...)
  1. Web UIPOST /api/function/{name}, then dispatch_forced_tool_call
  2. Model tool callno REST endpoint, dispatcher tool execution
  3. Runtime-block wrapperboth land here: Agent method wrapper, runtime.exec(...)

Code: routes/chat.py post_function; turn_runtime/forced_tool.py; turn_runtime/runtime_attach.py _wrap_agentic_runtime_block.

REST endpoint

POST /api/function/{name}
{"session_id": "...", "project_id": "...", "kwargs": {"task": "..."}}

{"session_id": "...", "msg_id": "..."}
FieldRule
session_idOptional. Omitted: the server creates a session.
project_idOptional for an existing session; required when a pending Project selection must be bound before the first call. Execution uses the selected Project directory, else the configured default Project.
Flat parametersOlder callers may post function parameters at the top level. The server moves them into kwargs and ignores control keys such as session_id and project_id.

No /run API

NameState
Typed /run ...Stays plain user text; never becomes action="run"
/api/run/{name}, WebSocket action="run"Do not exist
React function calls and the retry UICall POST /api/function/{name}
Leftover wording

Some comments and type names still say /run or runtime block because a UI component name predates the endpoint. They do not define a second path. To find them:

rg "/run|api/run|action=run|action=\"run\"" openprogram apps/web
rg "runtime block|RuntimeBlock" apps/web openprogram
Last updated · 2026-11-25