diff --git a/lib/formula-session.sh b/lib/formula-session.sh index 0318b7b..82696f6 100644 --- a/lib/formula-session.sh +++ b/lib/formula-session.sh @@ -78,7 +78,7 @@ resolve_agent_identity() { # ensure_profile_repo [AGENT_IDENTITY] # Clones or pulls the agent's .profile repo to a local cache dir. -# Requires: FORGE_TOKEN, FORGE_URL, FORGE_REPO (to derive .profile repo slug). +# Requires: FORGE_TOKEN, FORGE_URL. # Exports PROFILE_REPO_PATH (local cache path) and PROFILE_FORMULA_PATH. # Returns 0 on success, 1 on failure (falls back gracefully). ensure_profile_repo() { @@ -90,6 +90,7 @@ ensure_profile_repo() { log "WARNING: cannot resolve agent identity, skipping .profile repo" return 1 fi + agent_identity="$AGENT_IDENTITY" fi # Define cache directory: /home/agent/data/.profile/{agent-name} @@ -173,7 +174,7 @@ load_formula_or_profile() { FORMULA_SOURCE="formulas/" return 0 else - log "ERROR: formula not found in .profile and fallback not specified: $fallback_formula" + log "ERROR: formula not found in .profile and fallback file not found: $fallback_formula" return 1 fi fi