Skip to content

fix(qa): retain Telegram proxy failure diagnostics - #163598

Merged
RomneyDa merged 1 commit into
mainfrom
fix/telegram-test-proxy-diagnostics
Oct 2, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/telegram-test-proxy-diagnostics

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: Telegram release QA loses the forwarding cause when the local Test Server proxy encounters a request, lease, upstream-fetch, or response-stream failure.

User Impact

User impact: no end-user behavior changes; release operators get bounded failure phase, Bot API method, built-in error class, and allowlisted Node/Undici code in retained logs instead of an unactionable generic 502 alone.

Why This Change Was Made

The proxy's broad catch returned the correct generic response but discarded every exception. It now emits one structured stderr record at the owner boundary. Raw messages, URLs, paths, headers, bodies, tokens, arbitrary names, and arbitrary codes remain excluded so the log is safe to retain and publish.

The client-facing 502 stays unchanged. This intentionally improves evidence for the next occurrence; it does not claim the historical failure was a Telegram outage or repair an unproven network defect.

Production LOC delta: 0. The changed proxy is QA test support; test-support delta is +41 net lines and regression coverage is +37 net lines. The growth implements the diagnostic/security boundary and fixed failure-phase tracking.

Evidence

  • Pre-fix regression: node --test .agents/skills/telegram-e2e-userbot/scripts/telegram-test-api-proxy.test.mjs failed because the injected nested ECONNRESET produced zero diagnostics.
  • Post-fix focused test: same command passed 14/14 tests.
  • pnpm check:changed passed all conservatively selected lanes (format, guards, full typecheck graph, lint, import cycles).
  • Fresh autoreview: clean, no accepted/actionable findings.
  • Direct dependency contract checked: grammY 1.46.0 parses the generic JSON response independently of stderr; the response shape remains unchanged.

Live failure injection was not used: reproducing a real transient network reset against Telegram would be nondeterministic and could not prove sanitization. The deterministic owner-boundary test exercises the exact catch path and asserts both retained facts and excluded secrets.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review October 2, 2026 15:15
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 11:21 AM ET / 15:21 UTC.

ClawSweeper review

What this changes

The Telegram QA proxy records bounded failure diagnostics on stderr and adds regression coverage for preserving the generic response while excluding exception details and bot tokens.

Merge readiness

✅ Ready for maintainer review

The diagnostic gap remains on current main, and this focused patch addresses it without changing client responses. No blocking introduced defect was found; repository-member work also requires explicit maintainer handling rather than automatic closure.

Priority: P2
Reviewed head: 1a5dde9b55ca01032808af7a693f2b9c42d3eca7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with useful regression evidence and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository-member authorship exempts this PR from external-contributor runtime proof. The supplied HTTP-boundary regression uses a mocked upstream and supports diagnostic sanitization without establishing live Telegram behavior; no authority or stored-data contract changes are introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository-member authorship exempts this PR from external-contributor runtime proof. The supplied HTTP-boundary regression uses a mocked upstream and supports diagnostic sanitization without establishing live Telegram behavior; no authority or stored-data contract changes are introduced.
Evidence reviewed 8 items Verified introduced change: The pinned merge-base-to-head diff introduces diagnostic reporting and phase tracking in the QA proxy plus focused regression coverage. Response payloads, lease checks, upstream selection, and cancellation ownership remain intact.
Current-main necessity: Current main retains the broad catch that discards the exception and returns the generic failure response. Comparison of the relevant file confirms that the diagnostic change remains absent. Reading the latest-release blob failed because its promised object could not be fetched; no release inclusion is claimed.
Diagnostic security boundary: The reporter bounds cause traversal to four objects, restricts error codes to fixed alternatives, emits fixed error-class names, and limits method text. It never serializes exception messages, stacks, request bodies, headers, URLs, or bot-token path segments. No dependency, permission, or execution-source changes are introduced.
Findings None None.
Security None None.

How this fits together

Telegram release QA sends Bot API requests through a local proxy that redirects them to Telegram’s Test Server. The proxy forwards responses and supplies diagnostic evidence to release operators when forwarding fails.

