Repository navigation
fix(channels): restore system-agent approval reactions - #159132
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 8:59 PM ET / September 27, 2026, 00:59 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch preserves system-agent approval identity through iMessage, Signal, and WhatsApp reactions, adds regression coverage, and updates channel-plugin guidance. Merge readiness✅ Ready for maintainer review Keep open: current main still has the approval failure. The pinned patch has no identified correctness or security defect, and exact-head CI passed. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway sends typed approval requests to channel plugins, which deliver prompts and retain targets for reactions or polls. Authorized responses return to the Gateway, where a system-agent approval can permit a persistent change. flowchart LR
A[Gateway approval request] --> B[Channel prompt]
B --> C[Reaction or poll target]
C --> D[Stored target reader]
D --> E[Actor and route checks]
E --> F[Gateway custody check]
F --> G[Approval decision]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -6, Tests +364, Docs +4. Total +362 across 13 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one typed approval path through channel bindings and let the Gateway revalidate reviewer custody when it records the decision. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source rejects the declared kind in reaction targets and downgrades it in reply metadata; the PR reports matching baseline failures. This read-only review did not execute the tests. Is this the best way to solve the issue? Yes. The branch repairs the existing typed approval path without adding a competing resolver or changing the stored record shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 038b10b48de0. 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)
|
|
f6bcf26 to
da9edc4
Compare
…n inventory (openclaw#159340) openclaw#159132 replaced the existing unknown-cast in the WhatsApp invalid approval-kind test with a @ts-expect-error. The type-suppression inventory test (tooling shard, not selected by that PR's path-scoped CI) now sees 18 negative assertions against 17 recorded ones and fails on every PR whose CI runs the tooling shard. Restore the previous cast form instead of growing the inventory.
Keep the negative-type assertion from #159132 explicit in the inventory and bind its allowance to the exact synthetic invalid-input fixture. The existing zero-any and inventory checks remain active, and a changed-input control fails at the fixture qualification.
Keep the negative-type assertion from #159132 explicit in the inventory and bind its allowance to the exact synthetic invalid-input fixture. The existing zero-any and inventory checks remain active, and a changed-input control fails at the fixture qualification.
* fix(channels): restore native system-agent approval reactions * fix(approvals): preserve system-agent reply metadata * test(channels): simplify forwarding fixture store types * test(channels): load Signal through its public artifact owner
…n inventory (openclaw#159340) openclaw#159132 replaced the existing unknown-cast in the WhatsApp invalid approval-kind test with a @ts-expect-error. The type-suppression inventory test (tooling shard, not selected by that PR's path-scoped CI) now sees 18 negative assertions against 17 recorded ones and fails on every PR whose CI runs the tooling shard. Restore the previous cast form instead of growing the inventory.
Keep the negative-type assertion from #159132 explicit in the inventory and bind its allowance to the exact synthetic invalid-input fixture. The existing zero-any and inventory checks remain active, and a changed-input control fails at the fixture qualification.
Keep the negative-type assertion from #159132 explicit in the inventory and bind its allowance to the exact synthetic invalid-input fixture. The existing zero-any and inventory checks remain active, and a changed-input control fails at the fixture qualification.
Keep the negative-type assertion from #159132 explicit in the inventory and bind its allowance to the exact synthetic invalid-input fixture. The existing zero-any and inventory checks remain active, and a changed-input control fails at the fixture qualification.
* feat(presence): let agents inspect people and active devices Expose a read-only presence tool for online people, requester-scoped device activity, and optional network and IP geography. Reuse live connection, profile, node, and geolocation owners; preserve activity provenance and worker requester authority without retaining activity history. * fix(presence): register tool display metadata * fix(presence): require live source authority for agent reads Preserve authenticated Team read scopes and explicitly admitted owner or scheduled sources before synthetic Gateway dispatch. Retain the same source through worker execution and revalidate before returning observations. Append the advertised RPC to preserve existing method indices. Include the already-landed c0e6951 Cron fixture scheduler corrections so the branch typechecks independently. Add real local router and worker admission regressions for unknown, limited, scheduled, and revoked sources. * fix(protocol): regenerate appended presence method enum * fix(tooling): include presence schema in PR wrapper extraction * test(gateway): drain buffered MCP keepalives on shutdown * test: qualify synthetic approval kind assertion Keep the negative-type assertion from #159132 explicit in the inventory and bind its allowance to the exact synthetic invalid-input fixture. The existing zero-any and inventory checks remain active, and a changed-input control fails at the fixture qualification. * test(presence): reconcile rebased lookup and inventory fixtures * build(presence): refresh plugin assets after dependency update * test(presence): verify activity reporting retains device attribution
…9117) * feat(presence): let agents inspect people and active devices Expose a read-only presence tool for online people, requester-scoped device activity, and optional network and IP geography. Reuse live connection, profile, node, and geolocation owners; preserve activity provenance and worker requester authority without retaining activity history. * fix(presence): register tool display metadata * fix(presence): require live source authority for agent reads Preserve authenticated Team read scopes and explicitly admitted owner or scheduled sources before synthetic Gateway dispatch. Retain the same source through worker execution and revalidate before returning observations. Append the advertised RPC to preserve existing method indices. Include the already-landed 03f9f7e Cron fixture scheduler corrections so the branch typechecks independently. Add real local router and worker admission regressions for unknown, limited, scheduled, and revoked sources. * fix(protocol): regenerate appended presence method enum * fix(tooling): include presence schema in PR wrapper extraction * test(gateway): drain buffered MCP keepalives on shutdown * test: qualify synthetic approval kind assertion Keep the negative-type assertion from openclaw#159132 explicit in the inventory and bind its allowance to the exact synthetic invalid-input fixture. The existing zero-any and inventory checks remain active, and a changed-input control fails at the fixture qualification. * test(presence): reconcile rebased lookup and inventory fixtures * build(presence): refresh plugin assets after dependency update * test(presence): verify activity reporting retains device attribution
What Problem This Solves
Native iMessage, Signal, and WhatsApp runtimes already advertise
system-agentapprovals, but their reaction registration and shared target reader/resolver rejected that kind. Prompts could advertise reactions without binding an actionable target. iMessage's persisted poll/reaction readers also rejected it after restart.Configured Signal forwarded approvals lost the same ownership at another boundary: the shared reply-metadata reader changed explicit
system-agenttoexecbefore the delivered-message hook registered the reaction.User Impact
Restores the declared approval kind through native delivery, reaction registration/resolution, iMessage state restoration, and already-enabled matching Signal forwarded targets. Default forwarded Signal prompts remain manual. Existing actor authorization, routing, allowed decisions, expiration, replay suppression, and Gateway authority stay with their current owners.
No config, protocol, SDK signature, persisted format, namespace, retention, or migration changes. Omitted/unknown legacy metadata kinds retain the existing exec fallback.
Why This Change Was Made
Preserve the declared kind at its existing owner boundaries. Remove the shared resolver's private legacy-inference branch, whose only caller always disabled it; retain its public typed signature and optional legacy record shape. This is the separate bug repair discovered during #158937.
Evidence
Independent Codex review is scoped-clean through P2. The final rebase preserved both reviewed product patches exactly; its duplicate WhatsApp fixture repair was dropped in favor of the stronger upstream repair.
On Blacksmith Testbox
tbx_01m3fhcq50psc9rcg75k360q30(native negative/positive proof), all five native regressions failed against the exact original production blobs for the intended behavior assertions. The repaired candidate passed all four complete changed files (70 tests), including native registration, unauthorized actor refusal, authorized Gateway handoff, replay suppression, and real SQLite restoration.On Blacksmith Testbox
tbx_01m3fqfk8nrbm3h9szd2b1vmrp(forwarding proof), the actual forwarding producer and registered Signal outbound pipeline failed the configured binding assertion with the original metadata reader; the manual-default control passed. Both passed with the repaired reader. Transport and Gateway resolution are mocked; the real delivered-message hook records bindings in a synthetic runtime store. This is boundary proof, not a live channel claim.Complete production proof on Blacksmith Testbox
tbx_01m3fwveamyqxnnhwjmmzdeqxf(run), Node 24.19.0 / pnpm 12.4.2, published main basec147e0e6521d1652c99a8152985c3c586f368d5d:pnpm test:extensions:batch imessage,signal, andwhatsapppassed: 3,319 tests, three existing Signal skips, 225 file executions (128.707 s, 136.555 s, and 93.031 s).pnpm buildpassed in 410.010 s.node scripts/check-changed.mjs --base c147e0e6521d1652c99a8152985c3c586f368d5dpassed every stage except one unnecessary generic in the new test fixture (1,820.272 s overall). After removing that generic, the canonical affected-file check passed in 194.270 s:node scripts/check-changed.mjs --base c147e0e6521d1652c99a8152985c3c586f368d5d -- test/signal-approval-forwarding.integration.test.ts.This reran root test typing, lint, formatting, and selected repository guards. Both integration cases passed again in 17.686 s. The fixture-only correction received fresh clean review; production bytes and assertions are unchanged.
4d79fdc816ff712e528a7904379e6cee2a0110c5. Subsequent changes only correct the new integration test's types and public-artifact loading; production bytes and assertions are unchanged.Final fixture and boundary proof on Blacksmith Testbox
tbx_01m3g29xk4f99zhbmt5j66jk83(run) verified tree9c1ff905536554dbadfbb8e4d2f81058fd1ff9ce, identical to final committed head6856054f9a7eebcc4b3e7fc73fd479a3a97948a3:check-changedcommand above passed in 241.953 s.node scripts/run-vitest.mjs --config test/vitest/vitest.boundary.config.tspassed the entire formerly failing shard: 140 tests in 12 files, 30.585 s. The three additional fs-safe/test-helper/checker import-boundary suites also passed (4.581 s).loadBundledPluginFacadehelper loads the same public Signal channel artifact; no boundary exception or production export was added. This correction received fresh independent review through P2 with no actionable findings.All lane-owned leases are stopped. Every test, check, and build ran remotely.
Measured
pnpm test <file> --maxWorkers=1command wall times:extensions/imessage/src/approval-handler.runtime.test.tsextensions/imessage/src/approval-reactions.persistence.test.tsextensions/signal/src/approval-reactions.test.tsextensions/whatsapp/src/approval-reactions.test.tstest/signal-approval-forwarding.integration.test.tsTestbox wall includes wrapper/worker preparation. CI case time sums the successful Linux Node case durations and excludes wrapper/transform/setup time. Native persistence uses the real SQLite lifecycle; forwarding uses the registered outbound pipeline, whose first module load accounts for most of its measured case time.
Fixes Found Along the Way
Initial CI exposed a WhatsApp debounce fixture race. The canonical repair landed in #159115 (
32e46c9bb1bcdedb79bcca8e4f5b3cb0429934ca) and is included in this branch's base. The final PR does not modify that inbox fixture. Twenty standalone and three original-shard runs of a superseded local repair are not claimed as proof for the upstream implementation.The preceding CI run passed all 335 Node cases in
checks-node-changed-compact-large-9, then failed suite teardown insrc/gateway/session-group-mutation-targets.test.ts:Retired agent cleanup cannot adopt a replacement shared database. It canceled the remaining jobs. The fixture closed shared state before asynchronous agent cleanup settled; this PR changes neither that fixture nor the cleanup owners.The test-only ordered-await repair is now merged in #159163 (
d9fd43d6cf4286e1734e4a6ff91b962cb3e35e82). Its owner reports 20 standalone and three original-shard passes, retaining all assertions and production identity checks. The next CI merge ref includes that upstream repair; no duplicate fix or retry-only commit was added here.Head
5989726e706eebccaaaddcfc206f6ff99a3a6ce6passed the previously failing cleanup shard, then CI found the test import violation corrected and fully validated above.Final head
6856054f9a7eebcc4b3e7fc73fd479a3a97948a3passed exact-head CI: all 162 jobs completed, no failures, and both requiredopenclaw/ci-gatechecks are green. READY-TO-LAND, intentionally unmerged.