Repository navigation
Conversation
|
Thanks for the context here. I did a careful shell check against current Current main already contains the Feishu test-runtime cache invalidation and regression coverage from the merged canonical fix, so this open branch no longer has unique work to land. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the merged main implementation from #91281 and close this superseded branch rather than resolving its current conflicts. Do we have a high-confidence way to reproduce the issue? No current-main failure remains: the before-fix stale-cache path is source-proven by the linked issue and PR body, and current main now clears the cache in the SDK swap helper with regression coverage. Is this the best way to solve the issue? Yes. Clearing the existing client cache inside the test runtime setter is the narrowest maintainable fix, and current main already implements that shape through the merged replacement PR. Security review: Security review cleared: The PR diff only touches a Feishu test-helper reset path and a colocated Vitest regression, with no dependency, workflow, package, credential, or install-script changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 44e6caff5401; fix evidence: commit 762d8d8e645f, main fix timestamp 2026-06-13T14:01:15Z. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
This comment was marked as spam.
This comment was marked as spam.
|
Heads up: this PR needs to be updated against current |
setFeishuClientRuntimeForTest swapped the SDK but left clientCache intact, so a later createFeishuClient with identical credentials returned the client built by the previous SDK instance. Tests that swap the SDK mid-suite could therefore receive a stale client and make unreliable mock assertions. Call clearClientCache() when the runtime SDK is replaced so cached clients built with the old SDK are evicted. Adds a regression test. Fixes openclaw#83911
abf75bc to
d693389
Compare
|
Thanks @RomneyDa — rebased onto current main, so the Dependency Guard check now runs and passes. No conflicts; the fix and its regression test are unchanged (+37 across 2 files). The one remaining red check (build-artifacts) is unrelated to this diff: it fails in scripts/crabbox-wrapper.test.ts, which this PR does not touch, and current main's own CI is red on the same check independently of this change. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Fixes #83911.
setFeishuClientRuntimeForTestreplaced the module SDK (feishuClientSdk) but did not evictclientCache. A latercreateFeishuClientcall with the sameaccountIdand identical credentials hit the cache and returned the client constructed by the previous SDK instance, so a test that swaps the SDK mid-suite could receive a stale client and make unreliable mock assertions.The reset path now calls the existing
clearClientCache()so any SDK swap also evicts clients built with the old SDK.Real behavior proof
Behavior or issue addressed: after
setFeishuClientRuntimeForTestswaps the SDK, a subsequentcreateFeishuClientwith unchanged credentials should rebuild the client against the new SDK instead of returning the cached client from the old SDK.Real environment tested: Linux (Ubuntu 24.04, WSL2), Node.js 24.14.0, current PR head. Exercised the real
createFeishuClient/setFeishuClientRuntimeForTestfrom client.ts under the repo's vitest runner (the suite imports the real module; only unrelated sibling modules are mocked). Compared the pre-fix and post-fix code.Exact steps or command run after this patch: ran the client test suite, including a new regression test that creates a client, swaps the SDK runtime, then creates again with identical credentials.
Evidence after fix: stdout from the vitest run against the real client factory, comparing pre-fix and post-fix:
$ node scripts/run-vitest.mjs extensions/feishu/src/client.test.ts -t 83911
-- BEFORE the fix (reset leaves cache intact): the regression test fails --
x rebuilds the client after setFeishuClientRuntimeForTest replaces the SDK
AssertionError: expected 1 to be 2
Tests 1 failed | 15 passed (16)
-- AFTER the fix (reset clears the cache): the regression test passes --
rebuilds the client after setFeishuClientRuntimeForTest replaces the SDK
Tests 16 passed (16)
Observed result after fix: before the fix the second
createFeishuClienthits the stale cache, so the client constructor is called only once and the same client object is returned; after the fix the cache is cleared on SDK swap, so the constructor runs again (called twice) and a new client object is returned. The full client suite (16 tests) passes.What was not tested: no live Feishu/Lark account was used; the client factory and cache behavior are exercised through the real module under vitest with the Lark SDK constructor mocked, and the before/after comparison shows the regression test captures the exact stale-cache defect.