Skip to content

Conversation

@zemaj
Copy link

@zemaj zemaj commented Oct 30, 2025

Summary

  • wrap model stream connect errors with contextual guidance so DNS/connection failures no longer surface as opaque reqwest messages
  • treat timeouts and DNS resolution failures as CodexErr::Stream with actionable hints (e.g., check /etc/resolv.conf)
  • add unit coverage for the DNS hint helper

Testing

  • cargo test -p code-core chat_completions::tests::dns_hint_matches_common_messages
  • ./build-fast.sh

Fixes #377.

zemaj added 3 commits October 31, 2025 05:54
- add optional `current_date` field to `EnvironmentContext` so turn context carries ISO dates
- serialize `<current_date>` tags and extend comparisons/tests to tolerate deterministic values
- cover default date formatting with new unit tests
- reject cached version.json written by the upstream repo so we don't keep prompting for 0.50.0
- stamp new cache entries with the just-every/code origin to avoid future mixups
- add regression tests covering legacy and current cache formats
- detect reqwest connect/timeout failures while starting model streams and wrap them with actionable hints
- add DNS-specific guidance so users can spot resolver misconfigurations (e.g., empty /etc/resolv.conf)
- cover hint detection with lightweight unit tests
Copy link
Author

@zemaj zemaj left a comment

Choose a reason for hiding this comment

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

Summary:

  • Expanded DNS/connect error classification so CodexErr::Stream surfaces actionable guidance instead of opaque reqwest errors.
  • Extended dns_resolution_hint coverage (nodename/servname, getaddrinfo failures, Windows host errors) and guarded against empty error-chain messages.
  • Added targeted unit tests for the hint matcher and error-chain walker.

Tests:

  • cargo test -p code-core chat_completions::tests::dns_hint_matches_common_messages -- --nocapture
  • cargo test -p code-core deepest_error_message_handles_empty_source_messages -- --nocapture
  • ./build-fast.sh

Risks:

  • Consider adding jitter/backoff tuning for connect retries and auditing downstream consumers that rely on CodexErr::Reqwest vs CodexErr::Stream.
  • Full cargo test -p code-core --tests flakes locally on macOS due to /private/var vs /var path expectations in custom_prompts_discovery; unrelated to these changes.

Copy link
Author

@zemaj zemaj left a comment

Choose a reason for hiding this comment

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

Summary:

  • Centralized network/DNS guidance helpers in code-rs/core/src/error.rs and wired them into both chat and responses SSE paths so retries surface actionable messages for timeouts, DNS failures, TLS errors, and connection resets.
  • Updated code-rs/core/src/chat_completions.rs and code-rs/core/src/client.rs to propagate provider hostnames, enrich idle-timeout/early-disconnect errors, and added an async regression test for early stream closure guidance.
  • Extended unit coverage in code-rs/core/src/error.rs for host-specific DNS hints, TLS failures, and connection resets.

Tests:

  • cargo test -p code-core dns_guidance_includes_host_details -- --nocapture
  • cargo test -p code-core network_guidance_detects_connection_resets -- --nocapture
  • cargo test -p code-core network_guidance_detects_tls_failures -- --nocapture
  • cargo test -p code-core chat_completions::tests::early_disconnect_emits_guidance -- --nocapture
  • ./build-fast.sh

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.

New install: codex stream and install assistant errors (with Codex CLI already configured for web account usage)

2 participants