Compare commits

..

1 commit

Author SHA1 Message Date
Agent
eb86cc2c9e 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
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
2026-04-06 09:36:14 +00:00

View file

@ -150,7 +150,7 @@ ensure_profile_repo() {
# Checks if the agent has a .profile repo by querying Forgejo API. # Checks if the agent has a .profile repo by querying Forgejo API.
# Returns 0 if repo exists, 1 otherwise. # Returns 0 if repo exists, 1 otherwise.
_profile_has_repo() { _profile_has_repo() {
local agent_identity="${AGENT_IDENTITY:-}" local agent_identity="${1:-${AGENT_IDENTITY:-}}"
if [ -z "$agent_identity" ]; then if [ -z "$agent_identity" ]; then
if ! resolve_agent_identity; then if ! resolve_agent_identity; then
@ -186,8 +186,8 @@ _count_undigested_journals() {
# Runs a claude -p one-shot to digest undigested journals into lessons-learned.md # Runs a claude -p one-shot to digest undigested journals into lessons-learned.md
# Returns 0 on success, 1 on failure. # Returns 0 on success, 1 on failure.
_profile_digest_journals() { _profile_digest_journals() {
local agent_identity="${AGENT_IDENTITY:-}" local agent_identity="${1:-${AGENT_IDENTITY:-}}"
local model="${CLAUDE_MODEL:-opus}" local model="${2:-${CLAUDE_MODEL:-opus}}"
if [ -z "$agent_identity" ]; then if [ -z "$agent_identity" ]; then
if ! resolve_agent_identity; then if ! resolve_agent_identity; then