Skip to content

fix(zalo): stop provider startup after gateway shutdown - #115763

Merged
steipete merged 1 commit into
mainfrom
codex/s12-zalo-preaborted-109990
Jul 29, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/s12-zalo-preaborted-109990

Conversation

@steipete-oai

Copy link
Copy Markdown
Contributor

Related: #109990

What Problem This Solves

Fixes an issue where a configured Zalo account could keep starting after its gateway lifecycle had already been canceled. Polling could still inspect or mutate webhooks, and webhook mode could acquire local HTTP routes or change remote webhook registration after shutdown.

Why This Change Was Made

Preserves and credits @LZY3538's original fix from #109990 while reconstructing its exact three reviewed file blobs on current, repaired main. The Zalo-owned monitor now handles an already-aborted signal before registering its listener and before acquiring any polling, webhook, hosted-media, or HTTP-route resource. No SDK, dependency, configuration, or unrelated plugin behavior changes.

The original contributor fork could not accept the required current-main refresh because the repository-native publisher correctly rejects an unsigned merge and its signed GraphQL fallback cannot preserve merge ancestry. This official, GitHub-signed, expected-head-guarded reconstruction retains the original production fix and regression tests byte-for-byte and includes the contributor's actual Co-authored-by trailer.

User Impact

Zalo polling and webhook accounts now stop immediately and cleanly when gateway shutdown wins the startup race. Already-running accounts retain their existing abort and cleanup behavior.

Evidence

  • Reproduced the real configured-gateway failure on current-main baseline f466ad0e71b73b3dbb8cce2a29631edd088ee6a7: both polling and webhook integration cases failed as expected while 26 adjacent controls passed.
  • Original @LZY3538 head 14a96a5713d880830ea82a9cfb3ae140b1a44639: all 123 Zalo tests in 20 files passed on remote Blacksmith.
  • Verified each of the three published official blobs is identical to the independently reviewed original-contributor-preserving fix.
  • Exact GitHub-signed official head c0e050bbf275202a3a9eeca86cb9084e33ad7a1b:
    OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/zalo/src/channel.pre-aborted.integration.test.ts extensions/zalo/src/monitor.lifecycle.test.ts extensions/zalo/src/channel.startup.test.ts: 3 files, 10 tests passed.
  • The integration runs the actual configured Zalo gateway against a real loopback TCP/HTTP server using the production API client; it mocks neither fetch, the account monitor, the abort signal, nor the plugin route registry. In both modes only the legitimate getMe account probe occurs and zero HTTP routes remain.
  • Exact-head Codex gpt-5.6-sol autoreview at xhigh: clean, no findings, 0.97 correctness; TruffleHog clean.
  • git diff --check: passed. Current repaired main and workflow sanity fixes are ancestors.
  • AI-assisted maintainer reconstruction; original source and contributor credit are preserved in the commit.

Reconstruct the verified Zalo lifecycle fix from #109990 on current main and preserve its exact production and regression-test blobs.

Source: #109990

Co-authored-by: LZY3538 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added channel: zalo Channel integration: zalo size: S maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete
steipete merged commit 4a19f39 into main Jul 29, 2026
89 of 95 checks passed
@steipete
steipete deleted the codex/s12-zalo-preaborted-109990 branch July 29, 2026 08:45
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main:
  fix(zalo): stop provider startup after gateway shutdown (#115763)
  fix(agents): bound completed background process retention (#115760)
  fix(plugins): bound hook execution and retire stale registrations (#115695)
  fix(ui): collapse custodian startup error gap (#115720)
  fix(gateway): reload edited hook transforms (#107875)
  refactor: centralize channel streaming config hints (#115739)
  fix(msteams): finalize sent replies after dispatch (#82354)
  fix(cron): deliver explicitly configured failure alerts (#115762)
  fix(hooks): resolve inbound claim conversation once (#115491)
  refactor: retire legacy provider and secret paths (#115655)
  fix(memory): reject malformed QMD result entries (#115705)
  fix(diagnostics): keep internal thinking out of telemetry [AI] (#115261)
  fix(ui): localize remaining control surfaces (#115730)
  fix(gateway): prevent model owner mismatch after plugin activation (#115747)
  fix(agents): run reply hooks for restart recovery (#115711)
  fix(cron): initialize detached hook run sessions (#115765)
  fix(ios): keep stop available for staged voice notes (#115744)
  fix(doctor): preserve config includes during cleanup (#115723)
  fix(memory): keep dreaming consolidation within project scope (#115721)
  fix(discord): keep tool rows under verbose progress (#111947)

# Conflicts:
#	ui/src/pages/custodian/custodian-surface.ts
#	ui/src/styles/custodian.css
vincentkoc added a commit that referenced this pull request Jul 29, 2026
…ft-ingestion

* origin/main:
  fix(feishu): reject unsupported initial document content (#115697)
  feat(media): probe duration and dimensions for playback metadata (#115728)
  fix(sandbox): scope runtimes by workspace (#115766)
  fix(ui): guide users through missing or broken AI setup (#115716)
  fix(sessions): return direct-agent replies to their active session (#115756)
  fix(zalo): stop provider startup after gateway shutdown (#115763)
  fix(agents): bound completed background process retention (#115760)
  fix(plugins): bound hook execution and retire stale registrations (#115695)
  fix(ui): collapse custodian startup error gap (#115720)
  fix(gateway): reload edited hook transforms (#107875)
  refactor: centralize channel streaming config hints (#115739)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
)

Reconstruct the verified Zalo lifecycle fix from openclaw#109990 on current main and preserve its exact production and regression-test blobs.

Source: openclaw#109990

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: LZY3538 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…ft-ingestion

* origin/main:
  fix(feishu): reject unsupported initial document content (openclaw#115697)
  feat(media): probe duration and dimensions for playback metadata (openclaw#115728)
  fix(sandbox): scope runtimes by workspace (openclaw#115766)
  fix(ui): guide users through missing or broken AI setup (openclaw#115716)
  fix(sessions): return direct-agent replies to their active session (openclaw#115756)
  fix(zalo): stop provider startup after gateway shutdown (openclaw#115763)
  fix(agents): bound completed background process retention (openclaw#115760)
  fix(plugins): bound hook execution and retire stale registrations (openclaw#115695)
  fix(ui): collapse custodian startup error gap (openclaw#115720)
  fix(gateway): reload edited hook transforms (openclaw#107875)
  refactor: centralize channel streaming config hints (openclaw#115739)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: zalo Channel integration: zalo maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants