Skip to content

chore(gateway): verify per-account hook replay isolation - #116121

Merged
vincentkoc merged 1 commit into
mainfrom
audit/hooks-account-postland-20260729
Jul 29, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
audit/hooks-account-postland-20260729

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: #116095

What Problem This Solves

Prevents the multi-account agent-hook delivery contract from losing focused replay coverage. Requests that reuse an idempotency key but target different configured accounts must remain separate dispatches.

Why This Change Was Made

Adds one Gateway regression test beside the existing session-mode replay-scope test. The test proves accountId participates in replay identity and that each scheduled job retains its selected account.

User Impact

No runtime behavior changes. This protects per-account hook delivery from future idempotency regressions.

Evidence

  • node scripts/run-vitest.mjs src/gateway/server.hooks-session-mode.test.ts (4 tests passed)
  • ./node_modules/.bin/oxfmt --check src/gateway/server.hooks-session-mode.test.ts
  • git diff --check
  • Fresh autoreview clean, confidence 0.95

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Jul 29, 2026
@vincentkoc vincentkoc self-assigned this Jul 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 29, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 29, 2026 23:16
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 7:20 PM ET / 23:20 UTC.

ClawSweeper review

What this changes

This PR adds a Gateway regression test that sends two otherwise identical agent-hook requests with different accountId values and verifies both scheduled jobs retain their respective accounts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer review. It is a narrow regression test for the multi-account hook-delivery fix merged in #116095, and the supplied diff appears to verify the intended replay-isolation invariant without changing runtime behavior.

Priority: P3
Reviewed head: d5025f2a8dc7eb53cd28a5552fca1cab7417d39f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-aligned test patch with stated targeted validation and no supported correctness or security defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes only internal regression coverage; its reported focused test run is appropriate supplemental validation rather than an external contributor real-behavior-proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes only internal regression coverage; its reported focused test run is appropriate supplemental validation rather than an external contributor real-behavior-proof gate.
Evidence reviewed 3 items Focused regression coverage: The submitted diff adds a second request with the same idempotency key but a different account ID, waits for two cron-isolated runs, and asserts each run keeps its own delivery account.
Merged behavior provenance: The related runtime fix, #116095, merged at 9e041cd and is the stated source of the multi-account hook-delivery contract this test protects.
Provided validation evidence: The PR body reports the focused Gateway test passed with four tests, plus formatting and whitespace checks; GitHub’s supplied check summary also shows the changed-path and guard checks succeeding while several broader checks remain in progress.
Findings None None.
Security None None.

How this fits together

Agent-hook HTTP requests enter the Gateway, where idempotency/replay handling decides whether to schedule a run. The resulting job carries its selected channel account into downstream channel delivery, so account identity must remain part of the dispatch boundary.

flowchart LR
  A[Webhook caller] --> B[Gateway agent hook]
  B --> C[Replay identity]
  C --> D[Scheduled agent job]
  D --> E[Selected channel account]
  E --> F[Outbound channel delivery]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; refresh the merge result and let the remaining exact-head checks finish before landing.
  • Complete next step (P2) - No repair lane is needed: this is an ordinary, narrowly scoped maintainer-review and CI-refresh decision.
Agent review details

Security

None.

PR surface

Tests +34. Total +34 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 35 1 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 35 1 +34

Review metrics

None.

Root-cause cluster

Relationship: partial_overlap
Canonical: #116095
Summary: This PR adds coverage for the same multi-account agent-hook delivery boundary fixed by the merged related PR, but contributes a distinct regression assertion rather than duplicating its runtime implementation.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the focused regression test beside the existing hook replay coverage, refresh it against current main, and merge once the exact-head checks remain green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the focused regression test beside the existing hook replay coverage, refresh it against current main, and merge once the exact-head checks remain green.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds regression coverage rather than reporting a separate current failure. Its stated focused test path directly exercises the intended replay boundary.

Is this the best way to solve the issue?

Yes. A focused test at the Gateway hook/replay boundary is the narrowest maintainable way to prevent the merged multi-account delivery behavior from regressing.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 1f56e2da21a2.

Labels

Label changes:

  • add P3: This is a small regression-coverage improvement with no runtime, configuration, or user-flow change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR changes only internal regression coverage; its reported focused test run is appropriate supplemental validation rather than an external contributor real-behavior-proof gate.

Label justifications:

  • P3: This is a small regression-coverage improvement with no runtime, configuration, or user-flow change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR changes only internal regression coverage; its reported focused test run is appropriate supplemental validation rather than an external contributor real-behavior-proof gate.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Authored the related merged multi-account hook-delivery change and this focused follow-up coverage PR. (role: merged feature author and recent gateway contributor; confidence: high; commits: ec1097149293, d5025f2a8dc7; files: src/gateway/server.hooks-session-mode.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the branch against current main and confirm the remaining exact-head checks complete successfully.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc

Copy link
Copy Markdown
Member Author

ClawSweeper rank-up move addressed: I am intentionally not rebasing this test-only PR solely because main advanced.

  • Current origin/main: 1f56e2da21a2565c039d5735d002ca5117673e0e
  • Drift since the PR base has no overlap with src/gateway/server.hooks-session-mode.test.ts or the hook replay handler.
  • Exact-head CI is green.
  • Repo-native prepare-run passed and verified the remote head tree.

Rebasing would only replace the proven SHA and rerun identical gates. Proceeding through repo-native merge verification.

@vincentkoc
vincentkoc merged commit 342826b into main Jul 29, 2026
160 of 169 checks passed
@vincentkoc
vincentkoc deleted the audit/hooks-account-postland-20260729 branch July 29, 2026 23:23
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant