Skip to content

fix(copaw): retry prompt reads during worker startup#979

Open
RerankerGuo wants to merge 1 commit into
agentscope-ai:mainfrom
RerankerGuo:fix/issue-711-copaw-prompt-read-race
Open

fix(copaw): retry prompt reads during worker startup#979
RerankerGuo wants to merge 1 commit into
agentscope-ai:mainfrom
RerankerGuo:fix/issue-711-copaw-prompt-read-race

Conversation

@RerankerGuo

Copy link
Copy Markdown

Summary

  • add a bounded stable UTF-8 prompt reader for CoPaw worker SOUL.md / AGENTS.md materialization
  • use it during startup and config re-bridge so transient mc mirror/read races do not crash the worker
  • add focused unit coverage and changelog entry

Tests

  • git diff --check
  • python3 -m py_compile copaw/src/copaw_worker/worker.py copaw/tests/test_worker_health.py
  • not run: python3 -m pytest copaw/tests/test_worker_health.py -q (pytest is not installed in this environment)

Fixes #711.
Also addresses #728.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📊 CI Metrics Report

Summary

Metric Current Baseline Change
LLM Calls 132 81 +51 ↑ +63.0%
Input Tokens 3343825 2803871 +539954 ↑ +19.3%
Output Tokens 33300 16791 +16509 ↑ +98.3%
Total Tokens 3377125 2820662 +556463 ↑ +19.7%

By Role

Role Metric Current Baseline Change
🧠 Manager LLM Calls 88 68 +20 ↑ +29.4%
Input Tokens 2211583 2502214 -290631 ↓ -11.6%
Output Tokens 15233 13725 +1508 ↑ +11.0%
Total Tokens 2226816 2515939 -289123 ↓ -11.5%
🔧 Workers LLM Calls 44 13 +31 ↑ +238.5%
Input Tokens 1132242 301657 +830585 ↑ +275.3%
Output Tokens 18067 3066 +15001 ↑ +489.3%
Total Tokens 1150309 304723 +845586 ↑ +277.5%

Per-Test Breakdown

Test Mgr Calls Wkr Calls Δ Calls Mgr In Wkr In Mgr Out Wkr Out Δ Tokens Trend
02-create-worker 9 0 -3 ↓ -25.0% 246069 0 1020 0 -111533 ↓ -31.1% ✅ improved
03-assign-task 6 0 -9 ↓ -60.0% 176112 0 1140 0 -296404 ↓ -62.6% ✅ improved
04-human-intervene 10 10 +7 ↑ +53.8% 249626 246541 1872 1342 +66383 ↑ +15.3% ⚠️ regressed
05-heartbeat 6 4 +3 ↑ +42.9% 166631 105179 1132 876 -1434 ↓ -0.5% ⚠️ regressed
06-multi-worker 57 30 +53 ↑ +155.9% 1373145 780522 10069 15849 +899451 ↑ +70.3% ⚠️ regressed

Trends

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


Generated by HiClaw CI on 2026-07-08 06:52:27 UTC


📦 Download debug logs & test artifacts

@RerankerGuo RerankerGuo force-pushed the fix/issue-711-copaw-prompt-read-race branch from fef990e to c29cbdb Compare July 8, 2026 05:48
@RerankerGuo

Copy link
Copy Markdown
Author

@shiyiyue1102 Hi! This PR addresses #711 / #728. Just rebased onto current main (was conflicting) — CI is now green (18/18). Adds bounded stable UTF-8 reads for SOUL.md / AGENTS.md during CoPaw startup and re-bridge, with replacement-decoding fallback. Could you take a look when convenient?

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.

[Bug] copaw worker can crash reading partially-written merged AGENTS.md during apply --zip update

1 participant