Skip to content

Fix worker status schema inconsistency between --name and --team modes - #1101

Open
RerankerGuo wants to merge 2 commits into
agentscope-ai:mainfrom
RerankerGuo:fix/issue-1098-worker-status-schema
Open

Fix worker status schema inconsistency between --name and --team modes#1101
RerankerGuo wants to merge 2 commits into
agentscope-ai:mainfrom
RerankerGuo:fix/issue-1098-worker-status-schema

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

Summary

  • Bug fix: agt worker status --name X and agt worker status --team Y returned schema-inconsistent JSON for the same worker
  • GetWorkerRuntimeStatus was missing team/member enrichment (team, role, roomID, matrixUserID fields) that GetWorker and ListWorkers already provided
  • Fixed by adding findTeamMember + applyTeamMember in GetWorkerRuntimeStatus to populate team member context consistently

Changes

  • agentteams-controller/internal/server/lifecycle_handler.go: Added team member lookup in GetWorkerRuntimeStatus
  • agentteams-controller/internal/server/lifecycle_handler_test.go: Added 2 unit tests (team member info + standalone worker)
  • agentteams-controller/go.mod: Fixed go version format (1.25.0 -> 1.25)
  • changelog/current.md: Added changelog entry

Test plan

  • Unit tests for TestLifecycleWorkerStatusIncludesTeamMemberInfo and TestLifecycleWorkerStatusStandaloneNoTeamInfo
  • gofmt syntax validation
  • CI run on GitHub

Closes #1098

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@RerankerGuo
RerankerGuo force-pushed the fix/issue-1098-worker-status-schema branch from 8fac0b6 to a36e1fd Compare July 30, 2026 00:53

@shiyiyue1102 shiyiyue1102 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for working on this. The current head (a36e1fdb) does not compile: GetWorkerRuntimeStatus calls h.findTeamMember and h.applyTeamMember, but those methods exist only on ResourceHandler, and the added tests use the removed WorkerMemberRef and map-shaped TeamStatus.Members. Please rebase on the current main, implement or reuse team enrichment for LifecycleHandler with the current TeamWorkerRef / []TeamMemberStatus types, and drop the unrelated go.mod change unless it is separately justified.

The regression test should compare both the --name and --team response paths with non-empty personal roomID and TeamRoomID, and verify the intended v1.2 contract: a member’s roomID is the personal communication room, while the shared room is Team.Status.TeamRoomID. Please also cover the remaining schema difference around message, since --team -o json currently returns the list response without runtime-status aggregation.


感谢修复这个问题。当前 HEAD(a36e1fdb)无法编译:GetWorkerRuntimeStatus 调用了 h.findTeamMemberh.applyTeamMember,但这些方法只存在于 ResourceHandler;新增测试还使用了已删除的 WorkerMemberRef 和 map 结构的 TeamStatus.Members。请先基于当前 main rebase,使用当前的 TeamWorkerRef / []TeamMemberStatusLifecycleHandler 正确实现或复用 Team 信息补全逻辑;无关的 go.mod 修改如无独立理由也请移除。

回归测试应使用非空的个人 roomIDTeamRoomID,直接比较 --name--team 两条响应路径,并锁定 v1.2 的语义:成员 roomID 是个人通信房间,共享房间是 Team.Status.TeamRoomID。另外也请覆盖剩余的 message 字段差异,因为当前 --team -o json 直接返回列表响应,没有聚合 runtime status。

The GetWorkerRuntimeStatus handler was missing team/member enrichment
that GetWorker and ListWorkers already provided via applyTeamMember.
This caused agt worker status --name X and agt worker status --team Y
to return schema-inconsistent JSON for the same worker (missing team,
role, roomID, and matrixUserID fields).

Fix: apply findTeamMember + applyTeamMember in GetWorkerRuntimeStatus
to populate team member context consistently across all worker status
endpoints.

Closes agentscope-ai#1098
@RerankerGuo

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback and force-pushed a clean rebase onto current main (ad46cd8).

Changes:

  • removed the unrelated go.mod edit;
  • reused package-level Team-member enrichment from both ResourceHandler and LifecycleHandler, using current TeamWorkerRef and []TeamMemberStatus contracts;
  • kept member roomID as the personal communication room and verified it does not use Team.Status.TeamRoomID;
  • changed agt worker status --team to resolve each member through the same runtime-status endpoint used by --name, including JSON output, so backend message and containerState no longer diverge;
  • added regression coverage that directly compares the --name and --team worker objects, with non-empty personal room, Team room, Matrix ID, role, and backend message.

Verification:

  • go test ./internal/server ./cmd/agt (Go 1.25.0)
  • git diff --check

@RerankerGuo
RerankerGuo force-pushed the fix/issue-1098-worker-status-schema branch from a36e1fd to ad46cd8 Compare July 31, 2026 02:04
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.

hiclaw worker status --name X and --team Y return schema-inconsistent JSON (and different roomID) for the same worker

2 participants