fix(wecom): enable config-only unified startup#1389
Merged
thepagent merged 1 commit intoJul 13, 2026
Conversation
thepagent
approved these changes
Jul 13, 2026
thepagent
left a comment
Collaborator
There was a problem hiding this comment.
Maintainer review — Approving ✅
Root cause analysis is exactly right: #1382 made every [wecom] field resolve config-first, but both activation gates (no adapter configured bail + unified-server spawn) still keyed solely on has_unified_platform_env() — so a config-only section was rejected before apply_wecom_config() ever ran. Thanks for the precise diagnosis and the tight scope.
What I verified locally (macmini, PR head):
cargo clippy -- -D warningsand--features unified— both cleancomplete_wecom_section_enables_unified_startup_without_envpasses under default and unified feature sets — nice touch asserting== cfg!(feature = "wecom")so the test is correct in both matrices- Traced the config-only path end-to-end: bail gate →
unified_wecom_configured(computed post-substitution, pre-move, as your comment documents) → server spawn →apply_wecom_config(if let Some(ref w) = cfg.wecom, no env needed) → route mount keyed ongw_state.wecom— no remaining env dependency anywhere on the path - The all-five-credentials requirement is a good anti-footgun: an incomplete section can't become an activation signal
Non-blocking findings, all fine to land as-is:
- Bail-gate runs pre-substitution (line ~288 vs substitution at ~318): for a
secrets-driven section, the firsthas_unified_wecom_configcall sees unresolved placeholder strings — non-empty, so the gate passes and the authoritative post-substitution recompute takes over. Correct today, but subtly order-dependent; a one-line comment at the bail-gate call noting "placeholder values are fine here — only reachability matters, the post-substitution recompute is authoritative" would protect it from future refactors. - Sibling platforms have the same gap:
[line]/[feishu]/[googlechat]/[teams]config-only startup still requires the env activity signal. Scoping this PR to WeCom (matching #1388) is right; I'll track the generalization (ahas_unified_platform_config()covering all six, likely replacing the wecom-specific helper) as a follow-up on #1356. - Trust-override activity signal (line ~549) still keys on
WECOM_CORP_IDenv — in a config-only deployment the Phase-1 deprecation warning for uniformGATEWAY_*trust won't fire. Warn-only impact, and it folds naturally into follow-up (2).
CI matrix still finishing at review time; assuming green, this is ready to merge from my side.
14 tasks
thepagent
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[wecom]section during no-adapter startup validationWECOM_CORP_IDbeing exportedRoot cause
#1382 made every WeCom field resolve
config -> WECOM_* env -> default, but the outer startup gates still relied onhas_unified_platform_env(). A literal or secret-substituted[wecom]section was therefore rejected beforeapply_wecom_config()could construct the adapter.The new helper requires all five credentials needed by the WeCom adapter after config/env resolution, so incomplete sections do not become an activation signal.
Validation
cargo clippy -- -D warningscargo clippy --features unified -- -D warningscargo testcargo test --features unifiedWECOM_*variables unset: adapter configured,/webhook/wecommounted, server listening, graceful shutdown successfulcargo fmt --all -- --checkremains blocked by pre-existing formatting drift across unrelated filesCloses #1388.
Context