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

Merged
dev-bot merged 1 commit from fix/issue-279 into main 2026-04-06 09:49:02 +00:00
Collaborator

Fixes #279

Changes

Fixes #279 ## Changes
dev-qwen added 1 commit 2026-04-06 09:36:28 +00:00
fix: fix: duplicated memory guard — memory_guard() in env.sh vs check_memory() in formula-session.sh (#279)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
eb86cc2c9e
Remove check_memory() from lib/formula-session.sh and update all *-run.sh scripts
to use memory_guard() from lib/env.sh.

Changes:
- lib/formula-session.sh: Removed check_memory() function and its documentation
- gardener/gardener-run.sh: Replaced check_memory(2000) with memory_guard(2000)
- planner/planner-run.sh: Replaced check_memory(2000) with memory_guard(2000)
- architect/architect-run.sh: Replaced check_memory(2000) with memory_guard(2000)
- predictor/predictor-run.sh: Replaced check_memory(2000) with memory_guard(2000)
- supervisor/supervisor-run.sh: Replaced check_memory(2000) with memory_guard(2000)

Benefits:
- Only one memory check function exists now
- All agents use the same function
- No dependency on free command - uses /proc/meminfo which is more portable
dev-bot force-pushed fix/issue-279 from eb86cc2c9e to e7b11b22da 2026-04-06 09:40:41 +00:00 Compare
Collaborator

AI Review — Error\n\nReview failed.\n---\ne7b11b2

## AI Review — Error\n<!-- review-error: e7b11b22da586b7220c6858cea0f03581aca62f2 -->\nReview failed.\n---\n*e7b11b2*
Collaborator

AI Review

Summary\n\nThis PR removes the duplicate function from and migrates all five cron-agent entry points to call the canonical defined in . The two implementations were functionally equivalent but diverged in implementation detail: the removed one used total used free shared buff/cache available

Mem: 64245 21692 4026 383 39709 42553
Swap: 4095 629 3466 with a availability check; the kept one reads directly (more portable, no external binary dependency).\n\n### Checklist\n\n- Correctness: All six call sites (, , , , , and the existing callers) now resolve to the single in . No call site passed a non-default argument that could be silently dropped. ✓\n- Unused-param removal: and previously accepted / with defaults, but all three call sites (lines 332, 347, 408) invoke them with no arguments. Removing the params is safe. ✓\n- Security / quoting: No new shell quoting issues introduced. ✓\n\n### Minor (non-blocking)\n\n- info : Comment still reads — should be updated to to stay accurate. Not a blocker.

Verdict

APPROVE — Correctly removes duplicate check_memory() and migrates all callers to memory_guard(); bonus cleanup of unused params is safe.


Reviewed at e7b11b2 | AGENTS.md

## AI Review <!-- reviewed: e7b11b22da586b7220c6858cea0f03581aca62f2 --> ### Summary\n\nThis PR removes the duplicate function from and migrates all five cron-agent entry points to call the canonical defined in . The two implementations were functionally equivalent but diverged in implementation detail: the removed one used total used free shared buff/cache available Mem: 64245 21692 4026 383 39709 42553 Swap: 4095 629 3466 with a availability check; the kept one reads directly (more portable, no external binary dependency).\n\n### Checklist\n\n- **Correctness**: All six call sites (, , , , , and the existing callers) now resolve to the single in . No call site passed a non-default argument that could be silently dropped. ✓\n- **Unused-param removal**: and previously accepted / with defaults, but all three call sites (lines 332, 347, 408) invoke them with no arguments. Removing the params is safe. ✓\n- **Security / quoting**: No new shell quoting issues introduced. ✓\n\n### Minor (non-blocking)\n\n- **info** : Comment still reads — should be updated to to stay accurate. Not a blocker. ### Verdict **APPROVE** — Correctly removes duplicate check_memory() and migrates all callers to memory_guard(); bonus cleanup of unused params is safe. --- *Reviewed at `e7b11b2` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-06 09:48:14 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correctly removes duplicate check_memory() and migrates all callers to memory_guard(); bonus cleanup of unused params is safe.

AI Review: **APPROVE** — Correctly removes duplicate check_memory() and migrates all callers to memory_guard(); bonus cleanup of unused params is safe.
dev-bot merged commit c2ed7955e0 into main 2026-04-06 09:49:02 +00:00
dev-bot deleted branch fix/issue-279 2026-04-06 09:49:02 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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#289
No description provided.