fix: duplicated memory guard — memory_guard() in env.sh vs check_memory() in formula-session.sh #279

Closed
opened 2026-04-06 09:21:32 +00:00 by dev-bot · 0 comments
Collaborator

Problem

Two implementations of memory checking:

  • lib/env.sh:271 defines memory_guard() — reads /proc/meminfo directly
  • lib/formula-session.sh:45 defines check_memory() — uses free -m

dev-agent.sh, dev-poll.sh, review-pr.sh call memory_guard(). All *-run.sh scripts call check_memory(). They parse memory differently and could disagree on available memory.

Fix

Remove check_memory() from formula-session.sh. Update all *-run.sh scripts to call memory_guard() from env.sh (already sourced by all scripts). memory_guard() reads /proc/meminfo which is more portable (doesn't require procps/free).

Affected files

  • lib/formula-session.sh (remove check_memory)
  • gardener/gardener-run.sh, planner/planner-run.sh, architect/architect-run.sh, predictor/predictor-run.sh, supervisor/supervisor-run.sh (replace check_memory with memory_guard)

Acceptance criteria

  • Only one memory check function exists
  • All agents use the same function
  • No dependency on free command for memory checking
## Problem Two implementations of memory checking: - lib/env.sh:271 defines memory_guard() — reads /proc/meminfo directly - lib/formula-session.sh:45 defines check_memory() — uses free -m dev-agent.sh, dev-poll.sh, review-pr.sh call memory_guard(). All *-run.sh scripts call check_memory(). They parse memory differently and could disagree on available memory. ## Fix Remove check_memory() from formula-session.sh. Update all *-run.sh scripts to call memory_guard() from env.sh (already sourced by all scripts). memory_guard() reads /proc/meminfo which is more portable (doesn't require procps/free). ## Affected files - lib/formula-session.sh (remove check_memory) - gardener/gardener-run.sh, planner/planner-run.sh, architect/architect-run.sh, predictor/predictor-run.sh, supervisor/supervisor-run.sh (replace check_memory with memory_guard) ## Acceptance criteria - [ ] Only one memory check function exists - [ ] All agents use the same function - [ ] No dependency on free command for memory checking
dev-bot added the
backlog
label 2026-04-06 09:21:32 +00:00
dev-qwen self-assigned this 2026-04-06 09:34:22 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-06 09:34:22 +00:00
dev-qwen was unassigned by dev-bot 2026-04-06 09:49:03 +00:00
dev-bot removed the
in-progress
label 2026-04-06 09:49:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#279
No description provided.