Repository navigation
refactor(plugins): consolidate lifecycle hook dispatch - #119429
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 11:03 PM ET / August 5, 2026, 03:03 UTC. ClawSweeper reviewWhat this changesThis PR replaces 17 repeated plugin lifecycle observation-hook wrappers with equivalent typed properties that delegate directly to the shared dispatcher. Merge readinessNo blocking correctness or security finding: the refactor preserves every lifecycle method’s typed call into the existing dispatcher. The protected Priority: P3 Review scores
Verification
How this fits togetherThe plugin hook runner receives lifecycle events from agents, channels, sessions, and the gateway, then dispatches them to registered plugin handlers. This change only shortens the runner facade; dispatch behavior and plugin-facing signatures remain in place. flowchart LR
A[Agent, channel, and gateway events] --> B[Plugin hook runner]
B --> C[Typed lifecycle dispatcher]
C --> D[Registered plugin handlers]
D --> E[Plugin observations and side effects]
Decision needed
Why: The Before merge
Agent review detailsSecurityNone. PR surfaceSource -130. Total -130 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep a single typed dispatcher and merge this net-negative facade cleanup after the owner confirms the exact-head checks and merge result. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors existing dispatch code rather than reporting a user-facing failure; focused lifecycle suites cover the affected methods. Is this the best way to solve the issue? Yes. Direct typed facade properties preserve the public signatures while retaining one canonical dispatcher for ordering, timeout, and error policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 22de30f99821. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (22 commits) refactor(plugins): consolidate lifecycle hook dispatch (#119429) fix(ci): stabilize TUI PTY proof ownership (#119420) test(system-agent): reduce suite setup overhead (#119424) fix(ui): keep session rail pill status from overlapping the headline (#119397) fix(discord): avoid doctor runtime loading (#119391) fix(media): decouple playback cache retention (#119417) fix(slack): infer upload filename extensions from MIME types (#119399) refactor(channels): unify configured binding resolution (#119414) refactor(google-meet): unify gateway and tool dispatch (#119413) test(state): reuse legacy database fixtures (#119423) fix(reset): preserve bootstrap guidance for dynamic models (#119179) fix(chutes): honor serving context limits (#119196) refactor(status): consolidate scan projections and lazy loaders (#119412) fix(status): status --all slows down with missing plugins (#119203) refactor(gateway): consolidate usage reporting and caches (#119409) perf(gateway): keep reload and recovery machinery off gateway cold start (#119094) fix(cli): align TaskFlow controller columns for wide text (#118801) fix: make startup migration restart guidance install-neutral (#119406) fix(ci): preserve cache warmer shard envelopes (#119403) fix(sessions): preserve compatible auth profiles on model changes (#117550) ...
What Problem This Solves
Plugin lifecycle observation hooks repeated the same dispatch wrapper 17 times, increasing maintenance cost and the risk of inconsistent hook behavior. This is part of a maintainer-requested project-wide production LOC reduction campaign.
Why This Change Was Made
Route equivalent observation hooks directly through the existing typed lifecycle dispatcher while preserving every published hook signature, including the pairing hook indexed-access spelling required by the Plugin SDK API contract.
User Impact
No operator-visible behavior change; plugin event ordering, timeout handling, error isolation, and public types are unchanged. Removes 130 production lines.
Evidence
gpt-5.6-solwithxhighreasoning; no accepted or actionable findings.git diff --check, scoped formatting, and direct before/after behavioral equivalence checks passed.