Skip to content

fix(telegram): retain socket failure context#97130

Merged
steipete merged 1 commit into
mainfrom
fix/telegram-probe-fallback-context
Jun 27, 2026
Merged

fix(telegram): retain socket failure context#97130
steipete merged 1 commit into
mainfrom
fix/telegram-probe-fallback-context

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #94620. Supersedes #96830 while preserving @zhangguiping-xydt's contribution credit.

When a Telegram startup probe fails and explicitly promotes the transport fallback, the transport currently discards the original error. That produces codes=none and can pair a local socket failure with the inaccurate claim that a DNS-resolved IP was unreachable.

Why This Change Was Made

  • Pass the original probe error into forceFallback so the existing transport diagnostic reports its structured socket code.
  • Describe the failed primary connection path without asserting an unproven DNS cause.
  • Preserve the existing fallback policy: a direct structured EADDRNOTAVAIL fetch failure is not automatically retried, while a probe can still promote the alternate IPv4 or pinned-IP path.

The original proposal disabled probe fallback for EADDRNOTAVAIL. Maintainer review found that too broad: Linux ephemeral-port allocation is destination-sensitive, so a different remote Telegram IP can still provide a usable socket tuple. Keeping recovery while preserving the real error is the bounded owner-local fix.

User Impact

Telegram startup fallback logs now retain EADDRNOTAVAIL and avoid misleading DNS wording. Existing alternate-IP recovery remains available, including when a different destination tuple can recover from local port pressure.

Evidence

  • node scripts/run-vitest.mjs extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts
    • 2 files passed; 56 tests passed on current main.
  • node_modules/.bin/oxfmt --check extensions/telegram/src/fetch.ts extensions/telegram/src/probe.ts extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts
    • passed.
  • node_modules/.bin/oxlint --deny-warnings extensions/telegram/src/fetch.ts extensions/telegram/src/probe.ts extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts
    • 0 warnings; 0 errors.
  • git diff --check
    • passed.
  • Fresh Codex autoreview
    • clean; no accepted/actionable findings.
  • Darwin real-kernel proof
    • produced EADDRNOTAVAIL (errno=-49); direct fallback was false; two explicit promotions returned true and retained codes=EADDRNOTAVAIL.
  • Blacksmith Testbox tbx_01kw38m62y2gccvpbgy5kafgx8
    • Linux real-kernel proof produced EADDRNOTAVAIL (errno=-99) with the same fallback decisions.
    • the four-file change passed pnpm check:changed for the extension and extension-test lanes.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS maintainer Maintainer-authored PR labels Jun 27, 2026
@clawsweeper

clawsweeper Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(telegram): retain socket failure context This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready maintainer review complete.

Fixups:

  • retained the original probe error in Telegram transport fallback diagnostics;
  • replaced the unproven DNS-cause warning with cause-neutral primary-path wording;
  • preserved alternate-IP recovery for probe-forced fallback;
  • kept direct structured EADDRNOTAVAIL failures on the existing no-auto-retry path;
  • preserved @zhangguiping-xydt as commit co-author from fix(telegram): retain socket failure context #96830.

Proof:

  • node scripts/run-vitest.mjs extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts — 56 passed;
  • node_modules/.bin/oxfmt --check extensions/telegram/src/fetch.ts extensions/telegram/src/probe.ts extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts — passed;
  • node_modules/.bin/oxlint --deny-warnings extensions/telegram/src/fetch.ts extensions/telegram/src/probe.ts extensions/telegram/src/fetch.test.ts extensions/telegram/src/probe.test.ts — 0 warnings/errors;
  • git diff --check — passed;
  • Darwin real socket: EADDRNOTAVAIL (errno=-49), direct retry false, two forced promotions true, diagnostic retained the code;
  • Blacksmith Testbox tbx_01kw38m62y2gccvpbgy5kafgx8: Linux real socket EADDRNOTAVAIL (errno=-99) with the same decisions; pnpm check:changed passed extension and extension-test lanes;
  • Codex autoreview 019f068b-0e23-7322-a412-eae467e853d3 — clean, no accepted/actionable findings;
  • exact-head hosted gates passed for 7c448b8da0b818f93e9597e9d3845540bccbbb96, including CI run 28273729348, CodeQL Critical Quality run 28273729335, and Real behavior proof run 28273729416.

Before/after: the probe fallback warning changed from a false DNS assertion with codes=none to a cause-neutral warning containing codes=EADDRNOTAVAIL, without removing recovery.

Known proof gaps: none.

@steipete
steipete merged commit 072d3ed into main Jun 27, 2026
111 of 113 checks passed
@steipete
steipete deleted the fix/telegram-probe-fallback-context branch June 27, 2026 01:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 27, 2026
xydigit-zt pushed a commit to xydigit-zt/xydigit-zt-openclaw that referenced this pull request Jun 28, 2026
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading Telegram fallback log + dead-code remote-IP retry on EADDRNOTAVAIL

1 participant