close_surface
Close a surface, agent, or workspace while protecting live agents. Use force to override, and get separate status for agent stop and surface close.
Instructions
Close one surface, managed agent, or workspace with live-agent guards. scope="agent" stops the agent AND closes its pane, and reports the two halves separately (agent_stopped, surface_closed) so a pane that survives is never reported as closed. The pane close obeys the same live-agent guard as scope="surface": without force:true a still-live agent keeps its pane, and the receipt says so.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Close even when the backing agent is still live (not done/error). This never bypasses stable surface identity checks. Without force, a live agent's surface is protected and the response returns the current pane contents instead of closing. | |
| scope | No | surface | |
| surface | No | Target surface ref | |
| agent_id | No | Managed agent ID | |
| workspace | No | Target workspace ref |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| pane | No | ||
| force | No | ||
| scope | No | ||
| state | No | ||
| agents | No | ||
| refused | No | ||
| removed | No | ||
| surface | No | ||
| agent_id | No | ||
| surfaces | No | ||
| workspace | No | ||
| live_agents | No | ||
| retry_count | Yes | ||
| collapse_pane | No | ||
| caller_workspace | No |