Skip to content

fix(telegram): retain socket failure context#96830

Closed
zhangguiping-xydt wants to merge 2 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-94620
Closed

fix(telegram): retain socket failure context#96830
zhangguiping-xydt wants to merge 2 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-94620

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #94620.

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 patch 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.
  • ../../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.
    • exact PR tree aca7d9ae1c47f6521ada4c244635818b8473f95c passed pnpm check:changed for the extension and extension-test lanes.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S labels Jun 25, 2026
@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: #97130 is the clean current-main replacement, explicitly says it supersedes this PR while preserving contributor credit, and carries the same focused Telegram fix with proof.

Root-cause cluster
Relationship: superseded
Canonical: #97130
Summary: The current PR and the replacement target the same Telegram EADDRNOTAVAIL fallback diagnostic bug; the maintainer-authored replacement explicitly supersedes this PR and is the clean canonical landing path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Use #97130 as the canonical clean landing path, then close the linked issue and remaining same-root PRs after that replacement lands.

So I’m closing this here and keeping the remaining discussion on #97130.

Review details

Best possible solution:

Use #97130 as the canonical clean landing path, then close the linked issue and remaining same-root PRs after that replacement lands.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main still drops the original probe error before forced fallback, and the replacement PR includes Darwin and Linux real-kernel EADDRNOTAVAIL proof for the corrected behavior.

Is this the best way to solve the issue?

Yes, but the best landing path is the replacement PR, not this superseded branch. The replacement keeps the fix owner-local, preserves valid fallback recovery, and avoids maintaining two same-root candidate PRs.

Security review:

Security review cleared: No concrete security or supply-chain issue remains for this close decision; the canonical replacement diff is limited to Telegram source and tests.

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read: Root AGENTS.md, extensions/AGENTS.md, docs/AGENTS.md, ui/AGENTS.md, and the Telegram maintainer note were read; the Telegram note requires real Telegram proof or an equivalent live probe for transport changes. (.agents/maintainer-notes/telegram.md:35, 1bccd2930437)
  • Canonical replacement: The live body for fix(telegram): retain socket failure context #97130 says it fixes the linked issue, supersedes this PR, and preserves @zhangguiping-xydt's contribution credit. (7c448b8da0b8)
  • Replacement scope: The replacement commit is a four-file Telegram-only change: extensions/telegram/src/fetch.ts, probe.ts, and their focused tests, with 36 additions and 8 deletions. (7c448b8da0b8)
  • Current PR merge-result check: GitHub's potential merge commit for this PR also resolves to the same four Telegram files, which confirms the useful change is already isolated in the replacement branch. (2d99066fc640)
  • Replacement implementation: The replacement source extends forceFallback to accept the original error and passes that error through promoteStickyAttempt so fallback diagnostics keep the real socket code. (extensions/telegram/src/fetch.ts:494, 7c448b8da0b8)
  • Probe caller update: The replacement probe path passes the caught getMe error into forceFallback, preserving EADDRNOTAVAIL in the transport fallback warning. (extensions/telegram/src/probe.ts:166, 7c448b8da0b8)

Likely related people:

  • steipete: Opened the clean superseding PR and authored the four-file replacement commit that preserves the contributor credit. (role: canonical replacement author; confidence: high; commits: 7c448b8da0b8, 65521655e91b; files: extensions/telegram/src/fetch.ts, extensions/telegram/src/probe.ts, extensions/telegram/src/fetch.test.ts)
  • obviyus: Authored and merged the Telegram transport fallback unification that introduced the ordered sticky IPv4 and pinned-IP fallback chain involved here. (role: feature history owner; confidence: high; commits: e4825a0f9385; files: extensions/telegram/src/fetch.ts, extensions/telegram/src/fetch.test.ts)
  • sircrumpet: Authored resolver-scoped Telegram fallback work that shaped the fetch/probe boundary changed by the replacement. (role: fallback refactor contributor; confidence: high; commits: 45b74fb56c45; files: extensions/telegram/src/fetch.ts, extensions/telegram/src/probe.ts, src/telegram/fetch.ts)
  • scoootscooob: Moved the Telegram implementation into extensions while preserving the fetch/probe ownership boundary involved here. (role: refactor mover; confidence: medium; commits: e5bca0832fbd; files: src/telegram/fetch.ts, src/telegram/probe.ts, extensions/telegram/src/fetch.ts)

Codex review notes: model internal, reasoning high; reviewed against 1bccd2930437.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 25, 2026
@steipete
steipete requested a review from a team as a code owner June 27, 2026 00:52
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat channel: matrix Channel integration: matrix channel: signal Channel integration: signal channel: voice-call Channel integration: voice-call app: android App: android app: ios App: ios app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: openai extensions: minimax extensions: byteplus labels Jun 27, 2026
@steipete steipete changed the title fix(telegram): skip fallback for local socket exhaustion fix(telegram): retain socket failure context Jun 27, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 27, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 27, 2026
@steipete

Copy link
Copy Markdown
Contributor

Superseded by the clean maintainer rewrite in #97130, landed as 072d3ed.

The final implementation keeps your useful error-forwarding direction, removes the broad message classifier, preserves alternate-IP recovery, and makes the warning cause-neutral. The fork branch could not accept a clean ancestry rewrite through maintainer access, so I recreated the final four-file patch; your authorship is preserved with a Co-authored-by trailer.

Thank you, @zhangguiping-xydt.

#97130

@steipete steipete closed this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: ios App: ios app: web-ui App: web-ui channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat channel: matrix Channel integration: matrix channel: signal Channel integration: signal channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: byteplus extensions: codex extensions: deepinfra extensions: diffs extensions: elevenlabs extensions: fal extensions: github-copilot extensions: google extensions: litellm extensions: memory-core Extension: memory-core extensions: microsoft extensions: minimax extensions: openai extensions: openrouter extensions: openshell extensions: xai gateway Gateway runtime P2 Normal backlog priority with limited blast radius. plugin: azure-speech Azure Speech plugin plugin: google-meet proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants