Skip to content

fix(v2ex): recover from Python TLS EOF - #536

Closed
LeonChaoX wants to merge 1 commit into
Panniantong:mainfrom
LeonChaoX:agent/fix-v2ex-tls-fallback
Closed

fix(v2ex): recover from Python TLS EOF#536
LeonChaoX wants to merge 1 commit into
Panniantong:mainfrom
LeonChaoX:agent/fix-v2ex-tls-fallback

Conversation

@LeonChaoX

Copy link
Copy Markdown
Contributor

Summary

  • cap V2EX urllib responses at 1 MiB
  • retry only Python TLS unexpected-EOF failures through the native curl TLS stack
  • preserve fail-closed behavior for certificate verification and ordinary network failures
  • add regressions for fallback behavior and doctor recovery

Root cause

On some Windows/network combinations, Python's TLS stack raises UNEXPECTED_EOF_WHILE_READING even though the same V2EX endpoint succeeds through the operating system's curl. Because the channel and doctor shared the same urllib path, Agent Reach reported V2EX as unavailable and could not fetch data.

User impact

V2EX checks and data calls now recover when the native TLS stack can reach the endpoint, without weakening certificate validation or hiding unrelated failures.

Validation

  • python -m pytest tests/test_v2ex_channel.py tests/test_doctor.py tests/test_channel_contracts.py tests/test_skill_command.py -q — 37 passed
  • python -m ruff check agent_reach/channels/v2ex.py tests/test_v2ex_channel.py tests/test_skill_command.py
  • git diff --check

Closes #514

@Panniantong

Copy link
Copy Markdown
Owner

感谢实现 V2EX TLS EOF fallback。你的原始作者提交已保留在 merged #577 中,并在其上增加了精确错误边界、响应限制、回归测试和真实 smoke;因此关闭原 PR。

@Panniantong Panniantong closed this Aug 6, 2026
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.

doctor: false negative for v2ex (SSL EOF error) while API is reachable via curl

2 participants