Skip to content

fix(hooks): mark wake hook events untrusted#62003

Merged
drobison00 merged 2 commits into
openclaw:mainfrom
eleqtrizit:328
Apr 6, 2026
Merged

fix(hooks): mark wake hook events untrusted#62003
drobison00 merged 2 commits into
openclaw:mainfrom
eleqtrizit:328

Conversation

@eleqtrizit

Copy link
Copy Markdown
Contributor

Summary

  • Marks wake-hook system events as untrusted when they are queued for the main session
  • Covers both direct /hooks/wake requests and mapped action: "wake" hook routes through the shared dispatch path

Changes

  • Passed trusted: false when dispatchWakeHook(...) enqueues hook wake text
  • Added a regression test that verifies direct and mapped wake payloads are queued as untrusted system events

Validation

  • Ran corepack pnpm test src/gateway/server.hooks.test.ts
  • Ran corepack pnpm test src/infra/system-events.test.ts
  • Attempted corepack pnpm build and confirmed the failure is due to unrelated pre-existing type errors in other packages/files outside this change
  • Attempted claude -p "/review", but the local reviewer exited before review output because it requested interactive GitHub approval

Notes

  • This change is intentionally narrow and only downgrades externally supplied wake-hook payloads; it does not alter other internal system-event producers

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Apr 6, 2026
@greptile-apps

greptile-apps Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Marks externally-supplied wake-hook system events as untrusted (trusted: false) so they surface with a "System (untrusted)" prefix in the prompt rather than the default "System" prefix. The one-line production change and its regression test are both correct: the test covers the direct /hooks/wake path and the action: "wake" mapping path, and the peekSystemEventEntries assertion verifies the flag end-to-end.

The dispatchAgentHook result-summary events intentionally remain trusted — they are the agent's own output, not a raw pass-through of external content, so "System" is appropriate there.

Confidence Score: 5/5

Safe to merge — the change is a correct, minimal trust-boundary fix with a targeted regression test.

Single-line production change with correct semantics, full test coverage of both wake paths, and no unintended side effects on other event producers.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(hooks): mark wake hook events untrus..." | Re-trigger Greptile

@drobison00
drobison00 merged commit 5b6e552 into openclaw:main Apr 6, 2026
27 of 31 checks passed
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* fix(hooks): mark wake hook events untrusted

* docs(changelog): add wake-hook trust entry

---------

Co-authored-by: Devin Robison <[email protected]>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* fix(hooks): mark wake hook events untrusted

* docs(changelog): add wake-hook trust entry

---------

Co-authored-by: Devin Robison <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* fix(hooks): mark wake hook events untrusted

* docs(changelog): add wake-hook trust entry

---------

Co-authored-by: Devin Robison <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(hooks): mark wake hook events untrusted

* docs(changelog): add wake-hook trust entry

---------

Co-authored-by: Devin Robison <[email protected]>
@eleqtrizit
eleqtrizit deleted the 328 branch June 30, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants