- OAuth authentication via Authentik - WebSocket connection to OpenClaw gateway - Configurable gateway URL with first-run setup - User preferences sync across devices - Multi-user support with custom assistant names - ElevenLabs TTS integration (local + remote) - FCM push notifications for alarms - Voice input via Google Speech API - No hardcoded secrets or internal IPs in tracked files
6.8 KiB
Additional Fixes - 2026-02-04 (Part 2)
Time: 08:20 PST
Issues: Alarm tool + Network reconnection
Issue 1: Alfred Using Wrong Alarm Tool ✅
Problem
When user asked Alfred to "set an alarm" from within the mobile app, no alarm was delivered. Testing showed manual alfred-notify commands worked fine, indicating Alfred was using the wrong tool.
Root Cause
The alarms skill was using outdated code:
- Wrong command: Used old
mobile-notify alarmvia curl wrapper instead ofalfred-notify - Wrong cron format: Used
--session main --system-eventinstead ofisolated+agentTurn - Wrong priority: Used
priority: defaultinstead ofpriority: highfor alarms
Files Modified
-
~/.openclaw/workspace/skills/alarms/send-alarm-curl.sh
- Changed from curl API call to
alfred-notifyCLI - Before:
curl -X POST http://localhost:18790/api/notify ... - After:
alfred-notify --alarm --title "🔔 Alarm" "$MESSAGE"
- Changed from curl API call to
-
~/.openclaw/workspace/skills/alarms/alarms
- Complete rewrite of cron job creation logic
- Changed from:
--session main --system-event - Changed to:
sessionTarget: "isolated"withagentTurnpayload - Now uses proper JSON format for cron jobs
- Commands execute
alfred-notifydirectly from cron
-
~/.openclaw/workspace/skills/alarms/SKILL.md
- Updated documentation to reflect
alfred-notifyusage - Documented correct cron format (isolated + agentTurn)
- Removed references to old
mobile-notifycommand
- Updated documentation to reflect
Code Changes
Before (wrong):
// Used curl wrapper with system event (doesn't execute commands)
const systemEvent = `nohup ${wrapperPath} "${message}" >/dev/null 2>&1 &`;
const cmd = `openclaw cron add --session main --system-event '${systemEvent}' ...`;
After (correct):
// Uses alfred-notify in isolated session with agentTurn
const cronData = {
name: `alarm:${message}`,
schedule: { kind: "at", atMs: timestamp },
payload: {
kind: "agentTurn",
message: `Run: ~/.openclaw/workspace/alfred-proxy/alfred-notify --alarm --title "🔔 Alarm" "${message}"`,
deliver: false
},
sessionTarget: "isolated",
enabled: true
};
Testing
Before fix:
User: "Set an alarm for 5 minutes"
Alfred: [creates cron job]
Result: ❌ No alarm delivered (systemEvent doesn't execute commands)
After fix:
User: "Set an alarm for 5 minutes"
Alfred: [creates cron job with agentTurn]
Result: ✅ Alarm delivered via FCM after 5 minutes
Issue 2: App Reconnecting Without Network ✅
Problem
When tablet was locked/asleep with no network connection, the app would:
- Continuously attempt to reconnect every 5-10 seconds
- Increment retry counter even though network was unavailable
- Eventually hit max retry limit (10 attempts)
- Give up completely, requiring manual app restart
This was wasteful and meant the app wouldn't reconnect when network returned.
Root Cause
In GatewayClient.kt, the reconnection logic checked for network availability but still incremented reconnectAttempts even when network was down:
if (!isNetworkAvailable()) {
// ...
reconnectAttempts++ // ❌ Wrong! Counting network outage as failed attempt
// ...
}
Solution
Don't increment reconnectAttempts when network is unavailable - only count actual connection attempts:
if (!isNetworkAvailable()) {
// Use fixed 10-second delay
// Don't increment reconnectAttempts
val delay = 10000L
Log.d(TAG, "Network unavailable - will check again in ${delay}ms (not counting as retry attempt)")
// ...
}
Benefits
- Unlimited network checks: App can wait indefinitely for network to return
- Preserves retry budget: Only actual connection failures count toward max retries
- Battery efficient: 10-second check interval is reasonable
- Auto-recovery: When network returns, app automatically connects
Files Modified
alfred-mobile/app/src/main/java/com/openclaw/alfred/gateway/GatewayClient.kt- Line ~132: Removed
reconnectAttempts++from network unavailable branch - Changed to fixed 10-second delay instead of exponential backoff
- Updated log message to clarify it's not a retry attempt
- Line ~132: Removed
Behavior Comparison
Before:
Network down → Wait 5s → Check (attempt 1/10)
Network down → Wait 10s → Check (attempt 2/10)
Network down → Wait 20s → Check (attempt 3/10)
...
Network down → Wait 30s → Check (attempt 10/10)
Network down → Give up ❌
[Network returns but app won't reconnect]
After:
Network down → Wait 10s → Check (no attempt counted)
Network down → Wait 10s → Check (no attempt counted)
Network down → Wait 10s → Check (no attempt counted)
...
[Continues indefinitely]
Network returns → Connects automatically ✅
Additional Documentation Updates
No additional documentation needed - these were implementation bugs rather than feature changes.
Testing Checklist
Alarm Tool Fix
- Manual
alfred-notifyworks - Ask Alfred to "set an alarm for 1 minute" from app
- Verify alarm delivered after 1 minute
- Check cron job format:
openclaw cron list --json
Network Reconnection Fix
- Lock tablet
- Turn off WiFi
- Wait > 10 reconnection cycles (> 2 minutes)
- Turn WiFi back on
- Verify app reconnects automatically
- Check logs: retry attempts should not have exceeded limit
Deployment
Alarm Tool
- ✅ Fixed skill files already in place
- ✅ No app rebuild needed (server-side fix)
- ✅ Will take effect on next alarm Alfred creates
Network Reconnection
- ⏳ Requires app rebuild and install
- Code changes already applied
- Need to build and deploy:
cd alfred-mobile export JAVA_HOME=~/android-dev/jdk-17.0.2 export ANDROID_HOME=~/android-dev/android-sdk ./gradlew assembleDebug adb install -r app/build/outputs/apk/debug/app-debug.apk
Impact
Alarm Tool Fix
- Severity: HIGH - Core functionality broken
- User Impact: Unable to set alarms via voice/chat
- Resolution: Immediate - works as soon as skill is fixed
- Workaround: Manual
alfred-notifycommands worked
Network Reconnection Fix
- Severity: MEDIUM - Quality of life issue
- User Impact: App stops reconnecting after device sleep
- Resolution: Requires app update
- Workaround: Manual app restart after network returns
Next Steps
- Rebuild and install app with network fix
- Test alarm creation via Alfred chat
- Test network recovery by toggling WiFi while locked
- Monitor for 24 hours to verify stability
- Update android-app-todo.md if any issues found
Status: ✅ Both fixes implemented and ready for testing
App rebuild required: Yes (for network fix only)
Server changes: Done (alarm tool fix)