Repository navigation
perf(agents): classify allowlists without intermediate sets - #138392
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 5, 2026, 9:15 PM ET / September 6, 2026, 01:15 UTC. ClawSweeper reviewWhat this changesThe PR reduces allocation during tool-allowlist classification and prevents bundled conversation parsing from overriding a loaded plugin that omits messaging hooks. Merge readiness✅ Ready for maintainer review The PR remains useful: current main retains both the redundant allowlist preparation and the incorrect fallback condition. No actionable introduced defect was found; the related merged PR addresses a different problem. Priority: P3 Review scores
Verification
How this fits togetherAgent tool policies turn configured permissions and plugin declarations into available tools and diagnostics. Separately, channel conversation parsing turns session keys into thread and parent identities used by session lookup and model overrides. flowchart TD
A[Policies and plugin declarations] --> B[Allowlist classification]
B --> C[Layered tool filtering]
C --> D[Available tools and warnings]
E[Channel session key] --> F{Loaded plugin present}
F -->|Yes| G[Plugin hook or generic parsing]
F -->|No| H[Bundled fallback or generic parsing]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -12, Tests +71. Total +59 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep classification allocation-light and preserve loaded-plugin grammar ownership while retaining existing filtering, diagnostics and pre-bootstrap fallback behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: a loaded plugin without messaging hooks can still invoke bundled topic parsing on main and select the wrong parent. The added regression fixture isolates that condition; this review did not execute it. Is this the best way to solve the issue? Yes. Direct Set population preserves classification semantics, and checking loaded-plugin presence repairs the documented fallback boundary without adding configuration or a parallel API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1d9ce1ac9ffa. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…rf-sep05-allowlist-refresh
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
@clawsweeper re-review The refreshed seven-file head includes the current-main composition, full mapped build, 123 owner/sibling cases, 347 caller cases, all 32 changed checks, and a newly audited 6,560-call pipeline cohort. The two-file conversation repair has its own pre-fix regression; it is not claimed to explain the historical CI timeout. All current and historical performance qualifications remain in the body. GitHub's normal branch update refreshed stale base metadata. Head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: (302 commits) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) test(qa): make cleanup child logging deterministic (#139566) test(cli): keep Unix socket fixtures within path limits (#139565) fix: avoid slow incognito key checks in large session stores (#139528) feat(macos): open Gateway windows from the Gateways menu (#139522) test(workshop): isolate marker casing fixture identities (#139554) fix(process): require cleanup evidence before releasing owned work (#139517) ... # Conflicts: # scripts/release-check.ts
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) ...
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) ...
…#138392) * perf(agents): classify allowlists without intermediate sets * perf(agents): simplify allowlist preparation and session fallback ownership
What Problem This Solves
Tool availability checks add avoidable work to agent turns with layered allowlists. Separately, a loaded channel plugin without messaging hooks can receive fallback grammar and resolve the wrong parent session.
Why This Change Was Made
Populate the final classification Sets directly, remove the redundant policy round-trip through classification, and convert already-unique declaration Sets into fresh arrays. Each layer still reads current declarations, preserving callback-driven changes, iterator order, warning deduplication, frozen policies, matching and tool identity. No new cache, configuration, dependency or persistent state is introduced.
The separate conversation repair makes loaded-plugin presence the ownership boundary for bundled fallback, including when the plugin omits
messaging. Production changes total −12 lines; tests total +71.User Impact
Operators retain the same allow/deny decisions and diagnostics with less duplicate preparation. Loaded channel plugins retain ownership of conversation parsing. The measured benefit varies by workload; this does not establish a general Gateway/model-turn, startup, memory or tail-latency improvement.
Evidence
Current candidate validation: 123 owner/sibling cases, 347 caller cases, a full mapped build, 32 changed-check stages, and two managed review passes without actionable findings. The previously failing threaded-session model-override case passes in the current caller group.
Fresh measurement uses base 13e1b10 with the same conversation repair in both variants. Four fresh B0/C0/C1/B1 hosts execute the complete
applyToolPolicyPipeline: 6,560 calls, including eight callback/iterator/error controls, and 384 batch means. All returned tool values and warnings are retained, with input-identity checks; return references are checked again after later calls. The common batch loop includes indexed reference retention; snapshotting and durable writes occur outside its timer. Batch-end snapshots do not claim to capture transient mutations later undone.Observed median batch-mean changes:
All 20 adverse comparisons are retained below. “Warm” is the warm-call median; “maximum” is the largest of 16 batch means, not a population-tail estimate.
There was no numerical pass threshold or favorable rerun. Host measurements include imports, capture, logging and controls. Declaration production is covered functionally, not separately timed. Independent numerical audit verified every return/control record and all 60 comparisons, including all 20 adverse results. Refreshed exact-head CI remains the landing requirement.
Earlier cbaa21e tests/measurements remain historical and are not reused as current-head proof. Historical Linux R1 had an incomplete RSS census; Linux R2 lacked cgroup preflight. Current macOS/Vitest 5 success neither establishes historical timeout causation nor substitutes for that missing Linux evidence.