Repository navigation
fix(plugins): remove incorrect modifying hook timeout fallback in getClaimingHookTimeoutMs - #107996
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 11:58 AM ET / 15:58 UTC. ClawSweeper reviewWhat this changesThis PR stops claiming hooks from inheriting modifying-hook timeout defaults and tests that a claiming hook without its own timeout can complete. Merge readinessKeep this PR open for the assigned reviewer: the narrow code and regression test support the stated explicit-only timeout contract, but removing the fallback changes the upgrade behavior of existing claiming-hook registrations that relied on the shared hook-name timeout map. The current exact-head CI run should finish before merge. Priority: P2 Review scores
Verification
How this fits togetherPlugin hooks let extensions intercept agent-reply handling. The hook runner reads each registration, optionally applies a timeout, and returns the first claiming handler that marks the event handled so the agent reply flow can proceed. flowchart LR
A[Plugin hook registration] --> B[Hook runner]
C[Shared modifying-hook defaults] --> D[Modifying hook timeout]
B --> E{Claiming hook timeout?}
E -->|Registration timeoutMs| F[Bounded claiming handler]
E -->|No explicit timeout| G[Await claiming handler]
F --> H[Handled reply outcome]
G --> H
Decision needed
Why: The patch deliberately changes runtime behavior for registrations with no timeoutMs; tests establish the new behavior but cannot decide the acceptable upgrade contract. Before merge
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +24. Total +20 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Record the intended upgrade contract that claiming-hook deadlines are registration-owned, then merge only after the current exact-head CI confirms the replay remains clean. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was established in this session. The supplied regression test and patch make the prior inheritance path source-reproducible, but read-only inspection could not independently run or trace current main. Is this the best way to solve the issue? Unclear. The implementation is the narrowest fix if claiming deadlines are truly registration-owned, but maintainers must first accept the changed behavior for existing registrations that previously inherited the modifying timeout map. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against c6dfee1b78b4. LabelsLabel changes:
Label 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 (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
dccd10f to
0da5923
Compare
|
@clawsweeper re-review Updated PR body with real OpenClaw runtime invocation evidence (not standalone simulation). Please re-review. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Removed unused hookName parameter and added regression test |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: ljy-1351 <[email protected]>
ccda703 to
882a69c
Compare
Preserve contributor branch ancestry while replaying the reviewed narrow fix.
Co-authored-by: ljy-1351 <[email protected]>
|
Merged via squash.
|
* origin/main: (446 commits) fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285) fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927) fix(test): isolate plugin install fixtures (openclaw#116008) fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729) fix(sms): isolate validated webhook quotas per sender (openclaw#104862) fix(sessions): recover deleted chats without endless retries (openclaw#115974) fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847) feat(ui): enable tool-loop detection from Labs (openclaw#115983) fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998) fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003) fix(ui): derive cron timezone suggestions (openclaw#115973) fix(scripts): bound dependency pin git lookups (openclaw#110570) fix(skills): preserve configless workshop apply upgrades (openclaw#115982) fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236) fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800) fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004) fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501) fix(channels): mark durable webhook acceptance on Zalo, Google Chat, SMS, Feishu, Nextcloud Talk, and Synology Chat (openclaw#115586) fix(test): restore stdin TTY descriptors (openclaw#115985) fix(plugins): remove incorrect modifying hook timeout fallback in getClaimingHookTimeoutMs (openclaw#107996) ... # Conflicts: # extensions/openai/realtime-quicksilver-wire.ts
…ClaimingHookTimeoutMs (openclaw#107996) * fix(plugins): keep claiming hook timeouts explicit Co-authored-by: ljy-1351 <[email protected]> * fix(plugins): keep claiming hook timeouts explicit Co-authored-by: ljy-1351 <[email protected]> --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Claiming hooks such as
before_agent_replycurrently fall back tomodifyingHookTimeoutMsByHook. That is a copy/paste ownership error: claiming hooks have their own execution contract and should only be bounded when the registration explicitly setstimeoutMs.After the new shared hook defaults landed, leaving this fallback in place could silently impose modifying-hook policy on claiming hooks.
Implementation
getClaimingHookTimeoutMsscoped to the registration-leveltimeoutMs.Evidence
origin/mainat5bfc65d7f46a3dd833072403d8f1e05fbbe9c487.4e1d6caf153a18ab7ce30643b6a61f363a7e9b94.NODENV_VERSION=24.18.0 node scripts/run-vitest.mjs src/plugins/hooks.before-agent-reply.test.ts: 9 tests passed.oxfmt --check, targetedrun-oxlint.mjs, andgit diff --check: passed.Risk
No public type, config, migration, or protocol change. Explicit per-registration claiming-hook deadlines continue to work; only the unrelated modifying-hook fallback is removed.
Maintainer Replay
mainusing a signed ancestry anchor; no latermaincommit touched the hook-runner files.+28/-8acrosssrc/plugins/hooks.tsand its focused regression test.