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.
Observed on the internal gateway (prerelease d17afc3, but the code
involved is unchanged since v0.5.9).
A Postgres
NOTIFYmatchedpg-small-mutations(human_approver onSlack). The client stayed connected (
operation_state = sync_waiting,approval_effect = execute_upstream). The operator approved from thedashboard (
POST /api/hitl/decide). The gateway then ran thestatement upstream and the client got its result, and the action row
went
pending -> approved.The Slack message, however, was edited to:
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.Statearound line 283) maps everyHITLStateApprovedtoHITLOperationStateApprovedWaitingForRetry,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 ...):pgSummaryprefixesstrings.ToUpper(verb)to a statement thatalready starts with the verb. Pre-existing and cosmetic, but it reads
as a bug to reviewers; drop the prefix when the statement is present.