Skip to content

fix(plugins): remove incorrect modifying hook timeout fallback in getClaimingHookTimeoutMs - #107996

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
ljy-1351:fix/claiming-hook-timeout-dictionary
Jul 29, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
ljy-1351:fix/claiming-hook-timeout-dictionary

Conversation

@ljy-1351

@ljy-1351 ljy-1351 commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Claiming hooks such as before_agent_reply currently fall back to modifyingHookTimeoutMsByHook. That is a copy/paste ownership error: claiming hooks have their own execution contract and should only be bounded when the registration explicitly sets timeoutMs.

After the new shared hook defaults landed, leaving this fallback in place could silently impose modifying-hook policy on claiming hooks.

Implementation

  • Keep getClaimingHookTimeoutMs scoped to the registration-level timeoutMs.
  • Update both claiming execution paths.
  • Add a deterministic fake-timer regression test proving a modifying-hook default does not terminate a claiming hook.

Evidence

  • Rewritten from current origin/main at 5bfc65d7f46a3dd833072403d8f1e05fbbe9c487.
  • Exact pushed head: 4e1d6caf153a18ab7ce30643b6a61f363a7e9b94.
  • NODENV_VERSION=24.18.0 node scripts/run-vitest.mjs src/plugins/hooks.before-agent-reply.test.ts: 9 tests passed.
  • oxfmt --check, targeted run-oxlint.mjs, and git diff --check: passed.
  • Fresh uncommitted autoreview: no accepted/actionable findings, confidence 0.90.
  • Contributor credit is preserved in the rewritten commit.

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

  • Replayed the reviewed two-file patch onto current main using a signed ancestry anchor; no later main commit touched the hook-runner files.
  • Current-main diff remains +28/-8 across src/plugins/hooks.ts and its focused regression test.
  • Maintainer decision: claiming-hook deadlines are registration-owned. A separate implicit claiming default would add policy surface and preserve the original ownership leak.
  • Fresh exact-head CI is required before merge; no stale-head result will be accepted.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 11:58 AM ET / 15:58 UTC.

ClawSweeper review

What this changes

This PR stops claiming hooks from inheriting modifying-hook timeout defaults and tests that a claiming hook without its own timeout can complete.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep 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
Reviewed head: 4e1d6caf153a18ab7ce30643b6a61f363a7e9b94
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, test-covered correction with adequate reported behavior proof; the remaining gate is deliberate compatibility acceptance and fresh exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied PR context records an after-fix OpenClaw runtime invocation and focused regression run, and prior ClawSweeper review marked the proof sufficient; exact-head CI remains in progress.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied PR context records an after-fix OpenClaw runtime invocation and focused regression run, and prior ClawSweeper review marked the proof sufficient; exact-head CI remains in progress.
Evidence reviewed 4 items Changed timeout boundary: The PR changes the claiming-hook helper to read only the registration's timeoutMs, while the neighboring modifying-hook helper continues to read the hook-name default map. Both claiming execution paths call the narrowed helper.
Focused behavioral coverage: The added fake-timer test configures a 10 ms modifying-hook default, runs a claiming hook for 100 ms without a registration timeout, and expects the claiming result to succeed.
Prior review continuity: The latest completed ClawSweeper review at 882a69c found no line-level findings and identified the remaining question as the compatibility consequence of removing an implicit timeout fallback.
Findings None None.
Security None None.

How this fits together

Plugin 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
Loading

Decision needed

Question Recommendation
Should existing claiming hooks that relied on modifyingHookTimeoutMsByHook become explicitly configured and potentially unbounded, or must the project preserve a bounded compatibility behavior? Confirm explicit-only claiming deadlines: Accept the compatibility change, document the registration-owned timeout expectation in review context, and merge after exact-head CI passes.

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

  • Resolve merge risk (P1) - Existing claiming-hook registrations that omit timeoutMs but currently inherit modifyingHookTimeoutMsByHook will become unbounded; a slow or stuck claiming hook can delay reply handling unless its plugin declares an explicit deadline.
  • Resolve merge risk (P1) - The supplied context reports the PR is behind main and its exact-head CI is still running, so merge confidence should be refreshed against the current merge result rather than earlier checks.
  • Complete next step (P2) - A reviewer must decide whether removing the implicit fallback is an acceptable upgrade behavior; no narrow automated repair can make that product-contract choice.
Agent review details

Security

None.

PR surface

Source -4, Tests +24. Total +20 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 8 -4
Tests 1 24 0 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 28 8 +20

Review metrics

Metric Value Why it matters
Implicit timeout fallback 1 removed Removing this runtime fallback changes how existing claiming-hook registrations behave when they omit timeoutMs.

Merge-risk options

Maintainer options:

  1. Confirm the explicit-only upgrade contract (recommended)
    Merge after exact-head CI if the reviewer confirms that plugins without registration timeoutMs may now wait without the former shared fallback.
  2. Design a claiming-specific compatibility default
    Pause this patch and define a separately owned claiming-hook default if bounded behavior must remain for existing registrations.

