Repository navigation
fix(sessions): prevent participant misattribution in Activity - #130986
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 8:47 AM ET / 12:47 UTC. ClawSweeper reviewWhat this changesRepairs session participant attribution by storing a closed identity namespace alongside each participant ID, preventing Activity from conflating IDs originating from different identity sources. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open for maintainer review: current main still conflates participant identities with matching raw IDs, and the proposed persistence-owner repair is source-supported, but its schema-18 upgrade and deliberate older-reader refusal require explicit acceptance. Priority: P1 Review scores
Verification
How this fits togetherMessage ingress prepares a participant identity, then the session store records it in the agent SQLite database. Gateway projections read that state for Activity, session people, and owner views. flowchart LR
A[Message ingress] --> B[Participant identity]
B --> C[Session SQLite state]
C --> D[Gateway session projection]
D --> E[Activity and owner views]
Decision needed
Why: This is a material per-agent SQLite contract change whose upgrade and downgrade semantics require maintainer intent. Before merge
Agent review detailsSecurityNone. 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: Accept the canonical namespaced-identity migration only after maintainers explicitly accept its durable-data and downgrade contract. Do we have a high-confidence way to reproduce the issue? Yes—current main’s raw actor-type/ID lookup and the candidate’s namespace-keyed replacement establish a high-confidence source reproduction, although this read-only review did not execute it. Is this the best way to solve the issue? Yes—the persistence owner is the correct fix location because it prevents identity collisions before all downstream session projections consume the record. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 468054f93c43. LabelsLabel 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
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
a924004 to
7f5dd2f
Compare
7f5dd2f to
089599a
Compare
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
Updated the repair to The final source passed 1,333 focused tests (one existing skip), 23 native Swift tests and iOS-target protocol compilation, the complete changed gate, aggregate protocol/schema/SDK/native/docs checks, full build, and the original built-CLI lifecycle. Fresh isolated Codex review covered the complete patch with no blocking findings. The PR body now contains the final source/artifact identities, inspected final-candidate captures/video, and a JSON live verdict. The final real Gateway/Chromium replay verified namespace/time isolation, Activity beyond the avatar preview, exact same-run accepted steering, read-only visibility filtering, and a genuine OpenAI turn. Actual old-reader/backup/stopped-writer/migration/reopen proof passed. Actual Doctor exits were 0 for offline migration and 1 for held-writer and unregistered unknown-index refusals. The schema-18 upgrade safeguards and the separate global rollback limitation remain explicit. Exact-head CI and native prepare/merge are still required; this is not a merge claim. The latest rank-up request is addressed by the retained exact-source upgrade matrix and will be reconfirmed after CI before landing. The lead has a usable main-relative comparison and verified that the initial repair tree exactly matched CI's synthetic merge, covering the prior review checkout's promisor/merge-base gap. @clawsweeper re-review — the Swift generator and direct-dispatch repairs change behavior beyond the prior reviewed head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Discover the current declaration source graph in a joined child before normal eager emission, and track its complete source-bearing cache inputs. Repair shared jsdom focus teardown and native worker fixture request ordering without changing UI focus ownership or execution fallback policy.
263cb2b to
c348a86
Compare
|
Merged via squash.
|
…aw#130986) * fix(sessions): preserve participant identity and input provenance Keep profile, agent, remote, observed, and legacy identities distinct in the existing participant table. Record accepted input at admission, including steering, instead of inferring a person from the session creator. Preserve historical membership and counts while leaving ambiguous profile timestamps unknown through stopped-writer Doctor migration. Project full visibility-filtered person membership before preview limits so Activity does not misattribute channel identities or omit people outside the facepile. Keep participant membership separate from authorization and expose raw-selector ambiguity to memory operators. Repair Doctor readiness reporting, generic Swift inline-union generation, direct-dispatch metadata handling, and fixture-owned database lifetimes. Verify namespace collisions, real provider input, accepted steering, visibility, backup/migration/reopen boundaries, native decoding, and the built-CLI lifecycle. Fixes openclaw#130661 * fix(macos): isolate readiness and discovery lifecycles Keep readiness fixtures private for their entire lifetime and give health readiness one deadline owner. Start and cancel slow host discovery with active discovery, not model construction. Make native protocol, callback, onboarding, and process-cleanup tests observe their intended lifecycle phases without expanding deadlines or weakening assertions. Correct the documented signing default. Validated with 1,839 parallel native tests, the release product build, causal negative controls, pinned Swift lint/format checks, and fresh isolated autoreview. Native production delta: -5 lines. * docs(macos): clarify app profile isolation boundaries * build(protocol): refresh generated Swift install models * fix(protocol): preserve optional literal field presence * fix(ci): bound SDK declarations and isolate test lifecycles Discover the current declaration source graph in a joined child before normal eager emission, and track its complete source-bearing cache inputs. Repair shared jsdom focus teardown and native worker fixture request ordering without changing UI focus ownership or execution fallback policy. * test(sessions): prove Goal participant upgrade boundaries
Closes #130661 — participant identity collisions and incorrect Activity history.
What Problem This Solves
A channel sender and an authenticated Gateway profile could share a raw ID and be merged into one participant. A later channel input then advanced the profile's timestamp even when its count was protected. Activity also inferred personal history from a four-avatar preview: unrelated channel senders appeared as people, while genuine contributors beyond the preview disappeared. Accepted steering could persist a user turn without recording its contribution.
Why This Change Was Made
The existing session-owned aggregate now keys by session, closed identity namespace, and actor ID. Profile, agent, plugin-qualified remote, unresolved observation, and legacy identities remain distinct. Admission/native-ingress owners capture accepted input identity and time; context copies consume that fact once after final targeting. Creator metadata is not fresh human input. Native product participation is separate from optional execution-audit collection, with one registered host-lifecycle owner.
Gateway projection resolves complete visible person associations before pagination and preview limits. Activity uses server-owned person filters, follows merged profiles, and describes associated sessions—not personal “last active” inferred from session recency. Post-commit events invalidate the relevant projections without publishing rolled-back state. Memory retains its documented raw-ID/whole-session selector and reports namespace ambiguity; Git credit remains consent- and verified-account-gated.
Removed paths include source promotion, creation-derived participation, duplicate projection policy, preview-derived person history, and stale fixture assumptions. No companion participant table, input ledger, transcript backfill, participant shadow state, new configuration option, or authorization widening is added.
User Impact
Maintainer-accepted upgrade boundary: the original task discussion accepted this existing-table repair before the explicit implementation/live-test/landing request, including the stopped-writer and backup-based downgrade requirements below. Agent schema 18 rebuilds the existing participant table. Preserve a verified WAL-aware backup, stop Gateway/agent-database writers, and run the new build's
openclaw doctor --fix. Membership and recorded counts survive; ambiguous historical profile times become unknown. A subsequent accepted input establishes a known last time without inventing a first-ever time. Older binaries deliberately refuse the upgraded database; downgrade requires the pre-migration backup. Shared schema remains 13, Gateway protocol 4.Doctor uses the physical shared-store owner rather than a logical agent alias, and refuses unsupported dependents without moving the original database aside. Required repair failures exit nonzero. Existing Goal state and receipts survive; main's already-landed lazy Goal table may be created empty during ordinary schema convergence, without another schema bump.
This does not redesign creator-based authorization, qualify historical per-message sender metadata, or implement the separate online-people-card work. Browser transcript snapshots do not contain the changed participant DTO. Source rollback is not database rollback.
Evidence
Published/tested head:
c348a862fb47ca4029e21a7efa0a415f7950c100, baseca5930502984cce275bcb41a02d9d7d999da799d. Exact-head CI run 33170972534 completed successfully (attempt 1). The native pipeline merged this candidate as b03d2e79e9aa. The current-main merge preflight passed. Fresh independent review covered the complete patch in three bounded passes, with no blocking findings.The complete cold build passed all 15 phases in 6m 8s. Fresh scoped SDK declarations passed at the default Node 24 heap in 52.7s; the actual export/type/runtime gate verified 147 public subpaths. Startup JavaScript is 345,367 B gzip, below the unchanged 347,037 B enforcement limit. No ineffective dynamic-import warnings. Frozen artifact: 15,182 entries, SHA256
f16476be20c2ec943fb0942d38cd7f75c8773f52e169091725b66a3cab07b327; the migration and live replay used this same artifact.includePeople/involvingProfileIdrequests included Bob's crowded session although Bob was beyond the four-avatar preview; Alice's two channel-only associations were excluded.operator.readclient could not see Alice's draft; people counts excluded it too.gpt-5.6-lunareply; one authenticated profile contribution.All live surfaces were session-owned isolated Gateways/Chromium with synthetic Alice/Bob profiles. QA-channel transport and a deterministic provider drove collision/steering; the separate genuine-provider and required-child legs used OpenAI. No operator Gateway or real channel account was modified. Every attached image and video contact sheet was inspected. Historical channel sender labels are not reinterpreted by this migration.
Before / current-head captures
The before captures use frozen pre-fix main
8c1a55d446273da83418c2b595d2fa12712bd855, not a claimed stable-release reproduction. Its source/entrypoints were frozen but dependencies remained linked to the development installation. Current after captures are fromc348a862fb47ca4029e21a7efa0a415f7950c100.Required child attributed to its creator, alongside real Project grouping:
New accepted input in the upgraded historical session:
The attached short videos show accepted same-client steering and the separate genuine-provider input/reply.
Focused validation and CI repairs
Doctor integration passed 215 selected tests. Goal/participant integration passed 269 tests, followed by 32 composed Goal, historical-store, and declaration tests, owning typechecks/lint/format, and protocol checks. The new native-ingress composition passed separately. Earlier complete changed gates and owner regressions remain recorded in the progress thread; they are not relabeled as current-head runs.
Exact local commands included:
Earlier CI exposed real adjacent defects that are repaired here: optional Swift literals now preserve omission; native readiness/discovery fixtures own their lifecycle; the IPC shell fixture responds causally after invocation; shared jsdom cleanup clears detached shadow focus; SDK declaration discovery exits before a single complete emitter program starts. Proof retained the original timeouts, heap budgets, assertions, dependency versions, and parallel execution contracts. The focus regression failed before repair; the original 254-file selection passed 3,922 tests afterward. Native worker/pipe suites passed 28 tests. The SDK failed-before diagnostics include one disclosed accidentally overwritten baseline stderr file; the independent complete baseline and successful fresh-build receipts remain intact.
Size excluding inherited main: runtime +2,677/−1,615 (net +1,062); tooling +140/−23; tests/support +4,691/−1,490; generated +2,507/−265; docs +63/−4; metadata +2/−3. Moves cancel in net. Runtime growth establishes closed identity/ingress ownership, honest versioned migration and stopped-writer maintenance, committed publication, and complete visibility-filtered person projection. Tooling growth isolates compiler lifetime and preserves generic wire-literal presence. This is not a net-neutral patch.
Limitations and follow-through
Signed-native-app UI proof remains infeasible: startup invokes host-global PortGuardian cleanup even in named profiles; available remote/direct rigs bypass the relevant process manager, and no approved pristine native environment was available. Native integration tests/product compilation are not represented as signed-app UI proof. No operator ledger, service, Keychain, unrelated VM, or sandbox boundary was changed to manufacture proof.
The lead personally inspected pinned Codex
90854393966b21e9ebfd21b122334eb09a20c93d:codex-rs/app-server/src/message_processor.rs:840–911,1288–1342, protocolv1.rs:27–79,v2/thread.rs:1362–1428,1514–1524,1681–1710, and the complete stdio transport. Codex plugin/native app-server production code is unchanged; synthetic peers are not live Codex proof. Slack/Teams/Discord qualification has owner tests, not live external-account transport proof.Named separate follow-ups retain creator-role namespace cleanup, historical transcript sender provenance, shared-schema rollback admission, duplicate optimistic queued-message bubbles, and macOS canonical workspace alias rejection. The latter was observed in unchanged main-owned containment code; using the configured path spelling proved grouping without removing sandbox checks. The duplicate bubble remains UI-only: one persisted user event and participant contribution were verified.
ClawSweeper's current-head proof, description, and explicit migration-acceptance requests are addressed above. Exact-head CI is green; native review/prepare/merge completed without further source changes. The review checkout's missing parent does not reflect this branch: its real parent is
c8ef48affeaa23a0db1eb02484d95eabf37959bb, with the complete seven-commit introduced delta measured against the base stated above. The original collision came from three-layer session ownership, authored and merged by @steipete; this repair is also authored by @steipete. AI-assisted implementation with independent Codex review. No release publication is included.accepted-steering.mp4
genuine-provider.mp4