Repository navigation
fix(agents): preserve opaque session key casing - #127279
Conversation
Use the canonical store-key normalizer when subagent reconciliation falls back from an exact lookup. Co-authored-by: Alix-007 <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 1:49 PM ET / 17:49 UTC. ClawSweeper reviewWhat this changesThis PR makes subagent reconciliation use canonical session-key normalization instead of lowercasing whole keys, with Matrix, Signal, and structural-key regression coverage. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. The patch replaces the unsafe fallback with the established session-key canonicalizer and preserves structural matching while rejecting case-distinct Matrix and Signal peers; current main still has the unsafe whole-key lowercase scan. The PR is correct, has meaningful after-fix evidence, and needs normal maintainer handling because it is behind main and labeled Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherSubagent reconciliation reads persisted session records when registry state arrives late and turns a terminal child session into a parent-run outcome. The lookup must normalize structural key segments without collapsing opaque channel peer identifiers. flowchart LR
A[Child session key] --> B[Subagent reconciliation]
B --> C[Exact session-store lookup]
C --> D[Canonical key lookup]
D --> E{Matching persisted session}
E --> F[Terminal child outcome]
E --> G[Missing child session]
F --> H[Parent run reporting]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource -13, Tests +60. Total +47 across 2 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. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused canonical lookup after refreshing it against current main, keeping the Matrix, Signal, and structural-key owner-boundary tests. Do we have a high-confidence way to reproduce the issue? Yes. Current main's whole-key lowercase loop can match a terminal lowercased sibling for a mixed-case Matrix or Signal child; the PR supplies the corresponding focused cache-backed reproduction, though this review did not execute it. Is this the best way to solve the issue? Yes. Reusing the session store's canonical normalizer at the reconciliation owner preserves its established opaque-peer contract and removes the duplicate O(N) comparison policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 43c54af3ea90. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Rank-up move disposition: skip the optional current-main refresh. The PR is mergeable without conflicts, exact-head |
Use canonical session-key normalization during subagent reconciliation so case-distinct Matrix and Signal peers cannot be reported as completed. Preserve structural casing reconciliation and remove the O(N) fallback scan. Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: Alix-007 <[email protected]>
Problem
Subagent reconciliation lowercased whole session keys when an exact key was absent. Matrix room IDs and Signal group IDs are opaque and case-sensitive, so a terminal case-distinct sibling could be mistaken for the child run and reported as a successful completion.
Root cause
loadSubagentSessionEntryreimplemented session-key comparison with anObject.entries()lowercase scan instead of using the session store's canonical key normalizer.Fix
Keep the exact fast path, then perform one lookup with
normalizeStoreSessionKey. This preserves structural casing normalization without folding opaque peer IDs, removes the O(N) fallback scan, and adds owner-boundary coverage for Matrix, Signal, and the structural control.Supersedes #122142 and #122141. Based on the root-cause fix and regression coverage contributed by @Alix-007 in #122142; commit credit retained.
Proof
completion/okfor an absent mixed-case child with only the lowercase sibling stored.node scripts/run-vitest.mjs src/agents/subagents/registry: 17 files, 534 tests passed.pnpm tsgo: passed.pnpm check:test-types: passed.missing; Signalmissing; structural controlcompletion.Telegram exact-head drive passed after the local model-review gate. A real QA user sent
Please answer with OPENCLAW_E2E_OK only.in a DM (Bot API message 1750); the SUT emitted two typing events and repliedOPENCLAW_E2E_OK(message 1751). In the same run, production SQLite reconciliation reported Matrixmissing, Signalmissing, and structural casingcompletion; all three scenario assertions passed. One mock-provider request was recorded. Side effects: one user message and one SUT reply; no edits, deletions, or reactions.Maintainer decision
Proceed with the focused canonical lookup repair. A wider session audit is not required for this PR. This task explicitly stops before merge.