Repository navigation
refactor(feishu): remove thread-binding test reset - #124276
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 4:35 PM ET / 20:35 UTC. ClawSweeper reviewWhat this changesThe PR removes Feishu’s aggregate test-reset export and makes tests and the shared channel contract stop the manager instance they create. Merge readinessNo blocking findings. Current main still contains the test-only reset facade, while the PR replaces it with the existing manager-owned cleanup; protected maintainer handling means this PR should remain open. Priority: P3 Review scores
Verification
How this fits togetherFeishu thread-binding managers register a Feishu adapter with the shared session-binding service, which maps conversations to session destinations. The Feishu monitor and tests create managers, and stopping one removes that account’s bindings and adapter. flowchart LR
A[Feishu monitor or test] --> B[Create account manager]
B --> C[Register session adapter]
C --> D[Bind Feishu conversation]
D --> E[Stop manager]
E --> F[Unregister adapter]
E --> G[Clear account bindings]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -8, Tests +16. Total +8 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one manager-owned cleanup path: every fixture that creates a Feishu manager retains and stops that instance, with the global reset facade removed. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors test lifecycle ownership rather than correcting a user-facing failure. Is this the best way to solve the issue? Yes: stopping the instance a fixture created follows the production lifecycle owner, whereas retaining a global reset preserves a test-only production facade. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 715e32448e2d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for
Production delta: -11. Tests/test support: +19 for explicit manager ownership across three test owners. No behavior, docs, changelog, schema, protocol, migration, or operator-state change. |
|
Merged via squash.
|
What Problem This Solves
Feishu thread-binding tests and the shared channel contract depended on an aggregate reset export that stopped every manager and cleared global maps. The real manager
stop()already owns account-scoped binding and adapter cleanup, so the reset was a test-only production facade.Why This Change Was Made
Tests now retain and stop the Feishu managers they create. The registry-backed contract tracks its Feishu manager just like Discord, Matrix, and Telegram. The aggregate
testing.resetFeishuThreadBindingsForTestsobject and its contract-sidecar export are deleted.This PR is AI-assisted as part of the maintainer-requested repository test-value audit.
User Impact
No user-visible behavior changes. Feishu lifecycle coverage now exercises manager-owned cleanup instead of a global test reset.
Evidence
node scripts/check-changed.mjs -- <changed files>— passed via the documented local fallback; core/extension typechecks, lint, dead exports, sidecar boundaries, import cycles, and guards were greenpnpm build— passedgit diff --check— passedProduction delta: -11 net lines. Test/test-support delta: +19 net lines; the support growth makes created-manager ownership explicit across the three test owners. No docs, changelog, schema, protocol, migration, or operator-state change is required.