Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Record image-affecting changes to `manager/`, `worker/`, `copaw/`, `hermes/`, `o

**Bug Fixes**

- **CoPaw k8s worker static alias fallback**: When running in local K8s with self-hosted MinIO, `_ensure_alias()` now falls through to static `mc alias set` if `MC_HOST_{alias}` is not already set by the cloud STS path. Fixes #957.
- **Team Worker room boundary convergence**: Remove Manager again after standalone Worker infrastructure reconciliation restores regular Team Worker personal-room membership. ([b5b0add](https://github.com/agentscope-ai/AgentTeams/commit/b5b0add))
- **Team Worker reference enforcement**: Keep referenced Worker CRs protected during direct deletion and reject Team API members whose required role is empty. ([d96f1ed](https://github.com/agentscope-ai/AgentTeams/commit/d96f1ed))
- **Team Worker room membership**: Force Manager out of regular Team Worker personal rooms when equal Matrix power levels prevent a normal kick. ([43545c2](https://github.com/agentscope-ai/AgentTeams/commit/43545c2))
Expand Down
14 changes: 11 additions & 3 deletions copaw/src/copaw_worker/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,17 @@ def _ensure_alias(self) -> None:
controller_url,
)
if self._k8s_mode:
logger.info("_ensure_alias: k8s mode, skipping mc alias set (mc-wrapper handles credentials)")
self._alias_set = True
return
if mc_host_set:
logger.info(
"_ensure_alias: k8s mode, MC_HOST_%s already set (cloud STS), skipping mc alias set",
_MC_ALIAS,
)
self._alias_set = True
return
logger.info(
"_ensure_alias: k8s mode, MC_HOST_%s not set (local MinIO), falling through to static alias setup",
_MC_ALIAS,
)
if self._cloud_mode:
logger.info("_ensure_alias: credential path=sts, refreshing MC_HOST_%s", _MC_ALIAS)
self._refresh_cloud_credentials()
Expand Down
26 changes: 26 additions & 0 deletions copaw/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,3 +527,29 @@ async def test_push_loop_reports_bridge_failure_as_bridge_health(tmp_path, monke
assert message == "runtime-to-standard bridge failed: runtime bridge failed"
assert details["operation"] == "bridge_runtime_to_standard"
assert details["error_type"] == "BridgeRuntimeError"


def test_ensure_alias_k8s_with_mc_host_set_skips_static(monkeypatch, tmp_path):
monkeypatch.setenv("AGENTTEAMS_RUNTIME", "k8s")
monkeypatch.setenv("MC_HOST_agentteams", "http://key:secret@minio:9000")
sync = _sync(tmp_path)
sync._ensure_alias()
assert sync._alias_set is True


def test_ensure_alias_k8s_without_mc_host_falls_through_static(monkeypatch, tmp_path):
monkeypatch.setenv("AGENTTEAMS_RUNTIME", "k8s")
monkeypatch.delenv("MC_HOST_agentteams", raising=False)
sync = _sync(tmp_path)
monkeypatch.setattr("copaw_worker.sync._mc", lambda *_args, **_kwargs: None)
sync._ensure_alias()
assert sync._alias_set is True


def test_ensure_alias_non_k8s_uses_static(monkeypatch, tmp_path):
monkeypatch.delenv("AGENTTEAMS_RUNTIME", raising=False)
monkeypatch.delenv("MC_HOST_agentteams", raising=False)
sync = _sync(tmp_path)
monkeypatch.setattr("copaw_worker.sync._mc", lambda *_args, **_kwargs: None)
sync._ensure_alias()
assert sync._alias_set is True