Skip to content

fix(v2ex): retry urllib timeouts with bounded curl fallback - #902

Merged
Panniantong merged 1 commit into
Panniantong:mainfrom
remote-controlled-man:codex/prflow-c5e2d3202ab5
Nov 8, 2026
Merged

Panniantong merged 1 commit into
Panniantong:mainfrom
remote-controlled-man:codex/prflow-c5e2d3202ab5

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Fixes #900

V2EX requests that time out in Python's TLS stack currently fail without trying the native curl fallback. This extends the existing exception-chain check to recognize TimeoutError, including a timeout wrapped in URLError. On the supported Python versions, socket.timeout is the same exception type.

The fallback still runs once with its existing HTTPS-only URL validation, certificate verification, response size limit, and independent 10-second curl budget. urllib keeps its existing 10-second timeout; the action's outer deadline is unchanged. HTTP errors, certificate verification failures, malformed responses, and error strings that merely mention a timeout do not qualify.

Regression tests exercise the public action dispatcher with the real HTTP boundary mocked: direct/wrapped timeouts recover a topic through curl, while five non-retryable failures never start curl.

Validation on macOS / Python 3.12, without a GPU:

  • Full native test suite: 530 passed (includes the 16 V2EX tests).
  • ruff check agent_reach tests and mypy agent_reach: passed.
  • Native sdist/wheel build: passed; wheel content checks and installation into a clean environment passed (14 channels, packaged skill resources present).
  • The CI's pipx 1.5 → uv upgrade scenario passed locally: config migration, old copy removal, new CLI precedence, and installation report.
  • git diff --check: passed.

Actual agent-reach check v2ex --text output:

PASS  v2ex hot [v2ex-api] 1247ms
PASS  v2ex node [v2ex-api] 1238ms
PASS  v2ex read [v2ex-api] 2662ms
PASS  v2ex user [v2ex-api] 987ms

4/4 actions working

The reporter's Windows TLS-handshake condition is reproduced with injected HTTP-boundary exceptions in regression tests; live acceptance above is on macOS. Other OS/Python combinations remain for CI.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@Panniantong
Panniantong merged commit b7bc190 into Panniantong:main Nov 8, 2026
10 checks passed
@Panniantong

Copy link
Copy Markdown
Owner

Thanks! Merged. Verified on macOS: agent-reach check v2ex passes 4/4 and v2ex hot returns posts; the handshake-timeout fallback is covered by your tests.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2ex: TLS handshake timeout never reaches the curl fallback (curl returns 200 in 0.4s)

3 participants