openclaw - 💡(How to fix) Fix No dedicated tests for client.ts or client-timeout.ts owned files [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#83912Fetched 2026-05-20 03:46:52
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
1
Timeline (top)
closed ×1commented ×1labeled ×1unsubscribed ×1

Fix Action

Fix / Workaround

Severity: medium / Confidence: high / Category: test-gap Triage: test-gap Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18) Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol


Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID: fnd_sig-feat-cli-command-1e533463a4-_1a546feab9.

Code Example

import * as Lark from "@larksuiteoapi/node-sdk";

---

export function resolveConfiguredHttpTimeoutMs(creds: FeishuClientTimeoutConfig): number {

---

vi.mock("./client.js", () => ({
  createFeishuClient: createFeishuClientMock,
}));
RAW_BUFFERClick to expand / collapse

Severity: medium / Confidence: high / Category: test-gap Triage: test-gap Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18) Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol

Evidence

  • extensions/feishu/src/client.ts:1-20 (createFeishuClient)
import * as Lark from "@larksuiteoapi/node-sdk";
  • extensions/feishu/src/client-timeout.ts:1-45 (resolveConfiguredHttpTimeoutMs)
export function resolveConfiguredHttpTimeoutMs(creds: FeishuClientTimeoutConfig): number {
  • extensions/feishu/src/bitable.test.ts:9-11 (None)
vi.mock("./client.js", () => ({
  createFeishuClient: createFeishuClientMock,
}));

Reasoning

Both owned files — the core client factory (createFeishuClient, createFeishuWSClient, createTimeoutHttpInstance, clientCache invalidation logic) and the timeout resolver (resolveConfiguredHttpTimeoutMs with its three-tier precedence: direct field > env var > config) — have zero dedicated test coverage. Every context test file that touches client.ts mocks it wholesale with vi.mock('./client.js'), so the real cache invalidation path, timeout injection, and User-Agent interceptor replacement are never exercised by any provided test. Key behaviors at risk: cache returning a stale client when credentials change but accountId stays the same, env var timeout taking precedence over config.httpTimeoutMs, and the clamping floor interaction (e.g. 0.5 floors to 0, clamps to 1ms).

Reproduction

No test file targets createFeishuClient directly; all callers mock it.

Recommendation

Add a colocated client.test.ts covering: (1) cache hit/miss on credential change, (2) timeout resolution precedence (direct > env > config > default), (3) that createTimeoutHttpInstance injects default timeout and allows caller override, (4) clearClientCache(accountId) vs clearClientCache() behaviour, (5) resolveDomain for each branch (lark, feishu, custom URL).

Why existing tests miss this

All test files that import from the feishu extension mock ./client.js entirely, so the real module code is never executed during tests.

Suggested regression test

describe('createFeishuClient', () => { it('returns cached client on identical credentials', ...) it('creates new client on appSecret change', ...) it('injects default timeout when none supplied', ...) it('env var overrides config.httpTimeoutMs', ...) }); in extensions/feishu/src/client.test.ts

Minimum fix scope

Add extensions/feishu/src/client.test.ts and extensions/feishu/src/client-timeout.test.ts covering the above scenarios.


Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID: fnd_sig-feat-cli-command-1e533463a4-_1a546feab9.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix No dedicated tests for client.ts or client-timeout.ts owned files [1 comments, 2 participants]