fix(feishu): retain bot identity with oversized startup timeouts (#15…
fix(feishu): retain bot identity with oversized startup timeouts (#154594) ## What Problem This Solves Fixes: Feishu starts without its provider-verified bot identity when `OPENCLAW_FEISHU_STARTUP_PROBE_TIMEOUT_MS` exceeds Node's timer range, even when the bot-info endpoint responds promptly. ## User Impact Long startup-probe budgets no longer become immediate HTTP timeouts. Normal values, the default, invalid-value fallback, and cancellation behavior remain unchanged. No configuration migration is required. ## Why This Change Was Made Clamp the strictly parsed environment value through the existing shared timer helper before passing it to either consumer. The outer startup timer already normalizes its budget, but the Lark/Axios HTTP request previously received the unbounded value. The existing regression now exercises `Number.MAX_SAFE_INTEGER`, which exceeds the actual Node timer limit. ## Evidence Exercised `openclaw gateway run` with the built, registered Feishu plugin and installed Lark 1.73.3/Axios 1.20.0 transport. Each case used fresh isolated state, synthetic app credentials, a supported HTTPS custom domain on loopback, and a task-local CA via `NODE_EXTRA_CA_CERTS`; no source imports, request mocks, or TLS-verification bypasses. | Startup case | Baseline `10c229159ceb9ae4fe42b40495d718256d68a3fc` | Candidate `43aa849bec6fbb64416d2d406265edfb74ed481e` | | --- | --- | --- | | Timeout `9007199254740991`; bot-info reply delayed 150ms | Real GET closed after 10ms; `Timeout duration was set to 1`, Axios `ECONNABORTED`, identity `unknown` | Reply completed after 151ms; provider identity resolved; no overflow warning | | Normal `90000` and unset/default | Provider identity resolved | Provider identity resolved | | Short `100ms` budget | Identity unavailable as expected | Identity unavailable as expected | | Provider API error | No provider identity accepted | No provider identity accepted | | Stop during pending bot-info request | Gateway exited cleanly | Gateway exited cleanly | All candidate cases exited with status 0; owned listeners, sockets, and response timers were closed. This proves local registered startup and the actual HTTP timeout boundary, not live Feishu message delivery. Focused validation on the candidate: existing startup suite **13/13 passed** (40.12s wall); scoped formatting, type-aware lint, both source ratchets, and the built QA runtime passed. Hosted PR CI remains a separate landing gate. Co-authored-by: Ayaan Zaidi
评论
?
参与讨论