Skip to content

Expose confirmation decisions to custom agenttic bridge consumers #78

@lezama

Description

@lezama

Problem

openclaWP has a tool confirmation gate and the bundled chat surface knows how to poll /decisions/pending/<session_id> and render a confirmation card.

But consumers that use the same /wp-json/openclawp/v1/agenttic/<agent> bridge with their own UI have to rediscover and duplicate that contract. If they only pass messages through @automattic/agenttic-client / AgentUI, pending decisions are not surfaced by the generic bridge UI path.

Concrete downstream case: wp-carpeta mounts its own Carpeta drawer and talks to carpeta-bot through openclaWP's agenttic bridge. A destructive action flow currently has to be handled in product prompt/client code: the bot lists exact paddock IDs, asks "¿Borro estos 13 potreros?", and the client adds hidden context on the next "Sí, borrar" turn so the model does not loop.

If the agent actually calls a destructive ability, openclaWP can gate it, but the custom drawer does not get a first-class confirmation surface unless it copies the bundled ChatSurface polling/resolution logic.

Desired contract

Make pending confirmation decisions first-class for custom bridge consumers.

A useful shape could be one or more of:

  • document a small useOpenclaWPDecisions( { sessionId, restNamespace, nonce } ) hook shared by the bundled chat and custom consumers;
  • export a reusable confirmation card/component that can be embedded beside AgentUI;
  • include pending-decision metadata in the agenttic response envelope when a tool call is gated;
  • allow suggestions/actions to carry a pending decision id, so the visible label can be short while the allow/deny action stays structured;
  • document the exact lifecycle: gated tool result -> pending decision row -> UI decision -> follow-up turn with openclawp_decision_override.

Acceptance criteria

  • A custom consumer of /openclawp/v1/agenttic/<agent> can surface and resolve pending tool confirmations without copying internal implementation from blocks/chat-shared/ChatSurface.jsx.
  • The bundled chat surface continues to work using the same shared contract.
  • The consumer can keep the visible user message short (for example "Allow" / "Deny" or localized labels) while the decision id and original tool args remain structured.
  • Docs mention how async/custom channels should discover and resolve pending decisions.
  • The flow remains compatible with the existing openclawp_decision_override resume path.

Related

  • lezama/openclawp#40 shipped the confirmation gate and bundled confirmation card.
  • Automattic/agents-api#273 tracks a product-neutral pending-action confirmation contract in Agents API.

AI assistance

  • AI assistance: yes
  • Tool(s): Codex
  • Used for: analyzing a downstream wp-carpeta confirmation loop and drafting this follow-up tracker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions