Repository navigation
fix(plugins): unify HTTP route conflict handling - #118203
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 2:10 PM ET / 18:10 UTC. ClawSweeper reviewWhat this changesThe branch replaces separate static and lifecycle plugin HTTP-route conflict checks with one canonical resolver, canonicalizes webhook target keys, and makes six bundled webhook lifecycles fail startup rather than report ready when their required route cannot bind. Merge readinessThis PR remains necessary: it repairs a real shared route-registration invariant and carries a new public Plugin SDK lifecycle contract. The patch is coherent and the prior source-ownership finding is addressed, but the compatibility/availability tradeoff of Priority: P2 Review scores
Verification
How this fits togetherPlugin HTTP routes are registered both while plugins load and later by channel/provider lifecycle code. The gateway dispatches inbound webhook requests through those routes; route identity, owner replacement, and startup failure handling determine whether a channel can safely receive traffic. flowchart LR
A[Plugin static registration] --> C[Canonical route conflict resolver]
B[Channel lifecycle registration] --> C
C --> D{Route can bind?}
D -->|yes| E[Gateway route registry]
E --> F[Canonical webhook target map]
F --> G[Inbound webhook dispatch]
D -->|no, default| H[Log and no-op cleanup]
D -->|no, strict| I[Stop startup and clean up]
Decision needed
Why: The implementation is mechanically coherent, but this is a compatibility-sensitive public SDK direction that determines how external plugins fail at startup and refresh routes across upgrades. Before merge
Agent review detailsSecurityNone. PR surfaceSource +155, Tests +679, Docs +3, Generated 0, Other +2. Total +839 across 29 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Accept one documented Plugin SDK route-ownership contract—default compatibility no-op, explicit strict startup, and stable source ownership—then merge only after the exact-head hosted gates confirm the core and bundled channel paths together. Do we have a high-confidence way to reproduce the issue? Yes, at source level: register a canonical alias or a later conflicting route through the static or lifecycle registrar, then observe that the previous split policy could retain an unreachable or order-dependent route. The PR adds focused regression coverage for those paths, but this read-only review did not execute tests. Is this the best way to solve the issue? Yes, conditionally: one shared conflict resolver at the registry owner is a better fix than channel-local guards, and canonicalizing the target map matches Gateway path identity. The remaining question is whether maintainers accept the public SDK compatibility contract introduced to expose strict lifecycle failure. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a67c52611e57. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
003abaa to
adba254
Compare
|
ClawSweeper resolution for
This aligns the runtime predicate, public SDK docs, focused regression coverage, and the requested compatibility owner decision. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
db71f9f to
830ae07
Compare
|
Maintainer decision for exact head
The two OpenGrep findings were also reviewed and do not require code changes:
Merge remains gated on the exact-head required CI result. |
|
Merged via squash.
|
* origin/main: (25 commits) test(qa): cover plugin authoring contracts (#118821) fix(parallels): keep provider keys out of POSIX job logs (#118840) improve: reduce redundant Code Mode test work (#118815) fix(models): report primary OpenRouter limits in scans (#110855) test: speed up setup inference fixtures (#118811) fix(auto-reply): enforce canonical reset authorization (#118580) docs(gateway): fix invalid heartbeat visibility examples (#118827) fix(plugins): unify HTTP route conflict handling (#118203) test(agents): use prepared auth fixtures (#118816) fix(lmstudio): resolve JIT embedding variants fix(lmstudio): preserve embedding preload and model identity fix(ai): reject binary Codex websocket frames (#111138) fix(deps): bump brace-expansion override to 5.0.9 for HIGH advisory 1130705 (#118804) feat(cli): add session archive and delete commands (#118791) fix(openai): commit eligible final realtime transcription audio safely (#118782) fix(reef): restrict management commands to owners [AI] (#118578) fix(google): honor Cloud SDK credential location and Vertex billing project (#118745) fix(bedrock): preserve private embedding endpoints and AWS routing policy (#118744) fix(voice): make signed callback replay reservations durable and retryable (#118754) fix(openrouter): isolate custom proxy credentials and transport security (#118773) ...
…-state-mutation * origin/main: (22 commits) fix(delivery): renew stable producer leases (#118663) test(mcp): isolate catalog size checks from wall-clock load (#118871) test(ui): add credentials primary QA proof (#118790) fix(slack): prevent stalled presence polling from hanging shutdown (#117478) test(security): cover gateway shared auth modes (#118834) fix(macos): show gateway auth failures in app status (#118841) test(tui): route PTY gateway scenarios through explicit models (#118802) test(qa): add session transcript primary coverage (#118820) fix(browser): protect private observation media and Canvas trust boundaries (#118775) fix(build): restore SDK packages and signed macOS app builds (#118833) test(qa): cover plugin authoring contracts (#118821) fix(parallels): keep provider keys out of POSIX job logs (#118840) improve: reduce redundant Code Mode test work (#118815) fix(models): report primary OpenRouter limits in scans (#110855) test: speed up setup inference fixtures (#118811) fix(auto-reply): enforce canonical reset authorization (#118580) docs(gateway): fix invalid heartbeat visibility examples (#118827) fix(plugins): unify HTTP route conflict handling (#118203) test(agents): use prepared auth fixtures (#118816) fix(lmstudio): resolve JIT embedding variants ...
* fix(plugins): unify HTTP route conflict handling * fix(plugins): preserve source-less route replacement * test(line): type webhook route source
Related: #118044
What Problem This Solves
Plugin HTTP route registration had two partially different collision policies. Both could stop at the first overlap, and some route identity checks used raw path bytes even though Gateway dispatch canonicalizes paths. A hidden mixed-auth overlap, canonical alias, or incompatible lifecycle replacement could therefore leave startup reporting an active route whose handler depended on registration order.
The same raw-versus-canonical split also leaked into route-backed webhook target and media-lease ownership. Canonical aliases could acquire separate local owners for one Gateway route, while a Mattermost interactions route could replace an independent slash-command route owned by the same plugin.
Owner Decision
throwOnFailureis accepted as the permanent opt-in plugin SDK contract for lifecycle owners that must fail startup when route registration is rejected.throwOnFailure: true.pluginId.sourceis an optional stable same-plugin sub-owner: both omitted remains compatible, while a source-aware route can replace only the same nonempty source.Source-less same-plugin replacement shipped in the public SDK and remains supported. Bundled source-aware callers keep a stable source across refreshes; LINE now uses
line-webhook. This gives plugins one stable way to choose startup policy without making rejection fatal for existing external callers.Canonical Fix
No generic public route-sharing API is added. The public SDK addition is the strict lifecycle failure option plus the canonical webhook route-key helper needed by route-backed owners.
Representative Lifecycle Proof
Evidence
830ae075c43d168e5601f8496d31cf72b6463006.check-test-typeslane.git diff --checkpassed.a67c52611e5768ffe89dc2c4eea0cea0e26e34e6is patch-identical for all three commits bygit range-diff; it removes the unrelated brace-expansion advisory from the CI merge base.The positive production delta establishes one canonical route-identity and lifecycle-ownership contract across the core registry, SDK webhook keys, and six bundled channel lifecycles; the corresponding focused coverage is larger than the production change.
No changelog entry:
CONTRIBUTING.mdreserves contributor PR changelog edits for maintainers or ClawSweeper at landing.