flowchart TD
  A[Telegram QA runner] --> B[Local Test Server proxy]
  B --> C[Lease checks and forwarding]
  C --> D[Telegram Test Bot API]
  D --> E[Response to QA client]
  C --> F[Failure handling]
  F --> E
  F --> G[Bounded stderr diagnostics]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +37, Other +41. Total +78 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 38 1 +37
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 43 2 +41
Total 2 81 3 +78

Review metrics

Metric Value Why it matters
Production and QA growth Product runtime +0; QA proxy support +41; regression tests +37 net lines The added support code has a stated diagnostic and sanitization purpose, without expanding product runtime.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #163597
Summary: This PR is the candidate implementation for the associated report about discarded proxy failures.

Members:

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

Technical review

Best possible solution:

Keep diagnostic reporting at the proxy’s catch boundary, preserving bounded retained facts and the existing client response.

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

Yes, source establishes the path: a forwarding exception reaches current main’s catch and produces only the generic response. The supplied injected regression exercises that boundary; this review did not execute it.

Is this the best way to solve the issue?

Yes, reporting bounded facts at the existing catch is a focused repair that preserves response compatibility and avoids duplicating diagnostic ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0845ecda906f.

Labels

Label changes:

  • add P2: Missing forwarding diagnostics hinder Telegram release QA, with limited impact and no changed end-user chat behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository-member authorship exempts this PR from external-contributor runtime proof. The supplied HTTP-boundary regression uses a mocked upstream and supports diagnostic sanitization without establishing live Telegram behavior; no authority or stored-data contract changes are introduced.

Label justifications:

  • P2: Missing forwarding diagnostics hinder Telegram release QA, with limited impact and no changed end-user chat behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository-member authorship exempts this PR from external-contributor runtime proof. The supplied HTTP-boundary regression uses a mocked upstream and supports diagnostic sanitization without establishing live Telegram behavior; no authority or stored-data contract changes are introduced.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base-to-head diff introduces diagnostic reporting and phase tracking in the QA proxy plus focused regression coverage. Response payloads, lease checks, upstream selection, and cancellation ownership remain intact. (.agents/skills/telegram-e2e-userbot/scripts/telegram-test-api-proxy.mjs:353, 1a5dde9b55ca)
  • Current-main necessity: Current main retains the broad catch that discards the exception and returns the generic failure response. Comparison of the relevant file confirms that the diagnostic change remains absent. Reading the latest-release blob failed because its promised object could not be fetched; no release inclusion is claimed. (.agents/skills/telegram-e2e-userbot/scripts/telegram-test-api-proxy.mjs, 0845ecda906f)
  • Diagnostic security boundary: The reporter bounds cause traversal to four objects, restricts error codes to fixed alternatives, emits fixed error-class names, and limits method text. It never serializes exception messages, stacks, request bodies, headers, URLs, or bot-token path segments. No dependency, permission, or execution-source changes are introduced. (.agents/skills/telegram-e2e-userbot/scripts/telegram-test-api-proxy.mjs:52, 1a5dde9b55ca)
  • Focused regression evidence: The new test sends an actual HTTP request to the proxy, injects a mocked upstream TypeError with nested ECONNRESET, and asserts one structured diagnostic, an unchanged 502 payload, and exclusion of synthetic private text and the token. The captured PR body reports pre-fix failure and 14/14 post-fix tests; these results were not independently executed during this read-only review. (.agents/skills/telegram-e2e-userbot/scripts/telegram-test-api-proxy.test.mjs:396, 1a5dde9b55ca)
  • Runtime owner and consumers: The userbot runner starts this proxy under its run-owned lease; QA Lab also loads the same proxy module. Existing callers consume its unchanged interface, so the patch repairs the diagnostic owner rather than adding a competing implementation. (.agents/skills/telegram-e2e-userbot/scripts/run-mock-sut-user-e2e.mjs:1003, 1a5dde9b55ca)
  • Verified dependency response contract: The captured PR body explicitly claims compatibility with grammY 1.46.0, establishing the dependency signal. GitHub verified repository ownership and resolved that tag to the recorded SHA. Its client parses HTTP response JSON and interprets data.ok; the proxy’s separate stderr output cannot alter this unchanged response contract. (src/core/client.ts:320, 055a5a440f04)

Likely related people:

  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant