fix(gateway): emit stale exec approval followup diagnostics#98293
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 12:16 AM ET / 04:16 UTC. Summary PR surface: Source +38, Tests +125, Docs +4, Other 0. Total +167 across 14 files. Reproducibility: yes. at source level: current main drops stale direct and gateway preflight follow-ups with log/ok-only behavior, and public diagnostic subscribers filter out Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one clean canonical implementation for #98279 after maintainers choose the public diagnostic vocabulary, then close or supersede the competing candidate PRs. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main drops stale direct and gateway preflight follow-ups with log/ok-only behavior, and public diagnostic subscribers filter out Is this the best way to solve the issue? Conditionally yes: emitting a bounded event at the existing stale-drop points is the narrow maintainable shape and avoids a sidecar log. The remaining decision is the stable public event vocabulary across sibling candidates. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5a5913a98b03. Label changesLabel justifications:
Evidence reviewedPR surface: Source +38, Tests +125, Docs +4, Other 0. Total +167 across 14 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Addressed the stability bundle finding in |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Real behavior proof update for the stale exec approval followup diagnostic. Crabbox run:
Scenario run inside the disposable Crabbox container:
Redacted proof output: {
"delivered": false,
"event": {
"type": "exec.approval.followup_suppressed",
"approvalId": "req-crabbox-pr98293-rebound",
"reason": "session_rebound",
"phase": "direct_delivery"
},
"bundlePath": "$OPENCLAW_STATE_DIR/logs/stability/openclaw-stability-2026-07-01T00-04-11-696Z-3947-pr98293.stale_exec_approval_followup_proof.json"
}CLI stability readback: {
"cliPathRedacted": "$OPENCLAW_STATE_DIR/logs/stability/openclaw-stability-2026-07-01T00-04-11-696Z-3947-pr98293.stale_exec_approval_followup_proof.json",
"cliEvent": {
"type": "exec.approval.followup_suppressed",
"approvalId": "req-crabbox-pr98293-rebound",
"reason": "session_rebound",
"phase": "direct_delivery"
},
"summary": {
"exec.approval.followup_suppressed": 1
}
}Hosted Crabbox providers were attempted first but blocked by local auth/tooling prerequisites:
@clawsweeper re-review |
|
@clawsweeper re-review Proof is now in the PR body under |
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
/allow-dependencies-change false-positive ancestry after maintainer prepare: the prepared tree has no dependency-file delta versus current main, and the repo-native merge wrapper will verify the prepared tree and mainline base before squash. |
|
Land-ready maintainer proof for
The contributor also supplied real production-path Crabbox proof ( |
0e4f16a to
937e08c
Compare
|
Final-head addendum: the ancestry-only sync produced |
|
Merged via squash.
|
Related: #98279
Alternative to #98292 with the gateway preflight suppression point and public/stability diagnostics covered.
What Problem This Solves
Fixes an issue where operators could not consume a machine-readable signal when OpenClaw intentionally suppressed a stale exec approval follow-up after the target session was rebound by
/newor/reset.Why This Change Was Made
This adds a structured
exec.approval.followup_suppresseddiagnostic event at the existing stale-follow-up drop points without changing delivery behavior. The event includes the approval id, a stablesession_reboundreason, and the suppression phase while avoiding raw session keys, route ids, command text, or other high-cardinality routing details.Follow-up repairs also register the new event with the diagnostics OTEL exhaustive switch as an intentional no-op, update the plugin SDK surface budgets for the newly public diagnostic event type, and preserve
approvalIdwhen reading persisted stability bundles.User Impact
Operator status and inbox tooling can now distinguish an intentional stale approval follow-up suppression from missing channel delivery or a stuck approval path. Existing Slack/direct/gateway suppression behavior remains unchanged; this is additive observability only.
AI-assisted with Codex.
Evidence
git diff --checknode scripts/plugin-sdk-surface-report.mjs --checknode scripts/run-vitest.mjs test/scripts/plugin-sdk-surface-report.test.ts-> 1 file, 8 tests passed.node scripts/run-vitest.mjs src/logging/diagnostic-stability-bundle.test.ts-> 1 file, 10 tests passed.node scripts/run-vitest.mjs src/agents/bash-tools.exec-approval-followup.test.ts src/gateway/server-methods/agent.test.ts src/infra/diagnostic-events.test.ts src/logging/diagnostic-stability.test.ts src/logging/diagnostic-stability-bundle.test.ts test/scripts/plugin-sdk-surface-report.test.ts-> 5 Vitest shards passed: tooling 8 tests, gateway 344 tests, infra 30 tests, logging 22 tests, agents 27 tests.3be1325fpassed the prior failing checks:check-lint,check-additional-extension-bundled, andchecks-node-compact-small-whole-2.Coverage added:
exec.approval.followup_suppressed.Local proof notes:
node scripts/run-bundled-extension-oxlint.mjscould not be completed in this checkout becausenode_modules/.bin/tsgoandnode_modules/.bin/oxlintwere unavailable afterpnpm install --frozen-lockfiletimed out on registry downloads for native/package tarballs.OPENCLAW_STATE_DIR=$(mktemp -d /tmp/openclaw-pr98293-state.XXXXXX) node openclaw.mjs gateway stability --bundle latest --jsonwas attempted as an isolated persisted-bundle CLI proof, but this source checkout has nodist/entry.(m)jsbuild output. The command failed withopenclaw: missing dist/entry.(m)js (build output).Real behavior proof
Crabbox proof added 2026-07-01 UTC.
local-container, leasecbx_14a7f978e2bd, sluggolden-crab, targetubuntu_26.04.db2a5de505; command exit0.agent:main:mainas rebound fromsession-originaltosession-after-reset, called the productionsendExecApprovalFollowupdirect stale guard, wrote a stability bundle, then read it throughcorepack pnpm openclaw gateway stability --bundle latest --json --type exec.approval.followup_suppressed.exec.approval.followup_suppressedwithapprovalId: req-crabbox-pr98293-rebound,reason: session_rebound,phase: direct_delivery, and summary{ "exec.approval.followup_suppressed": 1 }.Hosted Crabbox provider attempts were blocked by local auth/tool prerequisites: Azure missing subscription/CLI login, Blacksmith CLI auth timed out, AWS requires Crabbox broker login, and GCP auth returned
invalid_grant.