Repository navigation
fix: keep main session aware of isolated groups - #125667
Conversation
Keep ambient main-session group notices working when direct messages use an isolated dmScope, while preserving explicit session watches and routed group topology.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 18, 2026, 2:48 AM ET / 06:48 UTC. ClawSweeper reviewWhat this changesThe PR makes ambient watches for per-group sessions independent of direct-message scope, updates cursor tests, and documents the corrected session-scope behavior. Merge readinessKeep open: removing the direct-message-scope gate fixes the default route, but a configured Priority: P1 Review scores
Verification
How this fits togetherInbound group messages route either to the agent’s main session or to a separate group session. Separate group sessions seed an ambient cursor so later main-session prompts can name their activity and let the agent inspect it. flowchart LR
A[Incoming group message] --> B[Session routing]
B --> C{Group scope}
C -->|main| D[Configured main session]
C -->|per-group| E[Isolated group session]
E --> F[Ambient watch cursor]
F --> G[Watched Sessions prompt]
D --> G
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -22, Tests -17, Docs +2. Total -37 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make watched-session prompt eligibility derive the same configured main key as routing and cursor registration, then cover a custom-main-key isolated-group turn through prompt rendering. Do we have a high-confidence way to reproduce the issue? Yes—source reproducible: configure Is this the best way to solve the issue? No—the producer-side removal of the Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1cf7ec90d081. 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
|
|
Land-ready proof for exact head
ClawSweeper move reviewed and skipped with runtime evidence: Proof gap: no live provider or channel run was used. The deterministic SQLite cursor owner, |
|
Merged via squash.
|
Keep ambient main-session group notices working when direct messages use an isolated dmScope, while preserving explicit session watches and routed group topology.
What Problem This Solves
Fixes an issue where deployments using isolated DMs (
session.dmScope: "per-channel-peer") together with per-group sessions could leave the main session with zero ambient group visibility. Operators then had to serialize group conversations into main to keep the primary agent aware of room activity.Why This Change Was Made
Routed group topology and
session.groupScopeown whether a group is a distinct watch target;session.dmScopeis orthogonal. A distinct group key is now registered as an ambient target, while agroupScope: "main"route already equals the main watcher and needs no cursor. The obsolete DM-scope revocation path was removed, explicit watches remain promoted and preserved, and no new configuration or migration is introduced.User Impact
Multi-user front doors can isolate DMs and groups while the main session still receives compact group notices and the Watched Sessions prompt section. Existing provenance rows keep their meaning, and missing ambient rows seed on future human group turns.
Evidence
dmScope: "per-channel-peer"plusgroupScope: "per-group"; the repairedinitSessionStateboundary registers the isolated group.node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts src/sessions/session-state-events.test.ts src/agents/watched-sessions-prompt.test.ts src/config/schema.help.quality.test.ts— 225 passed.pnpm docs:check-mdx— passed for 776 files.oxfmt --check,git diff --check, and the actualnode scripts/check-changed.mjsselected gate passed; dry-run lanes werecore,coreTests, anddocs.overall 0.96).+5/-27(net-22); tests+41/-58(net-17); docs+11/-9(net+2); total+57/-94(net-37).initSessionStaterouting boundary, and prompt projection are covered directly.AI-assisted with Codex. I understand and reviewed the resulting code and behavior.