Skip to content

fix: restore native webhook jobs, recovery and report context - #3

Open
JeffPengCoder wants to merge 2 commits into
feat/background-alert-investigationfrom
fix/native-webhook-service-context
Open

JeffPengCoder wants to merge 2 commits into
feat/background-alert-investigationfrom
fix/native-webhook-service-context

Conversation

@JeffPengCoder

@JeffPengCoder JeffPengCoder commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Native Webhook intake could acknowledge an alert and then fail to start its Agent with missing scope: operator.write, because subagent dispatch inherited the HTTP caller’s request scopes. Webhook-only recovery also left the imported UI alert active. After report delivery, a normal human follow-up could read an older report because its Agent hook registry did not own the started Gateway service.

Queued jobs now run in an async context owned by the native service lifecycle. Confirmed Webhook recovery reconciles the UI import without polling Alertmanager and protects a newer active occurrence with the same fingerprint. The recipient prompt hook reads the complete, hash-checked report and session binding from durable state, independently of a service closure. Context witnesses also cover channel turns without a native run ID; generated witness IDs remain separate from a null native run ID.

This is a stacked fix for upstream #89, which is not merged. Its base is the corresponding feature branch in this AFOA fork, so the diff contains only these fixes, their regression coverage, the operating guide and required generated documentation. The fix is channel independent.

Validation:

  • Regression tests reproduce the pre-fix HTTP-scope dispatch, Webhook-only UI recovery and agent-only-registry context failures. Focused native-plugin tests: 19 passed, 0 failed.
  • Full repository CI command: 247 tests, 245 passed, 2 conditional skips, 0 failures. Helm lint, generated-documentation freshness, strict Sphinx and diff checks passed.
  • Real Alertmanager firing/resolved Webhooks on Spark reproduced the failures. A fresh post-fix GPU-cache replay ran one autonomous native investigation, 11 tool results (1 error), and 3 confirmed native Feishu DM messages. The source last-poll marker stayed unchanged; recovery cleared its imported UI alert automatically. No operator investigated, called Research, edited model facts or published the report on the Agent’s behalf. This run did not select Research.
  • The recipient received the report. Before the context fix, an exact-ID question returned an old Run ID. After deploying 85503b2, a real ordinary DM question that did not contain the answer returned the correct new Run ID and alert name. Three actual follow-ups produced full-report context witnesses with serviceStartedInThisRegistration=false, matching the reproduced cause. Historical ordinal report lookup was not independently accepted.
  • Deployment preserved every incident/context row, the last-poll marker and shared model process. Both experiments cleaned their six exact-UID test resources and preserved all existing rules and real eight-GPU ECC/remap counters. The original failed incident and full error records remain intact.

Commits: bb407008965896480fd2e412e01577a7a0fb009c and 85503b27164df30ba5d1969d884ff1ef83898926.

Scope remains the optional native alert plugin. No channel-specific implementation, authentication-scope grants, global configuration changes, default enablement or repository tooling changes. The live experiment used labeled simulated telemetry and View mode; it does not validate physical GPU damage or automatic production repair.

@JeffPengCoder JeffPengCoder changed the title fix: run native webhook investigations in service-owned context fix: restore native webhook jobs, recovery and report context Nov 3, 2026

This branch has not been deployed

No deployments
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.

1 participant