Skip to content

refactor(feishu): remove thread-binding test reset - #124276

Merged
steipete merged 1 commit into
mainfrom
test/remove-feishu-binding-reset
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
test/remove-feishu-binding-reset

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.resetFeishuThreadBindingsForTests object 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

  • Feishu owner suites and registry-backed session-binding contract — 24 passed
  • 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 green
  • pnpm build — passed
  • git diff --check — passed
  • Structured autoreview — clean

Production 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.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: S maintainer Maintainer-authored PR labels Aug 15, 2026
@steipete
steipete marked this pull request as ready for review August 15, 2026 20:29
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 4:35 PM ET / 20:35 UTC.

ClawSweeper review

What this changes

The PR removes Feishu’s aggregate test-reset export and makes tests and the shared channel contract stop the manager instance they create.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No 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
Reviewed head: fbe1acb3f3946c3d92beab61d72579622820af6c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, well-scoped cleanup that matches the established manager lifecycle and preserves contract coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal test refactor does not require external real-behavior proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal test refactor does not require external real-behavior proof.
Evidence reviewed 5 items Current-main-only facade: Current main still exports an aggregate reset that stops every manager and clears global maps, so this cleanup is not already implemented.
Owner lifecycle: A manager is cached per account; stop removes that account’s bindings, unregisters its adapter, and removes the manager from the registry.
Production caller: The Feishu account monitor creates the manager before dispatch and stops it in its outer finally block, confirming that manager-owned cleanup is the runtime boundary.
Findings None None.
Security None None.

How this fits together

Feishu 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]
Loading

Before merge

  • Complete next step (P2) - This protected maintainer-authored PR remains a normal review item; no separate repair lane is needed.
Agent review details

Security

None.

PR surface

Source -8, Tests +16. Total +8 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 10 18 -8
Tests 2 29 13 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 39 31 +8

Review metrics

Metric Value Why it matters
Production versus test delta production -11; tests +16; test support +3 The patch deletes the production test facade and adds explicit fixture ownership without changing runtime behavior.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a maintainer-authored internal test-lifecycle cleanup with no user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal test refactor does not require external real-behavior proof.

Label justifications:

  • P3: This is a maintainer-authored internal test-lifecycle cleanup with no user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal test refactor does not require external real-behavior proof.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the manager factory and cleanup lifecycle to commit f916e69; the same contributor authored this focused cleanup. (role: feature owner and recent area contributor; confidence: high; commits: f916e690c00f, fbe1acb3f394; files: extensions/feishu/src/thread-bindings.ts, extensions/feishu/src/monitor.account.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for fbe1acb3f3946c3d92beab61d72579622820af6c:

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.

@steipete
steipete merged commit 37763e4 into main Aug 15, 2026
255 checks passed
@steipete
steipete deleted the test/remove-feishu-binding-reset branch August 15, 2026 20:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant