Skip to content

Dashboard-approved sync HITL request is rendered in Slack as "waiting for matching client retry" #843

Description

@piscisaureus

Observed on the internal gateway (prerelease d17afc3, but the code
involved is unchanged since v0.5.9).

A Postgres NOTIFY matched pg-small-mutations (human_approver on
Slack). The client stayed connected (operation_state = sync_waiting,
approval_effect = execute_upstream). The operator approved from the
dashboard (POST /api/hitl/decide). The gateway then ran the
statement upstream and the client got its result, and the action row
went pending -> approved.

The Slack message, however, was edited to:

Approved.
Waiting for the client to retry the original request.
Upstream has not been called yet.
:white_check_mark: Approved — waiting for matching client retry

with the header switched from the endpoint name to the upstream host
and the *Query* label replaced by *Path*. Upstream was called;
nothing is waiting for a retry.

Cause: updateRecordedMessageRefs (cmd/clawpatrol/hitl_async_runtime.go,
the switch result.State around line 283) maps every
HITLStateApproved to HITLOperationStateApprovedWaitingForRetry,
which is the async retry-grant wording. It should distinguish the
sync path (approval effect execute_upstream): render "approved by
" and, once the upstream call completes, the succeeded/failed
outcome, the way the Slack-button path does (:white_check_mark: approved by @user).

Same message also shows the verb twice (NOTIFY NOTIFY ...):
pgSummary prefixes strings.ToUpper(verb) to a statement that
already starts with the verb. Pre-existing and cosmetic, but it reads
as a bug to reviewers; drop the prefix when the statement is present.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions