Skip to content

[codex] support persisted web resolution modes - #285

Merged
tjb-tech merged 1 commit into
HKUDS:mainfrom
patsyang:codex/web-resolution-modes
Jun 4, 2026
Merged

[codex] support persisted web resolution modes#285
tjb-tech merged 1 commit into
HKUDS:mainfrom
patsyang:codex/web-resolution-modes

Conversation

@patsyang

@patsyang patsyang commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add persistent web settings for outbound web proxy and resolution behavior
  • support auto, direct, proxy, and synthetic_dns URL validation modes in network_guard
  • add top-level oh config set support for persisted nested settings
  • add isolated tests for network guard and config CLI behavior

Why

Some TUN/fake-IP environments resolve public domains to synthetic non-public CIDRs. The previous guard rejected those DNS results before the request, which made web_search and web_fetch unusable in those environments unless every OpenHarness process manually supplied environment variables.

This keeps the default strict direct-network behavior unchanged while allowing users to opt in once through persisted settings.

Validation

  • ./.venv/Scripts/python.exe -m pytest tests/test_utils/test_network_guard.py tests/test_config/test_settings.py tests/test_entrypoints/test_config_cli.py tests/test_tools/test_web_fetch_tool.py
  • ./.venv/Scripts/python.exe -m ruff check src/openharness/utils/network_guard.py src/openharness/config/settings.py src/openharness/cli.py tests/test_utils/test_network_guard.py tests/test_config/test_settings.py tests/test_entrypoints/test_config_cli.py tests/test_tools/test_web_fetch_tool.py

@patsyang
patsyang marked this pull request as ready for review June 3, 2026 10:40
@tjb-tech
tjb-tech merged commit 257916d into HKUDS:main Jun 4, 2026
4 checks passed
@patsyang
patsyang deleted the codex/web-resolution-modes branch June 4, 2026 04:56
yl-jiang added a commit to yl-jiang/OpenHarness that referenced this pull request Jun 5, 2026
Manually ported from main commit 257916d.
Original: fix(web): support persisted resolution modes (HKUDS#285)

- 新增 WebSettings 模型 (proxy / resolution_mode / synthetic_dns_cidrs)
- 新增 config CLI 子命令 (show / set),支持持久化嵌套配置
- network_guard 重构为三模式验证:direct / proxy / synthetic_dns
- 支持 OPENHARNESS_WEB_* 环境变量覆盖
- 适配 dev 分支:保留 max_children / _normalize_* 等独有代码,
  config show 使用 model_dump_json 替代 main 的 _settings_json_for_display

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
wmd-1 pushed a commit to wmd-1/OpenHarness that referenced this pull request Jun 15, 2026
yl-jiang pushed a commit to yl-jiang/OpenHarness that referenced this pull request Jun 18, 2026
yl-jiang added a commit to yl-jiang/OpenHarness that referenced this pull request Jun 18, 2026
Manually ported from main commit e9f0c09.
Original: fix(web): support persisted resolution modes (HKUDS#285)

- 新增 WebSettings 模型 (proxy / resolution_mode / synthetic_dns_cidrs)
- 新增 config CLI 子命令 (show / set),支持持久化嵌套配置
- network_guard 重构为三模式验证:direct / proxy / synthetic_dns
- 支持 OPENHARNESS_WEB_* 环境变量覆盖
- 适配 dev 分支:保留 max_children / _normalize_* 等独有代码,
  config show 使用 model_dump_json 替代 main 的 _settings_json_for_display

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants