Skip to content

Webhook poll delivery (4/4): enable the mode and prove it end to end - #690

Open
Shearerbeard wants to merge 1 commit into
mshearer/271-poll-at-restfrom
feature/aura-next-271-poll-delivery
Open

Shearerbeard wants to merge 1 commit into
mshearer/271-poll-at-restfrom
feature/aura-next-271-poll-delivery

Conversation

@Shearerbeard

Copy link
Copy Markdown
Collaborator

Last of four. Removes the config-validation refusal so delivery = "poll" becomes usable, and adds the end-to-end rig.

What changes:

  • delivery = "poll" passes validation, and headers_from_request is accepted on poll routes now that the resolved values persist on the parked approval record. The other refusals stand: poll without [hitl.park].enabled, and a plaintext URL with an HMAC secret.
  • Two feature-gated integration tests spawn a real web server per test against a file store and an in-process mock receiver. The flow test parks a gated tool call through /v1/chat/completions with a request-scoped header while the mock holds every notify POST open past the request timeout. It proves that the notify carries that header, that polling and resolution proceed even though no notify is ever acknowledged, and that a decided status lands approver identity in the durable decision record with the run still parked. The restart test kills the server between notify and decision. With nothing running, the receiver records the decision; the server then reboots onto the same store and the first tick resolves it, with at most one duplicate notify.
  • docs/adr/2026-08-13-approver-identity-forwarding.md gains the config consequence: poll accepts request-derived headers while the two remaining refusals stay. It also records that only delivery enters the config fingerprint; the three poll tuning keys do not.

Not in this PR: re-execution after a decision. The rig proves the flow through durable resolve; the resume endpoint is separate work.

Tested with cargo test -p aura-web-server --features integration-hitl-header-forwarding --test poll_delivery_e2e_test with mock-mcp up, plus the header-forwarding suite.

The hosted configuration page for the new [hitl.route] keys follows as a separate PR in mezmo/documentation.

Stack: based on mshearer/271-poll-at-rest.

@Shearerbeard
Shearerbeard requested a review from a team as a code owner September 11, 2026 19:03
@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with one non-blocking shutdown race that can still lose final telemetry from a request accepted immediately before shutdown.

Findings

  1. P2 Poll suite is not automated

Summary

This PR enables webhook poll delivery, permits persisted request-derived headers on poll routes, adds end-to-end poll and restart coverage, and integrates that coverage into the local HITL test target.

  • Removes the validation refusal for poll delivery while retaining park-mode and transport safeguards.
  • Exercises notification, status polling, durable resolution, approver identity forwarding, and restart recovery.
  • Updates developer testing guidance and the approver-identity ADR.
  • Changes since the previous review also strengthen shutdown handling and MCP connection timeout behavior.
Diagram
sequenceDiagram
  participant Client
  participant Aura
  participant Store
  participant Receiver

  Client->>Aura: POST /v1/chat/completions
  Aura->>Store: Persist parked approval and resolved egress headers
  Aura-->>Client: Run parked
  Aura->>Receiver: POST /notify
  Note over Aura,Receiver: Notification may time out or be acknowledged
  loop Poll reconciliation
    Aura->>Receiver: "GET /status?decision_id=..."
    Receiver-->>Aura: Pending or decided
  end
  Receiver-->>Aura: Approved + approver identity header
  Aura->>Store: Persist durable decision
  opt Process restart
    Aura->>Store: Reload parked approval
    Aura->>Receiver: Poll status
    Aura->>Store: Resolve decided approval
  end
Loading

Reviews (4) · Last reviewed commit: "feat(hitl): enable poll delivery end to ..."

Comment on lines +27 to +34
//! `make test-integration-hitl-local` starts the shared `mock-mcp` fixture
//! for the sibling suite; this suite runs directly with the same feature
//! flag (equivalent wiring, needs no env beyond `OPENAI_API_KEY`):
//!
//! ```sh
//! cargo test -p aura-web-server --features integration-hitl-header-forwarding \
//! --test poll_delivery_e2e_test
//! ```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Poll suite is not automated

The new poll-delivery suite is not executed by make test-integration-hitl-local: that target selects only hitl_header_forwarding_tests, and the aggregate integration feature does not include this test's feature. As a result, routine integration runs will not catch regressions in the newly enabled poll and restart flows. This is non-blocking, but the suite should be added to the established integration command.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread crates/aura-web-server/tests/poll_delivery_e2e_test.rs Outdated
@Shearerbeard
Shearerbeard force-pushed the mshearer/271-poll-at-rest branch from 4fd7f43 to 11d0f51 Compare September 11, 2026 23:43
@Shearerbeard
Shearerbeard force-pushed the feature/aura-next-271-poll-delivery branch from f965a05 to 18ab1ba Compare September 11, 2026 23:43
@Shearerbeard
Shearerbeard force-pushed the mshearer/271-poll-at-rest branch from 11d0f51 to c91f447 Compare September 17, 2026 12:16
@Shearerbeard
Shearerbeard force-pushed the feature/aura-next-271-poll-delivery branch from 18ab1ba to 5fbd5d1 Compare September 17, 2026 12:16
Drop the load-time refusal: a webhook route configured for poll
delivery now runs - the gate parks the call, the reconciler
notifies the receiver and polls its status, and a decided row
resolves durable through the ingress path. No re-execution here:
the flow ends at durable resolve; the resume endpoint is separate
work.

The e2e rig proves the flow against an in-process mock receiver
over the real chat endpoint, including a restart between the park
and the decision landing, and runs from make
test-integration-hitl-local alongside the header-forwarding suite.

Ref: #271
@Shearerbeard
Shearerbeard force-pushed the mshearer/271-poll-at-rest branch from c91f447 to c1a97c2 Compare September 17, 2026 20:33
@Shearerbeard
Shearerbeard force-pushed the feature/aura-next-271-poll-delivery branch from 5fbd5d1 to b155f00 Compare September 17, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants