Skip to content

fix(copaw): remap local provider URLs in containers - #1014

Open
RerankerGuo wants to merge 3 commits into
agentscope-ai:mainfrom
RerankerGuo:fix/issue-907-copaw-local-provider-url
Open

fix(copaw): remap local provider URLs in containers#1014
RerankerGuo wants to merge 3 commits into
agentscope-ai:mainfrom
RerankerGuo:fix/issue-907-copaw-local-provider-url

Conversation

@RerankerGuo

@RerankerGuo RerankerGuo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remap CoPaw model provider base URLs that use localhost or 127.0.0.1 to host.docker.internal when the CoPaw bridge runs inside a container.
  • Keep the existing :8080 gateway port remap behavior for non-container runs.
  • Add a bridge unit case for container-local provider URL generation.
  • Record the image-affecting CoPaw change in changelog/current.md.

Why

Fixes #907. Users can pass host-side/local-model curl checks while Matrix chat still fails because the runtime provider URL is written as localhost inside the container. In that context, localhost points to the CoPaw container, not the host model service.

Temporary dependencies

This branch is temporarily stacked on #985 and #1015. Its previous CI failures
were the SHARD_A Bob-creation race fixed by #985 and the SHARD_D/test-21 Team
Room coordination failure fixed by #1015. Both dependency PRs now pass all 10
integration matrix jobs.

Relative to #1015, this PR still changes only:

  • changelog/current.md
  • copaw/src/copaw_worker/bridge.py
  • copaw/tests/test_bridge.py

After the dependency PRs merge, this PR automatically reduces to those files.

Validation

  • git diff --check against test: nudge team leader to coordinate in team room #1015
  • python3 -m py_compile copaw/src/copaw_worker/bridge.py copaw/tests/test_bridge.py
  • direct provider URL smoke test verifies localhost and 127.0.0.1 remap to host.docker.internal in containers while non-local hosts remain unchanged
  • refreshed CI run 29253604840: all builds and all 10 integration matrix jobs passed, including the previously failing SHARD_D and copaw/hermes SHARD_A jobs

PYTHONPATH=copaw/src python3 -m pytest copaw/tests/test_bridge.py -q remains blocked during collection by the branch's pre-existing stale import of bridge_controller_to_copaw, before reaching the new test.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📊 CI Metrics Report

Summary

Metric Current Baseline Change
LLM Calls 102 81 +21 ↑ +25.9%
Input Tokens 2958894 2803871 +155023 ↑ +5.5%
Output Tokens 26552 16791 +9761 ↑ +58.1%
Total Tokens 2985446 2820662 +164784 ↑ +5.8%

By Role

Role Metric Current Baseline Change
🧠 Manager LLM Calls 56 68 -12 ↓ -17.6%
Input Tokens 1750039 2502214 -752175 ↓ -30.1%
Output Tokens 9438 13725 -4287 ↓ -31.2%
Total Tokens 1759477 2515939 -756462 ↓ -30.1%
🔧 Workers LLM Calls 46 13 +33 ↑ +253.8%
Input Tokens 1208855 301657 +907198 ↑ +300.7%
Output Tokens 17114 3066 +14048 ↑ +458.2%
Total Tokens 1225969 304723 +921246 ↑ +302.3%

Per-Test Breakdown

Test Mgr Calls Wkr Calls Δ Calls Mgr In Wkr In Mgr Out Wkr Out Δ Tokens Trend
02-create-worker 3 0 -9 ↓ -75.0% 82215 0 428 0 -275979 ↓ -77.0% ✅ improved
03-assign-task 13 6 +4 ↑ +26.7% 281906 143100 1528 1010 -46112 ↓ -9.7% ⚠️ regressed
04-human-intervene 8 0 -5 ↓ -38.5% 245425 0 1263 0 -186310 ↓ -43.0% ✅ improved
05-heartbeat 3 0 -4 ↓ -57.1% 96889 0 639 0 -177724 ↓ -64.6% ✅ improved
06-multi-worker 29 40 +35 ↑ +102.9% 1043604 1065755 5580 16104 +850909 ↑ +66.5% ⚠️ regressed

Trends

3 test(s) improved (fewer LLM calls)
⚠️ 2 test(s) regressed (more LLM calls)


Generated by HiClaw CI on 2026-07-13 14:09:34 UTC


📦 Download debug logs & test artifacts

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

❌ Integration Tests Failed (llm-interaction / mgr=copaw / wk=hermes)

Commit: 690b7ce
Workflow run: #1529

Test Results
No test output captured.
Debug Log (tail)
No debug logs available.

📦 Download full debug logs & test artifacts

@RerankerGuo
RerankerGuo force-pushed the fix/issue-907-copaw-local-provider-url branch from 56c2d86 to 690b7ce Compare July 10, 2026 02:16
@github-actions

Copy link
Copy Markdown
Contributor

❌ Integration Tests Failed (controller-cr-2 / mgr=copaw / wk=copaw)

Commit: 690b7ce
Workflow run: #1529

Test Results
No test output captured.
Debug Log (tail)
No debug logs available.

📦 Download full debug logs & test artifacts

@RerankerGuo
RerankerGuo force-pushed the fix/issue-907-copaw-local-provider-url branch from 690b7ce to a95c8c4 Compare July 13, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant