Skip to content

Use ByteSize for memory config#60

Merged
JAORMX merged 1 commit intomainfrom
jaosorior/memory-bytesize
Mar 18, 2026
Merged

Use ByteSize for memory config#60
JAORMX merged 1 commit intomainfrom
jaosorior/memory-bytesize

Conversation

@JAORMX
Copy link
Copy Markdown
Contributor

@JAORMX JAORMX commented Mar 17, 2026

Summary

  • Change DefaultsConfig.Memory and AgentOverride.Memory from uint32 to ByteSize, matching the existing TmpSize pattern
  • Update --memory CLI flag from Uint32Var to StringVar with ParseByteSize(), so users write --memory 4g instead of --memory 4096
  • Update MaxMemory constant to ByteSize and adapt clampResources() and Merge() accordingly
  • Update docs and config examples to use human-readable format ("4g", "512m")

Bare integers in YAML config are still accepted (backward compatible via ByteSize.UnmarshalText).

Test plan

  • task fmt && task lint — 0 issues
  • task test — all tests pass
  • Manual: verify bbox claude-code --memory 4g works
  • Manual: verify memory: "4g" in config.yaml works
  • Manual: verify bare integer memory: 4096 still works (backward compat)

🤖 Generated with Claude Code

Memory (RAM) for VMs was configured as raw uint32 in MiB while
tmp_size already used the human-readable ByteSize type. This
unifies them so users write `memory: "4g"` instead of `memory: 4096`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

Clean change, consistent with the tmp_size pattern. A couple of small things inline.

Copy link
Copy Markdown
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

Looks good — the inline comments are just nits, fine to fix later.

@JAORMX JAORMX enabled auto-merge (squash) March 18, 2026 07:12
@JAORMX JAORMX merged commit edd0257 into main Mar 18, 2026
7 checks passed
@JAORMX JAORMX deleted the jaosorior/memory-bytesize branch March 18, 2026 07:12
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.

2 participants