Skip to content

fix(manager): restore worker settings after restart - #1225

Open
014-code wants to merge 3 commits into
agentscope-ai:mainfrom
014-code:fix/worker-settings-restore
Open

fix(manager): restore worker settings after restart#1225
014-code wants to merge 3 commits into
agentscope-ai:mainfrom
014-code:fix/worker-settings-restore

Conversation

@014-code

@014-code 014-code commented Sep 4, 2026

Copy link
Copy Markdown

Closes #575

Summary

  • Remove the Manager startup legacy Worker recreation loop; controller reconciliation owns backend recovery.
  • Preserve Worker.spec.env when the controller recreates a missing backend.
  • Add Manager startup regression coverage and an integration assertion for settings preservation.

Root cause

Manager rebuilt existing Workers from persisted credentials only, which omitted user settings and could race controller reconciliation during restart or upgrade. The controller already has the complete Worker spec and is the correct owner for recovery.

Validation

  • bash manager/tests/test-manager-startup-recovery.sh
  • bash -n manager/scripts/init/start-manager-agent.sh
  • go test ./test/integration/controller (envtest)
  • Targeted Go tests: internal/controller, internal/server, internal/service, cmd/agt

@oss-maintainer oss-maintainer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Removes the Manager startup legacy Worker recreation loop (controller reconciliation owns backend recovery) and adds regression coverage; core change is sound — verified against main: the controller's backend recreation already merges Worker.spec.Env into the backend Create request, and the integration mock exposes FindCreateReq with the recorded Env, so the new assertion is valid. One wiring gap noted below.

Findings

  • [Warning] manager/tests/test-manager-startup-recovery.sh:1 — the new regression script is not invoked by any Makefile target or GitHub workflow, so it never runs in CI

Suggestions

Wire manager/tests/test-manager-startup-recovery.sh into an existing test target/workflow so the "controller owns Worker recovery" invariant is actually enforced on future changes.


Automated review by github-manager-bot

Comment thread manager/tests/test-manager-startup-recovery.sh
@014-code

014-code commented Sep 4, 2026

Copy link
Copy Markdown
Author

Addressed in commit 1f640c2. The Manager startup recovery regression is now invoked by the existing Helm Lint workflow, and both the startup script and regression test are included in that workflow's path filters. This keeps the check lightweight and independent of the integration test matrix. Local validation: regression 5/5, bash -n, YAML parse, and git diff --check passed.

@oss-maintainer oss-maintainer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — the follow-up commit (1f640c2) addresses the earlier CI-wiring feedback: manager/tests/test-manager-startup-recovery.sh is now invoked by the Helm Lint workflow, with both the startup script and the regression test included in its pull_request path filters.

Verified against main:

  • Controller backend recreation passes Worker.spec.Env into the backend Create request (internal/controller/member_reconcile.go), so recovery owned by the controller preserves worker settings; the new TestWorkerPodDeleted_Recreates assertion (FindCreateReq + env check) covers this.
  • Docker local deployment still runs the agentteams-controller container, so removing the Manager-startup recreation loop leaves recovery coverage in socket mode.
  • The regression script itself is a sound static guard (grep assertions + bash -n) for the startup path.

Note for maintainers: the follow-up workflow runs on this fork PR currently sit in action_required and need approval by someone with repo admin rights, which I don't have.


Automated review by github-manager-bot

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.

升级后,worker容器不能恢复原来的设置 || After the upgrade, the worker container cannot restore its original settings.

2 participants