.claude/skills/openclaw-stale-session-and-identity-mismatch/SKILL.md
Fix OpenClaw agent repeatedly claiming a Google account "isn't authenticated" or failing with auth errors even though GWS tokens are valid. Use when: (1) GWS CLI works manually (`gws gmail users messages list --account X`) but OpenClaw agent says auth is missing, (2) Agent uses wrong email format (e.g., missing dots in Gmail address), (3) Agent keeps repeating stale beliefs about auth status despite fixes. Covers identity mismatch across config files and stale session cache clearing.
npx skillsauth add Dbochman/dotfiles openclaw-stale-session-and-identity-mismatchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
OpenClaw agent fails to use Google services (Gmail, Calendar, Drive) for a specific account,
claiming authentication is missing. The actual GWS CLI works fine when tested manually with
the correct --account flag. The root cause is typically a wrong email format in
OpenClaw's identity/config files combined with stale session history that preserves
the agent's incorrect belief.
[email protected] instead of [email protected])gws gmail users messages list --params '{"userId":"me","q":"is:unread","maxResults":1}' --account [email protected]GWS does strict email matching against its encrypted credentials. Gmail treats
[email protected] and [email protected] as the same mailbox, but
GWS stores credentials under the exact email used during OAuth. If any OpenClaw config
file has the wrong version, the agent will pass the wrong email to --account.
The wrong email can propagate across multiple files:
| File | What it affects |
|------|-----------------|
| ~/.openclaw/workspace/USER.md | Agent's identity context for contacts |
| ~/.openclaw/workspace/memory/*.md | Accumulated knowledge from past sessions |
| ~/.openclaw/cron/jobs.json | Scheduled tasks that use the email |
| ~/.openclaw/skills/gws-gmail/SKILL.md | Skill file with account examples |
| ~/.openclaw/skills/gws-calendar/SKILL.md | Skill file with account examples |
OpenClaw sessions are persistent JSONL files. Once the agent encounters an auth error, that failure becomes part of the conversation history. Even after fixing the email, the agent's compacted session context retains the "not authenticated" belief.
ssh dylans-mac-mini 'gws gmail users messages list --params "{\"userId\":\"me\",\"q\":\"is:unread\",\"maxResults\":1}" --account [email protected]'
ssh dylans-mac-mini 'gws auth list'
If this shows empty, test with an actual API call — the JS wrapper may use a stale cached binary.
# Find all files with the wrong email (exclude session .jsonl and .log files)
ssh dylans-mac-mini 'grep -rl "juliajoyjennings" ~/.openclaw/ 2>/dev/null | grep -v ".jsonl" | grep -v ".log"'
# Fix each file
ssh dylans-mac-mini 'sed -i "" "s/[email protected]/[email protected]/g" <files>'
Find the session ID for the affected contact:
ssh dylans-mac-mini "python3 -c '
import json
with open(\"/Users/dbochman/.openclaw/agents/main/sessions/sessions.json\") as f:
data = json.load(f)
for key, val in data.items():
if \"+1XXXXXXXXXX\" in key: # Replace with contact phone number
print(\"Key:\", key)
print(\"SessionId:\", val.get(\"sessionId\"))
print(\"File:\", val.get(\"sessionFile\"))
'"
Delete the session file and remove from sessions.json:
# Delete session file
ssh dylans-mac-mini 'rm ~/.openclaw/agents/main/sessions/<sessionId>.jsonl'
# Remove from sessions.json
ssh dylans-mac-mini "python3 -c '
import json
path = \"/Users/dbochman/.openclaw/agents/main/sessions/sessions.json\"
with open(path) as f:
data = json.load(f)
key = \"agent:main:imessage:dm:+1XXXXXXXXXX\"
if key in data:
del data[key]
with open(path, \"w\") as f:
json.dump(data, f, indent=2)
print(\"Removed\", key)
'"
Have the contact send a new message. The agent will create a fresh session and read the corrected email from the skill files.
exec tool calls with correct emailgws auth login.~/.config/gws/ — per-account files
named credentials.<base64>.enc. The .encryption_key file must also be present..encryption_key + accounts.json to Mini.gws auth logout without --account <email> nukes ALL accounts.tools
Use exact configured Reolink cameras through the local Home Hub for availability and power status, fresh stills, visual commentary, protected Dylan/Julia/household sharing, and reversible spotlight control. Supports trusted owner tasks and explicitly scoped proactive automations; not for Nest or Ring cameras, arbitrary recipients, recordings, account changes, or raw camera APIs.
data-ai
Privately manage Dylan and Julia's household plant inventory and care history by physical location, bed, and exact Flower Cam view. Use for confirmed plant onboarding from camera conversations, camera- or bed-filtered inventory, record corrections, individual or whole-bed care, and private filtered exports. Pair with reolink-camera when an owner asks about plants visible in Flower Cam images.
testing
Inspect and control the physically secured Reachy Mini at Crosstown through ClawBody. Use for requests to check Reachy, look around, express an emotion, play any official emotion or dance preset, speak proactively, mute or unmute its microphone, stop movement, or describe what its camera sees.
tools
Handle Reachy/iMessage handoffs, selective durable memory, forgetting, and diagnostics; automatic context comes from the gateway plugin.