Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 8:24 PM ET / August 24, 2026, 00:24 UTC. ClawSweeper reviewWhat this changesThis PR replaces broad lowercased subagent session-key matching with canonical store-key lookup and adds Matrix, Signal, and structural-key regression coverage. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open. PR close coverage proof kept this PR open against #127279: model PR close coverage proof was incomplete: PR B directly carries PR A's concrete bug fix and invariant into the merged canonical implementation; no material source behavior remains independently reviewable on PR A. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherSubagent reconciliation reads persisted child-session records to decide whether a parent agent receives a completion outcome. Session-key normalization must preserve opaque peer identifiers while normalizing structural routing segments. flowchart LR
Child[Child session key] --> Reconcile[Subagent reconciliation]
Store[Persisted session entries] --> Reconcile
Reconcile --> Normalize[Canonical key normalization]
Normalize --> Match[Matched child entry]
Match --> Outcome[Parent completion outcome]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -9, Tests +60. Total +51 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep this PR open until a linked canonical PR proves it covers this PR's unique work, or a maintainer confirms closure. Do we have a high-confidence way to reproduce the issue? Yes, source reproduction is high-confidence: current-main regression cases construct Matrix and Signal keys that differ only in opaque-peer casing and assert no completion is inferred. Is this the best way to solve the issue? Yes. The merged replacement uses the shared session-key normalizer at the lookup owner, preserving structural normalization without broad opaque-peer folding; this branch adds no remaining unique solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a3f64c19b673; fix evidence: commit fcc0bb74900b, main fix timestamp 2026-08-22T02:41:42Z. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
atomicdjt
left a comment
There was a problem hiding this comment.
Source-level cross-check against current main (8f59226bc93a): the canonical-normalizer shape in this PR looks preferable to an exact-only lookup for one additional reason beyond the reported Matrix/Signal collision.
registerPluginSubagentRunFromGateway() currently only trim()s the plugin-supplied childSessionKey before persisting the registry row; it does not canonicalize structural segments. Meanwhile the session-store owner canonicalizes keys through the shared session-key normalization path, and listSessionEntriesReadOnly() asserts canonical persisted keys. That means an exact-only reconciliation lookup can create a semantic split: a structurally equivalent key such as an uppercase Agent:MAIN:... variant can name the same canonical stored session but fail only in reconciliation.
Using normalizeStoreSessionKey(sessionKey) after the exact probe avoids that split while still preserving the actual safety property here: Matrix room tails and Signal group IDs remain opaque/case-sensitive because the shared normalizer explicitly preserves those spans. So the desired contract is not “all bytes exact”; it is canonical structural identity + exact opaque peer identity.
The current tests already exercise the three important points well:
- structural casing still resolves;
- Matrix case-distinct peers do not resolve each other;
- Signal case-distinct peers do not resolve each other.
If you want one final regression lock before merge, I would add/retain a parity assertion that the reconciliation cache path uses the same canonical identity as the session-store owner, while never invoking the folded legacy-alias fallback. Not a blocker given the production-path artifacts already in the PR, but it would document why the normalizer is intentional rather than merely a smaller lowercase scan.
Nice repair shape overall: it removes the unsafe global case-fold scan without throwing away the repository's existing canonical-key contract.
|
Thanks @atomicdjt for the careful cross-check. I agree with the framing: the invariant here is canonical structural identity plus exact opaque peer identity, not byte-exact lookup. The current structural, Matrix, and Signal regressions are intended to lock that boundary, and reconciliation stays on the shared canonical normalizer without reviving the folded legacy-alias scan. I appreciate the parity-test suggestion as a useful non-blocking follow-up. |
Closes #122047
Thanks to @yunligou711-commits for the report.
What Problem This Solves
Fixes an issue where users running subagents with case-sensitive Matrix room or Signal group identifiers could have reconciliation infer completion from a different case-colliding sibling session.
Why This Change Was Made
Reconciliation now performs the exact lookup first and then uses the existing canonical store-key normalizer. This keeps structural session-key segments case-insensitive while preserving opaque peer identifiers, without introducing a legacy alias or delivery-metadata fallback.
User Impact
Subagent completion is now attributed only to the intended session when opaque peer identifiers differ by case. Existing session keys that differ only in structural segment casing continue to reconcile normally.
Evidence
Current exact-head production-path SQLite sweeper proof on Node 24.18.0:
openclaw-subagent-session-7f92e90240e4c7c2d912c4f62838452a530de6e0(ID9120559242)sha256:8706849853d49e496a329c4088995a0a50f203b2a4a919790d62c7306dc2426f944e9236f5d8ec50d7eaedbbd445d0a587c11ad305107d55d2c52171849acfd27f2a5fb040b148957f92e90240e4c7c2d912c4f62838452a530de6e0b43922afcf8f0956aafcd94395410307a07bf86aThe downloaded artifact records these machine verdicts through production agent-session SQLite accessors, shared registry SQLite persistence/reload, and the production sweeper:
sweeper-lost-context/error, with no false completion.sweeper-lost-context/error, with no false completion.sweeper-session-completion/ok.Immutable parent-red evidence remains in the earlier run:
911309224493f686f68124ffa256f773822ea299cffdefee72That artifact used the same production-path harness to show Matrix and Signal case-colliding peers incorrectly producing
sweeper-session-completion/okbefore the repair. It also recorded the repaired owner source at the previous PR head; the current-head artifact above supersedes that after-fix half.Current-head focused verification on Node 24.15.0:
The changed gate covered max-lines, SDK/API and boundary guards, dead-code checks, production and test tsgo, lint, database-first/sidecar guards, import cycles, and auth/guard checks. Crabbox had no ready provider, so the trusted-source wrapper used its documented local fallback.
Scope and risk: