Repository navigation
fix(hooks): avoid implicit hook delivery targets - #100486
vincentkoc merged 6 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 10:46 AM ET / 14:46 UTC. ClawSweeper reviewWhat this changesThis PR validates direct Merge readinessThe patch appears to correctly bind direct hook delivery before detached work is accepted, preventing the cron layer from consulting unrelated session delivery state. It deliberately changes accepted direct Priority: P1 Review scores
Verification
How this fits togetherThe Gateway accepts authenticated hook requests and schedules isolated agent work as cron jobs. Delivery intent must be decided at the HTTP boundary so the detached runner either announces to an explicit destination or produces a completion-only result without inheriting prior-session recipients. flowchart LR
A[Webhook caller] --> B[Gateway hook endpoint]
B --> C[Validate delivery coordinates]
C --> D[Prepared delivery fact]
D --> E[Detached cron job]
E --> F[Isolated agent run]
F --> G[Completion event or explicit announcement]
Decision needed
Why: This prevents session-derived recipient selection, but it also changes an existing public webhook request outcome and cannot be inferred solely from code correctness. Before merge
Agent review detailsSecurityNone. PR surfaceSource +78, Tests +335, Docs +11. Total +424 across 8 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Approve the fail-before-scheduling contract only if maintainers intend to retire accepted partial direct delivery, then rebase onto current Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the old boundary rebuilt announce delivery from independently normalized request fields, whereas this branch binds the direct request to a prepared delivery fact before CronJob scheduling. The provided focused Gateway and cron tests cover the relevant coordinate matrix, but this read-only review did not execute a current-main runtime reproduction. Is this the best way to solve the issue? Yes, conditionally: normalizing direct webhook delivery at the Gateway boundary is the narrowest owner boundary because later detached layers should not rediscover request intent. The remaining question is whether the intentional HTTP 400 migration for partial direct requests is the approved public contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 17a8961a6a36. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review Author update: preserve partial delivery intent without inheriting session recipientsExact head: Repair
TDD evidence
Verification on pushed behavior
The previously requested redacted live Gateway transcript remains outstanding; the changed direct/mapped and resolver contracts are covered deterministically above. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
775912b to
2bf23a9
Compare
f12d91c to
b2ab65e
Compare
Co-authored-by: Sascha Kuhlmann <[email protected]>
b2ab65e to
9846c01
Compare
Co-authored-by: Sascha Kuhlmann <[email protected]>
|
Maintainer decision: accept the explicit direct-hook delivery contract. Direct This is the intended compatibility boundary for this PR. |
|
Merged via squash.
|
* fix(gateway): bind hook delivery before scheduling Co-authored-by: Sascha Kuhlmann <[email protected]> * test(cli): make stderr tail fixture deterministic * test(cli): allow loaded runners to start * fix(gateway): narrow hook delivery binding Co-authored-by: Sascha Kuhlmann <[email protected]> * fix(gateway): keep hook delivery normalization internal * style(gateway): format hook delivery helper --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes an issue where direct
/hooks/agentcallers could submit an incomplete delivery target and have the detached run consult unrelated session delivery state or fail only after the request was accepted.Why This Change Was Made
Direct hook delivery is now normalized before scheduling:
channeland notoschedules completion-only work;toreturns HTTP 400;deliver: falseschedules completion-only work and clears supplied destination data;channelplus non-emptytobecomes the explicit announce target.The prepared delivery fact is carried into the isolated
CronJob; later runtime layers do not rediscover webhook intent. Existing mapped-hook configuration keeps its shippedchannel: "last"and partial-target behavior, so this PR does not introduce a mapping migration.The maintainer rewrite also removes two unrelated CLI-test commits from the PR diff and preserves @coolmanns as co-author.
User Impact
Direct webhook callers get deterministic validation and cannot accidentally announce into an unrelated prior conversation. Existing hook mappings retain their current delivery semantics.
Evidence
Exact head:
7d6169a51c0d44151bef2d9f26f3ba5cdba6614edeliver: falsedestination clearing, normalized scheduler payloads, and the actualCronJobhandoff.git diff --checkpassed.CHANGELOG.mdremains release-owned.