Repository navigation
feat(automations): refresh incoming webhooks for current runtime - #31121
oliver-mee wants to merge 12 commits into
Conversation
Preserve webhook receiver lifecycle and admission behavior while retaining upstream host-routing and layout-owner updates.
Preserve upstream legacy run-target capture before webhook dispatch and extract the validation path within the module budget.
|
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 7
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a0921ee5-8858-43f1-8341-e9d5bd38476d
📒 Files selected for processing: 70
src/main/automations/automation-run-precheck.tssrc/main/automations/automation-run-writer.test.tssrc/main/automations/automation-run-writer.tssrc/main/automations/headless-automation-agent-launch.tssrc/main/automations/headless-workspace-create.tssrc/main/automations/runtime-automation-service-retention.test.tssrc/main/automations/runtime-automation-service.tssrc/main/automations/service-webhook-legacy-target.test.tssrc/main/automations/service.test.tssrc/main/automations/service.tssrc/main/automations/webhook-run-target.tssrc/main/ipc/automations.tssrc/main/orcad/orcad-automations.test.tssrc/main/orcad/orcad-automations.tssrc/main/persistence/applying-settings/settings-update.tssrc/main/persistence/applying-settings/source-control-settings.tssrc/main/persistence/loading-store/automation-persistence.tssrc/main/persistence/loading-store/normalize-loaded-global-settings.tssrc/main/persistence/migrating-orcad-catalog/orcad-source-automation-state.tssrc/main/persistence/migrating-orcad-catalog/orcad-webhook-migration.test.tssrc/main/persistence/scheduling-automations/automation-definition-operations.tssrc/main/persistence/scheduling-automations/automation-run-operations.tssrc/main/persistence/webhook-persistence.test.tssrc/main/runtime/runtime-automation-controller.tssrc/main/runtime/runtime-automation-update-value.tssrc/main/ssh/orcad-migration-catalog-client-extra-agent-args.test.tssrc/main/ssh/orcad-migration-catalog-client.tssrc/main/webhooks/automation-webhook-lifecycle.test.tssrc/main/webhooks/automation-webhook-lifecycle.tssrc/main/webhooks/webhook-rate-limiter.test.tssrc/main/webhooks/webhook-rate-limiter.tssrc/main/webhooks/webhook-secret.test.tssrc/main/webhooks/webhook-secret.tssrc/main/webhooks/webhook-server.test.tssrc/main/webhooks/webhook-server.tssrc/preload/api/automation-api.tssrc/preload/api/automations-bridge.tssrc/renderer/src/components/automations/AutomationEditorDialog.tsxsrc/renderer/src/components/automations/AutomationEditorSettingsSidebar.tsxsrc/renderer/src/components/automations/AutomationWebhookEditor.tsxsrc/renderer/src/components/automations/AutomationWebhookSection.tsxsrc/renderer/src/components/automations/AutomationsPageSurface.tsxsrc/renderer/src/components/automations/automation-capability-probe.tssrc/renderer/src/components/automations/automation-edit-draft.tssrc/renderer/src/components/automations/automation-host-client.tssrc/renderer/src/components/automations/automation-orca-save.tssrc/renderer/src/components/automations/automation-scoped-list-client.tssrc/renderer/src/components/automations/use-automation-editor-actions.tssrc/renderer/src/components/automations/use-automations-page-local-state.tssrc/renderer/src/components/settings/AdvancedPane.tsxsrc/renderer/src/components/settings/WebhookServerSetting.tsxsrc/renderer/src/hooks/automation-dispatch-handler.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/automation-run-status.tssrc/shared/automation-runtime-capabilities.tssrc/shared/automation-webhook.test.tssrc/shared/automation-webhook.tssrc/shared/automations-types.tssrc/shared/default-global-settings.tssrc/shared/global-settings-base.tssrc/shared/orcad-migration/orcad-migration-dormant-automation-validation.tssrc/shared/rpc-contract/automation-params.tssrc/shared/webhook-server-settings.test.tssrc/shared/webhook-server-settings.tstests/e2e/webhook-editor-proof.spec.tstests/e2e/webhook-receiver-lifecycle.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Keep blank verification secrets fail-closed and remove terminal control bytes from untrusted payload prompts. Prune expired rate-limit sources, commit bind fields only after editing, and preserve localisation fallback.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6c4e4449-327e-445c-867e-9003f11ae382
📒 Files selected for processing: 14
src/main/webhooks/webhook-config-security.test.tssrc/main/webhooks/webhook-rate-limiter.test.tssrc/main/webhooks/webhook-rate-limiter.tssrc/main/webhooks/webhook-server.test.tssrc/renderer/src/components/automations/AutomationWebhookSection.tsxsrc/renderer/src/components/settings/WebhookServerSetting.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/automation-webhook.test.tssrc/shared/automation-webhook.tstests/e2e/webhook-receiver-lifecycle.spec.ts
🚧 Files skipped from review as they are similar to previous changes: 3
- src/renderer/src/components/automations/AutomationWebhookSection.tsx
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/ko.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
ELI5
External systems can POST to an automation instead of waiting for its next scheduled run. If Orca cannot dispatch the work, the sender receives a refusal rather than a misleading acceptance.
What Changed
Carry Ptah-CT's incoming-webhook implementation from #5617 onto the current automation architecture. Preserve the original commit and use the current host-owned dispatch lanes, durable run writer, split persistence, preload APIs and editor surfaces.
The receiver supports per-automation authentication, bounded payloads and rate limits. Requested token/HMAC verification stays fail-closed when its secret is blank; it never silently becomes unauthenticated. Untrusted terminal control bytes are removed only from the composed prompt, with raw captured delivery retained. Expired rate-limit sources are pruned while serving. Bind/port fields commit validated drafts on blur or Enter, avoiding intermediate rebinds. Webhook copy uses the localisation layer and missing translations retain the standard English fallback. Webhook runs retain their captured payload and distinct trigger. Settings start, stop and rebind the receiver with the scheduler's lifetime. Old hosts refuse webhook configuration before mutation.
Dispatch results now reach the HTTP boundary. Unavailable, interactive-auth-required and failed dispatch return 503; legitimate admitted or completed runs return 202. Separate deliveries received in the same millisecond retain separate run identities.
Why
The existing implementation no longer applies cleanly to main. Porting it through the current owners avoids restoring the former renderer-only dispatcher or synchronous persistence path. Returning 202 for refused work leaves external senders unaware that nothing was launched.
Linked Issue
Partial implementation of #12400. This continues #5617 by Ptah-CT, whose implementation commit remains in the ancestry. HTTPS enforcement and delivery-idempotency keys requested by #12400 remain outstanding; complete issue closure is not claimed.
Visual Proof
Screenshots from the hidden Electron app are published on a separate evidence branch, outside the implementation diff. Settings display the actual listening address. The editor shows the unsaved-URL explanation, disables URL copying until saved, and exposes HMAC verification and secret generation. All data is synthetic; no automation was saved or triggered.
Testing
October 25 refresh: merged current
mainat1d2b5361efa7851e95c4b24e5a9b298863f8fb7b, preserving the existing contribution history. Current head40c12054e1bd901ff46a0239847b83316eff4a9f: 111 focused tests across 15 files, Node and renderer native typechecks, scoped lint and localization-catalog validation pass. Kept upstream’s startup update-prompt suppression and new settings groups, and repaired test imports after upstream moved the persistence fixtures. Earlier application/Electron acceptance below belongs to its recorded earlier heads and was not repeated for this refresh. Substantive upstream CI remains a separate maintainer approval gate.Pinned main baseline:
411b5c024abef11dcc269779377bc7d3aefa897c. Submitted head:723c8040da562e4b1346604fc9a4f051c328b68f, preserving Ptah-CT's original commit ancestry.522550531d. The current head adds only a DOM assertion: after Enter commits the new port, the rendered listener status must show that exact port. The strengthened scenario passes with retries disabled on the same unchanged app build; its changed-spec lint passes.SKIP_BUILD=1. Rebuilding with the repository's documented--mode e2efixes the build mismatch; no test assertion or timeout changed. Original failures are retained.Tests use isolated application homes and profiles. Windows, installed/signed packages, provider-backed end-to-end automation execution and a full repository matrix remain unverified.
AI Disclosure
GPT-6.1 Sol ported and tested the implementation under human direction; GPT-6 completed the main refresh, E2E build correction and seven actionable review corrections. The original webhook implementation is Ptah-CT's contribution.
Review
Please review dispatch admission, receiver shutdown/rebind ordering, migration safety and old-host capability refusal. A 503 is a refusal, not evidence of queued durable delivery. Rate limits do not provide delivery idempotency.
Agent skill upstream boundary
Checklist
🤖 Generated with GPT-6.1 Sol and GPT-6
🧑💻 Ideated, directed and reviewed by a human, @oliver-mee