zai-org / zai-org/feedback

[Bug Report] ZCode Subagent 3GB+ RAM Memory Leak & profile.model Override Fallback

Open
#201 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Bug Summary & Technical Feedback

Community developer https://github.com/0Cymantek0 reported critical performance bugs and model resolution failures in the latest ZCode release:

1. 3GB+ RAM Memory Optimization Failure

Single subagents consume nearly 3GB+ RAM running basic non-intensive commands (e.g. grep searches) without build or compilation tasks.

2. Subagent Model Override Fallback Bug
  • Subagents ignore configured subagent models (profile.model) during child model resolution and fall back to the parent session default.
  • builtInModelOverrides loads settings correctly, but ZCode fails to apply profile.model during execution.
  • Model level aliases (haiku, sonnet, opus) exposed to the orchestrator model all resolve to the parent session default.
3. Community Workaround Script

Oxygen authored a temporary patch script (Set-ZCodeSubagentModels.ps1 & subagent-models.json) to enforce explicit subagent model mappings (ocg/glm-5.2).

More information on the patch user applied:
https://discordapp.com/channels/1346756824233148527/1531925713517543554/1531930066865356971


Regards,
Roman M.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported memory use with a basic grep command and reviewing the community workaround files Set-ZCodeSubagentModels.ps1 and subagent-models.json. Trace how builtInModelOverrides and profile.model are resolved for child subagents; done means memory use is reduced and configured models, including haiku, sonnet, and opus aliases, no longer fall back to the parent default.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
ai, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.