Technical review

Best 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.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a focused plugin-runtime behavior correction with a bounded but real impact on reply handling for affected hook registrations.
  • merge-risk: 🚨 compatibility: The PR removes an implicit timeout source that existing claiming hooks may currently rely on without declaring timeoutMs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied PR context records an after-fix OpenClaw runtime invocation and focused regression run, and prior ClawSweeper review marked the proof sufficient; exact-head CI remains in progress.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied PR context records an after-fix OpenClaw runtime invocation and focused regression run, and prior ClawSweeper review marked the proof sufficient; exact-head CI remains in progress.

Evidence

What I checked:

  • Changed timeout boundary: The PR changes the claiming-hook helper to read only the registration's timeoutMs, while the neighboring modifying-hook helper continues to read the hook-name default map. Both claiming execution paths call the narrowed helper. (src/plugins/hooks.ts:541, 4e1d6caf153a)
  • Focused behavioral coverage: The added fake-timer test configures a 10 ms modifying-hook default, runs a claiming hook for 100 ms without a registration timeout, and expects the claiming result to succeed. (src/plugins/hooks.before-agent-reply.test.ts:97, 4e1d6caf153a)
  • Prior review continuity: The latest completed ClawSweeper review at 882a69c found no line-level findings and identified the remaining question as the compatibility consequence of removing an implicit timeout fallback. (src/plugins/hooks.ts:541, 882a69cdd976)
  • Current review limitation: The supplied GitHub context reports a cleanly mergeable PR that is behind main with exact-head CI still in progress; read-only repository inspection was unavailable in this session, so this review does not claim fresh local source or history verification beyond the supplied PR material.

Likely related people:

  • vincentkoc: Authored the current replayed fix commits, was assigned to the PR, and recorded the current-main anchoring work in the supplied PR history. (role: recent area contributor; confidence: medium; commits: 882a69cdd976, c03de2494656, 4e1d6caf153a; files: src/plugins/hooks.ts, src/plugins/hooks.before-agent-reply.test.ts)

Rank-up moves

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

  • Confirm the registration-owned timeout upgrade contract, then wait for the current exact-head CI result before merging.

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.

History

Review history (7 earlier review cycles)
  • reviewed 2026-07-16T02:31:15.486Z sha dccd10fd0bbad8438a037050a1601aaba0fc7450 :: needs real behavior proof before merge. :: [P2] Remove the now-unused hook-name parameter
  • reviewed 2026-07-18T08:42:49.551Z sha dccd10fd0bbad8438a037050a1601aaba0fc7450 :: needs real behavior proof before merge. :: [P2] Remove the now-unused claiming hook-name parameter
  • reviewed 2026-07-18T09:09:14.968Z sha 0da592392286a407dd2651d12a00c90dc844f26a :: needs real behavior proof before merge. :: [P1] Define the claiming-hook default before deleting the fallback | [P2] Remove the now-unused claiming hook-name parameter
  • reviewed 2026-07-18T09:17:44.111Z sha 0da592392286a407dd2651d12a00c90dc844f26a :: needs changes before merge. :: [P2] Drop the unused claiming hook-name argument
  • reviewed 2026-07-18T09:28:38.599Z sha ccda7033745cc28370997c0a9174fd845d90621f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-18T10:10:45.850Z sha ccda7033745cc28370997c0a9174fd845d90621f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T13:03:42.876Z sha 882a69c :: needs maintainer review before merge. :: none

@ljy-1351

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 18, 2026
@ljy-1351
ljy-1351 force-pushed the fix/claiming-hook-timeout-dictionary branch from dccd10f to 0da5923 Compare July 18, 2026 09:05
@ljy-1351

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated PR body with real OpenClaw runtime invocation evidence (not standalone simulation). Please re-review.

@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 18, 2026
@ljy-1351

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Removed unused hookName parameter and added regression test does not inherit modifyingHookTimeoutMsByHook fallback for claiming hooks.

@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 18, 2026
@vincentkoc
vincentkoc force-pushed the fix/claiming-hook-timeout-dictionary branch from ccda703 to 882a69c Compare July 29, 2026 08:50
@vincentkoc vincentkoc self-assigned this Jul 29, 2026
@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Jul 29, 2026
@clawsweeper clawsweeper Bot added the rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. label Jul 29, 2026
vincentkoc and others added 2 commits July 29, 2026 17:53
Preserve contributor branch ancestry while replaying the reviewed narrow fix.
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 29, 2026
@vincentkoc
vincentkoc merged commit 0ef7b45 into openclaw:main Jul 29, 2026
122 of 127 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

vincentkoc added a commit to ZengWen-DT/openclaw that referenced this pull request Jul 29, 2026
* 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
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

2 participants