Skip to content

fix(ui): surface approved-action execution report for all outcomes #346

@w7-mgfcode

Description

@w7-mgfcode

Problem

On the Chat page, after clicking Approve (or Reject) on a HITL action card, the handlers (frontend/src/pages/chat.tsx) await POST /agents/sessions/{id}/approve but discard the ApprovalResponse and only clear the card. The operator sees nothing — no confirmation on success, and crucially no error when the approved action's execution fails (e.g. create_alias → "Run not found", which the backend returns as status="rejected" + result.error).

Fix

Capture the ApprovalResponse and append a one-line report to the transcript for every outcome:

  • executed → success
  • approved but rejected with result.error → execution failed (show the cause)
  • rejected (operator declined) → no action taken
  • expired → approval window lapsed

A pure formatApprovalReport(actionLabel, res) helper (frontend/src/lib/approval-report.ts) is unit-tested across all outcomes.

Acceptance

  • Clicking Approve/Reject always surfaces a visible result in chat.
  • A failed execution shows the RFC-7807-derived error cause, not silence.

Found while dogfooding the Ollama HITL flow alongside #344.

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