Repository navigation
Conversation
5c0771a to
550ddc1
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 2:08 AM ET / 06:08 UTC. ClawSweeper reviewWhat this changesThis PR replaces repeated direct session visibility checks with one access decision that carries resolved ownership facts and distinguishes transient, credential, unknown, and genuine policy-denial outcomes. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open. The centralized per-target access path appears to correctly preserve deterministic denials while returning actionable lookup-failure outcomes; no discrete patch defect was established. Its broad session-authorization scope warrants owner review before merge. Priority: P1 Review scores
Verification
How this fits togetherSession tools resolve a requested session through the Gateway, apply shared visibility and agent-to-agent policy, then read, search, send to, or mutate that session. The change makes the access decision carry exact ownership facts to those downstream operations. flowchart LR
A[Session tool request] --> B[Gateway session resolution]
B --> C[Resolved owner facts]
C --> D[Shared session access decision]
D --> E[History send search status]
D --> F[Policy denial]
D --> G[Actionable lookup failure]
Decision needed
Why: The code changes authorization and incognito handling across multiple session operations, so maintainers must accept the boundary and its proportionate production growth. Before merge
Agent review detailsSecurityNone. PR surfaceSource +549, Tests +864. Total +1413 across 22 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one prepared-facts access owner rather than recreating Gateway lookup and policy logic in each tool; no net-neutral alternative was found without reintroducing duplicated authorization policy. Do we have a high-confidence way to reproduce the issue? Yes for the source path: the prior direct guard converted failed ownership lookup into an ordinary tree denial, and the supplied context includes a redacted real-Gateway after-fix trace for history and sandboxed send. Is this the best way to solve the issue? Yes. Resolving exact ownership once and passing prepared facts into direct tool access is more maintainable than each tool depending on a capped listing or independently classifying Gateway failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d94c755eb7a7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (45 earlier review cycles; latest 8 shown)
|
550ddc1 to
78a2024
Compare
78a2024 to
11cfbc4
Compare
0c80488 to
095392d
Compare
095392d to
926e49b
Compare
|
@clawsweeper re-review Addressed the two P1 redaction findings (warn paths now route through |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
926e49b to
0633da1
Compare
Make spawned-session ownership lookup failures observable and distinguishable from genuine tree-visibility policy denials, with retryability classification so permanent credential/configuration failures are not mis-framed as transient. Addresses issue openclaw#114653. Diagnostic layer only — does not add retry (maintainer product decision) and does not address the recency-window denial path (openclaw#114180). Core changes: - session-visibility-internal: add a core-private three-state lookup result (ok / failed with retryable flag) plus classifyLookupRetryable (transport closes/timeouts and retryable request errors => retryable; credential/auth/ unknown => non-retryable) and a shared lookupFailedDenialSuffix. - session-visibility guard: pick the denial text by retryability so transient failures say "retry" and permanent failures say "check gateway configuration and credentials"; both still fail closed. Preserves the shipped public SessionAccessResult, Set<string> checker input, and test-hook contracts. - sessions-resolution sandbox resolver: propagate the same retryability- classified denial; pass allowMissing: true on the speculative sessions.resolve probe and suppress the warn for the expected "No session found" miss so ordinary non-owned targets do not log as operational lookup failures (reuses callGatewayResolveSession for older-gateway compatibility). - Tests: transient + permanent error coverage for both guard and sandbox resolver paths; classification contract locks; non-owned-miss quietness regression; redaction through formatErrorMessage.
…tion oxlint typescript(no-unnecessary-type-conversion) flagged the redundant Boolean() wrapper around String.includes() which already returns boolean. Use ?? false to preserve the undefined->false semantics from the optional chain.
A failed spawned-session ownership lookup override was relabeling the row checker's deterministic cross-agent policy denial as a retryable lookup failure. Retrying the spawned ownership lookup cannot make a known agent:other:* target eligible, so the cross-visibility refusal must be preserved as-is. Constrain the lookup-failure override to same-agent targets by mirroring the row checker's agent resolution: when the target resolves to a different agent than the requester, keep the original cross-agent denial rather than overriding it. Add regression coverage for the cross-agent case under a failed tree-visibility lookup. ClawSweeper review P2: preserve cross-agent policy denials on lookup failure.
Replace the `!!id` coercions in `isCrossAgentTarget` with an explicit empty-check so the return value reads as a plain inequality. The `no-implicit-coercion` lint rule flags `!!` on already-resolved strings; both ids are guaranteed non-empty by the resolve-or-return-false guards above, so the explicit form is equivalent.
|
@clawsweeper re-review Rebased onto current main and updated to exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Maintainer cleanup — 2026-08-13
Rebased onto
mainat2dffeae1269; current head isbe9eb717f5c. Contributor authorship and commit order are preserved. This cleanup does not merge the PR.What Problem This Solves
Direct session tools previously collapsed operational ownership-lookup failures into policy denials. They could also discard exact ownership already established by
sessions.resolveand authorize against a cappedsessions.listwindow instead.The canonical access path now carries typed
transient/credentials/unknownfailures plus explicit session-owner and requester-ownership facts through history, send, search, status, and mutation checks. Confirmed misses remain ordinary not-found outcomes.Maintainer review also repaired three connected authorization gaps:
session_statuscannot bypass the shared incognito guard;sessions_searchrevalidates the granted session incarnation before reading it.Architecture and compatibility
resolveSessionToolAccessis the single direct-target authorization owner; tool consumers carry its prepared facts forward.sessions.resolvesupport retains the existingsessions.listfallback only for ownership-dependent candidates.ClawSweeper feedback
--use-envcontract is now covered byextensions/slack/src/channel-actions-setup-status.contract.test.tswithout restoring heavyweight bundled-runtime loading in the command test.LOC review metric
+856/-307(+549net).+1134/-270(+864net).+1990/-577(+1413net).This is large for a bug fix. The remaining production growth is concentrated in the typed lookup-result contract, explicit multi-agent owner propagation, one canonical direct-access helper, and the status/search integrations that consume those prepared facts. Duplicate resolver-level ownership policy was removed. Reducing it further would either drop the operational-failure distinction or recreate authorization policy in individual tools.
Evidence
pnpm check:changed: every PR-owned gate passed, including conflict/config ratchets, formatting, dead code, SDK API/surface/boundary checks, all four core/extension typecheck lanes, and changed-core lint. The final full-extension lint was blocked by an unrelated current-mainmax-lines failure inextensions/discord/src/send.creates-thread.test.ts; this branch does not modify that file. Run 31671439673, Testboxtbx_01kzwtffjwzhswvcrmxrtt706w.Regression coverage
Related: #114653, #114180.