Repository navigation
refactor: share channel binding session classification - #190957
Conversation
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR centralizes ordinary-session, ACP, and subagent binding classification for Discord, Telegram, and Matrix. Example: Bind the main alias for agent ops when its session metadata identifies ACP ownership.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored draft open: the extraction consolidates three equivalent classifiers without an actionable introduced defect, and remains stacked on an open prerequisite. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherChannel binding adapters pass target keys, metadata, and current-authority callbacks to the shared binding owner, then their existing managers create native threads and persist binding records. flowchart TD
A[Binding request] --> B[Channel adapter]
B --> C[Shared target classifier]
C --> D[ACP metadata reader]
C --> E[Channel binding manager]
E --> F[Native thread and binding store]
Technical reviewBest possible solution: Keep one classifier in the existing binding adapter owner while preserving channel-owned persistence and final-effect authority checks. Do we have a high-confidence way to reproduce the issue? This is a refactor; source comparison establishes equivalent classification branches, and no target code was executed during this read-only review. Is this the best way to solve the issue? The extraction is appropriately placed in the existing shared owner, removes all three replaced implementations, and introduces no competing state or manager. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e9b3e2aacbb4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -6, Tests +103, Docs +10, Other +1. Total +108 across 11 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 2, 2026, 2:52 AM ET / 07:52 UTC. |
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
|
Merged via squash.
|
* fix(channels): preserve ordinary thread session bindings Co-authored-by: vincentkoc <[email protected]> * refactor: centralize thread binding target classification Co-authored-by: vincentkoc <[email protected]> * refactor(sdk): isolate thread binding classification and fixtures Co-authored-by: vincentkoc <[email protected]> * fix(channels): retain plugin custody for queued inbound turns Co-authored-by: vincentkoc <[email protected]> --------- Co-authored-by: vincentkoc <[email protected]>
What Problem This Solves
Discord, Telegram and Matrix duplicate ordinary-session versus ACP classification. Landing CI also exposed a pre-existing Matrix restart failure: a queued turn could invoke callbacks after its plugin consumer was released.
User Impact
Preserve ordinary-session binding lifecycle, canonical ACP/subagent fast paths, main/global metadata aliases and approved opaque plugin targets without arbitrary agent ownership. Unreadable storage and revoked authority still refuse. Queued inbound turns now retain plugin custody through observation/delivery and settlement, rather than producing a closed-consumer failure.
Why This Change Was Made
One SDK-private classifier behind the existing thread-bindings-session-runtime facade serves all three adapters. The old core implementation/test are removed. Storage stays lazy via the narrow existing reader; managers retain effect authority. Public-operation fixture seams delegate to real classification; private reader policy tests remain SDK-owned. No new public subpath, API/test hook, registry, manager, store, schema, config, dependency or permission policy.
Same-target/public-kind refresh ownership persists without inheritance across child placement, replacement targets or kind changes. Native/action hints are not replayed from stored metadata.
Current head cbf3d3b adds the owning runtime fix to the reviewed classifier baseline e986cb3. Matrix supplies a top-level adoption lifecycle; core selected it instead of the custody-bound resolved-turn lifecycle. Deferral therefore never retained custody. The repair binds custody at that actual selection point while preserving prepared-turn identity and the closed-consumer guard.
Evidence
Queued-ingress lifecycle repair
Classifier baseline e986cb3 — retained source-bound proof
Pinned main d6c8ad3 is an ancestor. Six prerequisite conflicts used exact reviewed/tested bytes after confirming no subsequent main edits to those paths. Incremental baseline14 paths,+455/-173 centralizes responsibility, not an overall LOC reduction.
Landing
The ordinary binding prerequisite is landed. Current-head CI/security/native admission and retained-request replacement recovery are required. No native Discord/Slack or operator Gateway deployment is claimed. Private-QA dist is not a public packaging candidate.