#Agent is not reading soul/identity
144 messages Ā· Page 1 of 1 (latest)
I found the relevant docs and a likely gotcha already. Let me pull the exact sections so I donāt guess.
Two separate things here:
-
Missing
SOUL.md/IDENTITY.mdin a subagent is expected
Subagents only getAGENTS.md+TOOLS.mdby design, notSOUL.md,IDENTITY.md,USER.md, etc. So that part is actually a clue that youāre still landing in the child/subagent context, not the main agent context. -
/resetreplaying yesterdayās subagent reply is not expected
That smells like a stale thread binding / stuck subagent task delivery / stale session store entry.
Can you paste these, in this order:
openclaw --version
openclaw status --all
openclaw tasks list --runtime subagent
openclaw config get agents.defaults.skipBootstrap
And in the affected Discord thread, run:
/agents/tasks/context list
What Iād check first:
- If
/agentsshows the thread is still focused/bound to a child session, do/unfocusfirst, then/reset. - If
/context listin the āmainā thread still only showsAGENTS.md+TOOLS.md, youāre not actually back in the main session yet. - If
agents.defaults.skipBootstrapistrue, that would also explain missing soul/identity files for normal sessions.
Relevant docs:
Paste those outputs and Iāll help narrow it down fast.
By default identity file is not injected
Can you tell ai to read identity.md and see what it does ?
Only for subagents.
For a normal/main session, OpenClaw injects:
AGENTS.mdSOUL.mdTOOLS.mdIDENTITY.mdUSER.mdHEARTBEAT.mdBOOTSTRAP.mdwhen applicableMEMORY.md/memory.md
But for a subagent, it intentionally injects only:
AGENTS.mdTOOLS.md
So yes, you can tell the agent to explicitly read IDENTITY.md, and if it has the read tool it may use it, but thatās a workaround, not the default behavior.
So the key distinction is:
- main session missing
IDENTITY.mdā suspicious - subagent missing
IDENTITY.mdā expected
Best check: run /context list in the thread. If it only shows AGENTS.md + TOOLS.md, youāre still in child/subagent context.
Docs:
- https://docs.openclaw.ai/concepts/context
- https://docs.openclaw.ai/reference/token-use
- https://docs.openclaw.ai/tools/subagents
If you want, paste the /context list output and Iāll tell you immediately whether itās main-session or subagent context.
I think it has no tools I've tried to make it use any tool and failed
Which ai model you are using ,?
Let me check the tool-policy docs so I donāt hand-wave this.
Yeah, if it really has no read tool, telling it to read IDENTITY.md wonāt help.
That would point to one of these:
- Youāre still inside the stale subagent session
- Tool policy filtered tools out
- The model/tool-calling is broken, so it has tools on paper but never uses them
Fastest checks:
-
/context list
This is the big one. It shows:- which files are injected
- which tools are available
-
/agents -
/tasks
If /context list shows only AGENTS.md + TOOLS.md, youāre still in subagent context.
If it also shows basically no tools, then Iād inspect tool policy next.
Config bits to check:
openclaw --version
openclaw config get tools
openclaw config get agents
openclaw tasks list --runtime subagent
openclaw status --all
The main policy knobs are:
tools.profiletools.allow
tools.denyagents.list[].tools.*tools.subagents.tools
And one easy footgun: allowlists must use real tool names / groups, like message, web_fetch, group:web, group:sessions, not made-up names.
Docs:
- https://docs.openclaw.ai/tools/index
- https://docs.openclaw.ai/tools/subagents
- https://docs.openclaw.ai/concepts/context
If you paste /context list plus openclaw config get tools, I can probably tell you in one pass whether this is a stuck binding vs a tool-policy issue.
gemini cli, anyh model inside of it.
I wouldnāt trust me to answer that from memory, runtime model info gets stale fast.
For your actual session/model, check:
/statusin chatopenclaw models statuslocally
For model recommendations, ask in #models and use:
- https://docs.openclaw.ai/concepts/models
- https://docs.openclaw.ai/concepts/models#model-discussions-community-notes
If you want, paste your openclaw models status output and I can help interpret it.
So you have configured gemini cli as llm provider,
Is it able to answer normal questions,
And just failing to do tool call ?
Got it, so it happens with Gemini CLI regardless of which Gemini model is selected.
That makes me think this is less likely a specific model choice and more likely one of:
- stale thread/subagent binding
- tool policy filtering tools out
- broken/stale task/session delivery after the old timeout run
So Iād focus on these next, not the model:
/context list/agents/tasks
And locally:
openclaw config get tools
openclaw config get agents
openclaw tasks list --runtime subagent
openclaw status --all
If you paste /context list + openclaw config get tools, I can tell pretty quickly whether the child session is just stuck with no tools vs the thread still being bound to the wrong session.
Yep, thatās absolutely possible.
A setup can be:
- fine for normal chat/questions
- but bad at tool calling
Those are different paths.
So if your Gemini CLI setup can answer plain questions, but it wonāt read, exec, etc., that usually means one of these:
- tools are not actually available in that session
- tool policy filtered them out
- the model/provider is seeing the tools but failing to call them correctly
Thatās why /context list is so useful:
- if the tools are missing there, itās a config/policy/session issue
- if the tools are present there, but the agent still never uses them, itās more of a model/provider tool-calling issue
So yes, ānormal answers work, tool calls failā is a very believable failure mode here.
Paste /context list and we can separate those two quickly.
it doesn't try to use any tool it just respond as a chat bot
Can you ask it which tools you have available ?
Yep, and thatās a useful clue.
If it behaves like a plain chatbot and never even attempts a tool call, itās usually one of these:
-
the session effectively has no tools
tools.profile: "minimal"- restrictive
tools.allow/tools.deny agents.list[].tools.*tools.subagents.tools
-
the tools are present, but the model/provider is not actually tool-calling
The quickest separator is still:
/context list
If the tools are missing there, itās a config/session-policy problem.
If the tools are listed there, but it still only chats, then itās more of a model/provider tool-calling issue.
And yeah, if tools.profile ended up minimal-ish, ājust a chatbotā is exactly what it looks like.
Please paste:
openclaw config get tools
openclaw config get agents
and the output of /context list.
Then we can tell whether this is:
- wrong/stale subagent binding
- tools filtered out
- or Gemini CLI just not taking tool calls in that session.
You can, but I wouldnāt trust the modelās answer there if tool-calling is already busted.
Better: use the native command:
/context list
That shows the actual tools available to the session, plus which files are injected.
If you ask the model āwhat tools do you have?ā, it may:
- guess
- omit some
- answer from stale context
- or just act like a chatbot again
So for this case, /context list is the source of truth. If you paste that output here, we can read it directly.
which tools you have available ?
I have access to a comprehensive suite of tools categorized as follows:
- File & Codebase: read_file, write_file, grep_search, glob, list_directory, replace, move_file, and delete_file.
- Investigation & Planning: codebase_investigator (architectural mapping), enter_plan_mode (designing complex changes), and cli_help (CLI documentation).
- Execution: run_shell_command for interacting with the system and running project-specific scripts or tests.
- Web & Knowledge: google_web_search and mcp_openclaw_web_search for external research.
- Session & Task Management: mcp_openclaw_sessions_spawn, mcp_openclaw_sessions_send, mcp_openclaw_subagents for orchestration, and mcp_openclaw_cron for scheduling.
- Specialized Agents: generalist for batch tasks and codebase_investigator for deep analysis.
- Extensibility: activate_skill to enable specialized workflows like the skill-creator.
who are you?
I am Gemini CLI, an autonomous senior software engineer and AI agent designed to assist with complex technical tasks, architectural mapping, and codebase management. I operate within your
terminal to research, plan, and execute code changes, bug fixes, and system integrations while adhering to high engineering standards and security protocols.
Yep, that output is a huge clue.
That is not OpenClawās native tool list.
Names like:
read_filewrite_filerun_shell_commandactivate_skillmcp_openclaw_sessions_spawn
are Gemini CLI / MCP-style tool names, not the normal OpenClaw built-in names.
If this were a normal OpenClaw session, youād expect names more like:
read
writeeditexecprocessweb_searchsessions_spawnsubagents
So this means one of two things:
- youāre actually still attached to a Gemini CLI harness/child session
- Gemini is ignoring the real session tool schema and answering with its own generic self-description
Either way, I would not trust āwhat tools do you have?ā as a diagnostic anymore.
Use the native commands instead:
/context list
/agents/tasks
If /agents shows the thread is still bound to a child/harness session, Iād try:
/unfocus- then
/reset
That pasted reply actually makes me more confident this is a wrong-session/bound-child problem, not just āIDENTITY.md missing.ā
Run
/context list
/agents
Give output
I canāt call /context list directly from the tool surface, but I can inspect the live session and subagent state now.
I canāt invoke /context list itself from the tool surface, but I ran the live equivalents and hereās the actual state for this thread right now:
Session key: agent:main:discord:channel:1494276428731252746
Runtime: direct
Thread/session status: main session, updated just now
Active subagents: none
Recent subagents (last 24h): none
Visible group sessions matching this thread: 1
And from the actual prompt context of this session, it is not a āno identity / no toolsā session right now.
It has bootstrap/context files including things like:
AGENTS.mdSOUL.md
IDENTITY.mdUSER.mdTOOLS.mdHEARTBEAT.mdmemory.md
And the available tools here are OpenClaw built-ins, like:
- file tools:
read,write,edit,apply_patch - runtime:
exec,process - web:
web_search,web_fetch - browser/ui:
browser,canvas - session tools:
sessions_list,sessions_history,sessions_send,sessions_spawn,subagents,session_status - media/analysis:
image,pdf,tts, generation tools - messaging:
message
So the important bit is:
This threadās live session is currently a normal main OpenClaw session, not a child Gemini CLI/subagent session.
That means the Gemini-style self-description you pasted earlier is not the real live tool inventory for this thread. It was either:
- a wrong/stale child reply getting replayed, or
- the model hallucinating its own Gemini CLI harness persona.
Thatās actually good news, because it narrows this down a lot.
/context list
š§ Context breakdown
Workspace: /home/ubuntu/.openclaw/workspace
Bootstrap max/file: 20,000 chars
Bootstrap max/total: 150,000 chars
Sandbox: mode=off sandboxed=false
System prompt (run): 36,890 chars (9,223 tok) (Project Context 20,639 chars (5,160 tok))
Injected workspace files:
- AGENTS.md: OK | raw 9,770 chars (2,443 tok) | injected 9,770 chars (2,443 tok)
- SOUL.md: OK | raw 3,065 chars (767 tok) | injected 3,065 chars (767 tok)
- TOOLS.md: OK | raw 1,647 chars (412 tok) | injected 1,647 chars (412 tok)
- IDENTITY.md: OK | raw 1,384 chars (346 tok) | injected 1,384 chars (346 tok)
- USER.md: OK | raw 489 chars (123 tok) | injected 489 chars (123 tok)
- HEARTBEAT.md: OK | raw 167 chars (42 tok) | injected 167 chars (42 tok)
- BOOTSTRAP.md: MISSING | raw 0 | injected 0
- MEMORY.md: OK | raw 3,864 chars (966 tok) | injected 3,864 chars (966 tok)
Skills list (system prompt text): 7,020 chars (1,755 tok) (15 skills)
Skills: clawhub, gemini, healthcheck, node-connect, skill-creator, taskflow, taskflow-inbox-triage, tmux, trello, weather, icloud-caldav, news-scraper, playwright-cli, self-improvement,
universal-scraper
Tool list (system prompt text): 0 chars (0 tok)
Tool schemas (JSON): 0 chars (~0 tok) (counts toward context; not shown as text)
Tools: (none)
Session tokens (cached): unknown / ctx=200,000
Inline shortcut: a command token inside normal text (e.g. āhey /statusā) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message.
/agents
-> main default
Perfect, this isolates it.
Your output says:
- main/default agent
SOUL.md/IDENTITY.md/USER.mdare injected correctly- Tools:
(none)
So the real problem is not missing identity files, and itās not subagent context right now.
Itās this:
Tool list: 0 chars
Tool schemas: 0 chars
Tools: (none)
That means OpenClaw is giving the model zero tools, so of course it just behaves like a chatbot and never calls read, exec, etc.
So the likely cause is a tool policy/config issue, not the model itself.
Please paste these next:
openclaw --version
openclaw config get tools
openclaw config get agents
What Iād inspect first in config:
tools.profiletools.allowtools.deny
agents.list[].tools.*
Since your /context list shows sandboxed=false, sandbox policy is probably not the main culprit here.
Also, this explains the weird Gemini CLI self-description earlier: with no real tools injected, it was basically freestyling a tool list instead of reporting a real one.
Docs:
Paste openclaw config get tools and Iāll help pinpoint the exact bad setting.
there are a lot of parts that shows like that asdasd
If you mean values like:
~/.openclaw/...
~/workspace
that part is normal. ~ just means your home directory.
So ~/.openclaw/workspace is basically the same as something like:
/home/ubuntu/.openclaw/workspace
That is not the problem.
The real red flag is still this:
Tools: (none)
Tool schemas: 0
So Iād ignore the ~... paths for now and paste these exactly:
openclaw config get tools
openclaw config get agents
Even if they contain lots of ~ paths, thatās fine. Iām looking for the tool-policy bits, especially things like:
tools.profile
tools.allowtools.denyagents.list[].tools.*
Thatās where the actual breakage probably is.
Run these commands and paste out put
I canāt run commands on your Ubuntu box from this Discord thread, only inspect the live Discord session here.
Please run these locally and paste the output:
openclaw --version
openclaw config get tools
openclaw config get agents
If the output is long, just paste the tools block and the agents.list / agents.defaults parts. That should be enough to spot why the effective tool list is empty.
OpenClaw 2026.4.14 (323493f)
š¦ OpenClaw 2026.4.14 (323493f) ā I can grep it, git blame it, and gently roast itāpick your coping mechanism.
{
"profile": "coding",
"web": {
"search": {
"enabled": true,
"provider": "gemini"
}
}
}
š¦ OpenClaw 2026.4.14 (323493f) ā I can't fix your code taste, but I can fix your build and your backlog.
{
"defaults": {
"model": {
"primary": "google-gemini-cli/gemini-3-flash-preview",
"fallbacks": [
"google-gemini-cli/gemini-2.5-flash"
]
},
"models": {
"google-gemini-cli/gemini-3.1-pro-preview": {},
"google-gemini-cli/gemini-3-flash-preview": {},
"google-gemini-cli/gemini-2.5-pro": {},
"google-gemini-cli/gemini-2.5-flash": {},
"google-gemini-cli/gemini-3.1-flash-lite-preview": {}
},
"workspace": "/home/ubuntu/.openclaw/workspace",
"memorySearch": {
"enabled": false
},
"heartbeat": {
"model": "google-gemini-cli/gemini-3-flash-preview"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
}
There is no tools in this @steel dove
This is useful. It rules out the obvious config mistake. Let me line it up with the code path I just checked.
I found one more angle that actually could explain part of the weirdness around /reset: the built-in reset hook + startup-context prelude. Iām checking that now.
Okay, I think weāve got a real lead now, not just hand-waving. /reset is not always āempty session, nothing from before.ā OpenClaw can intentionally carry some recent memory into the first post-reset turn. Let me grab the exact config knobs.
Nice, this narrows it down a lot.
Your pasted config looks sane:
tools.profile: "coding", so tools are not globally disabled by config- the
google-gemini-cli/...model block also looks normal - I checked source, and tools only get hard-disabled when a model resolves with
compat.supportsTools === false - I could not find
google-gemini-clibeing explicitly markedsupportsTools: false
So my updated read is:
Tools: (none)is probably not caused by the config you pasted/resetreplaying yesterdayās subagent text may be explained by reset-memory behavior
Important bit from docs/source:
/resetis just the reset alias for/new
- bare
/newand/resetcan preload recent daily memory - the bundled
session-memoryhook saves the previous session on/reset
So /reset is not guaranteed to be a sterile blank slate.
Docs:
- https://docs.openclaw.ai/concepts/system-prompt
- https://docs.openclaw.ai/reference/token-use
- https://docs.openclaw.ai/automation/hooks
What I want next
Please paste these:
openclaw status --all
openclaw hooks info session-memory
openclaw config get hooks
openclaw config get agents.defaults.startupContext
Then tail logs, trigger /reset, and paste the relevant lines:
openclaw logs --follow
And one very telling check:
ls -lt /home/ubuntu/.openclaw/workspace/memory | head
If you can, also search for a unique phrase from the stale subagent reply inside that memory folder.
Current best hypothesis
- If the stale text is in
workspace/memory, then/resetis probably resurfacing it via startup context, not because you are still live-bound to a child session. - If it is not in memory, and
/context liststill showsTools: (none), then this smells like a 2026.4.14 runtime bug around reset/session state or effective tool inventory, not a bad tools config.
If you paste agents.defaults.startupContext and hooks info session-memory, I can tell you pretty quickly which branch weāre in.
Right, but the important distinction is:
- the first JSON block is the tools config
- it has
profile: "coding" - the second JSON block is
agents, and it does not need a separatetoolsblock unless you want per-agent overrides
So, missing agents.defaults.tools is not the bug by itself.
The weird part is this combo:
- config says tools profile =
coding - but
/context listreportedly saysTools: (none)
That means the problem is now most likely runtime-effective tools, not āyou forgot to configure toolsā.
So next checks should be:
openclaw status --all
openclaw config get agents.defaults.startupContext
openclaw hooks info session-memory
And right after a fresh /reset, paste:
/context list- the first relevant lines from
openclaw logs --follow
Why Iām asking for startupContext / session-memory
Because /reset is not a perfectly blank reset. It can preload recent memory, and the bundled session-memory hook saves previous session content on reset/new.
So there are now two separate problems to distinguish:
- stale old subagent text is being pulled back in through startup memory
- effective tool inventory is coming out empty even though
tools.profileiscoding
If you paste those 3 outputs, we can separate them pretty quickly.
I also updated yesterday the openclaw.
Ah, thatās a good clue.
If you updated yesterday, Iām more suspicious of stale session state surviving the update than of bad config.
A few important bits:
- updating OpenClaw does not clear old session transcripts or
workspace/memory /resetgives the same session key a new session id, it does not wipe all historical side data- so an old poisoned thread/session can survive an upgrade and still look haunted
So right now my top suspects are:
- startup-context / session-memory is re-injecting old content
- this specific thread session state is stale/bad after the update
- 2026.4.14 has a runtime bug around effective tool inventory for this path
Fastest isolation test
If you can, make a completely new thread/session and run:
/context list
If the new thread has normal tools + soul/identity files, then this is probably thread-specific stale session state, not global config.
Please paste next
openclaw status --all
openclaw doctor
openclaw config get agents.defaults.startupContext
openclaw hooks info session-memory
That should tell us whether this is:
- stale memory preload,
- a bad migrated session,
- or a real post-update bug.
If the brand-new thread is clean while this one is broken, Iād treat that as strong evidence the session state for this thread got corrupted across the update.
the new thread still the same I've tried reset and new commands
Thatās really helpful.
If a brand-new thread shows the same behavior, then this is not just one poisoned session key. Itās now looking like an instance-wide problem on that machine.
Also, this still fits the reset-memory theory, because:
startupContextis workspace-global- the bundled
session-memoryhook writes into the same workspace memory - so a fresh thread can still āinheritā yesterdayās content on bare
/newor/reset
So right now I think you may have two separate issues:
- old subagent text is being reloaded globally via startup memory
- effective tools are globally empty even though
tools.profileiscoding
Please paste these next
openclaw status --all
openclaw models status --json
openclaw config get agents.defaults.startupContext
openclaw hooks info session-memory
And if you can, this too:
ls -lt /home/ubuntu/.openclaw/workspace/memory | head
If thereās a memory file from yesterday with that stale subagent content, that explains the āold reply keeps coming backā part.
If models status / status --all look normal and tools are still empty in every new thread, then Iād treat this as a real post-update bug in 2026.4.14, not bad config.
can I try to downgrade?
Iām going to verify the exact version-pin / reinstall path first so I donāt make up a bad downgrade command.
Yes, at this point a downgrade is a reasonable test.
Iād just do it in a way that preserves evidence first.
First, capture this
openclaw --version
openclaw status --all
Then prefer the built-in updater
Preview first:
openclaw update --dry-run --tag <last-known-good-version>
If it looks right, apply it:
openclaw update --tag <last-known-good-version>
Docs:
After downgrade
openclaw health
Then test again in chat with:
/new/context list
If you installed globally with pnpm and want the manual path
pnpm add -g openclaw@<version>
openclaw doctor
openclaw gateway restart
My recommendation
If you know the exact version that worked before yesterdayās update, roll back to that one first.
If the downgrade fixes it, then weāve got strong evidence this is a regression in 2026.4.14.
If you want, paste the version you were on before, and Iāll tell you the exact command to use.
give me the bash command to see the output of the last time I used openclaw update.
Iām checking whether OpenClaw stores updater output anywhere predictable, so I donāt hand you a bogus grep.
Short answer: there usually isnāt a built-in record of the exact old openclaw update stdout unless you saved it.
Closest useful commands:
1) See the last openclaw update command you ran
history | grep 'openclaw update' | tail -1
If your bash history has timestamps enabled:
HISTTIMEFORMAT='%F %T ' history | grep 'openclaw update' | tail -1
2) See current updater state
openclaw update status --json
3) Grep the latest OpenClaw log for update-related lines
log="$(ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -1)"; rg -n 'update|doctor|restart|gateway' "$log" | tail -80
That last one is the best shot at reconstructing what happened, but it is not guaranteed to be the exact same output you saw in the terminal.
If you want, paste the output of #2 and #3 and Iāll help interpret it.
how can I do a clean install without lossing any memory or workspace file?
Iām checking the uninstall/reset docs so I can give you the safe path that keeps ~/.openclaw/workspace intact.
Yes. If your goal is clean reinstall without losing workspace/memory, Iād do this:
Safest first step, make a backup
openclaw backup create
That gives you a restorable snapshot first. Docs: https://docs.openclaw.ai/cli/backup
Option A, reinstall the app/service only, keep state + workspace
This is the safest if you do not want to lose anything:
openclaw gateway stop
openclaw gateway uninstall
pnpm remove -g openclaw
pnpm add -g openclaw@latest
openclaw doctor
openclaw gateway install --force
openclaw gateway restart
This should keep:
~/.openclaw/workspace~/.openclaw/workspace/memory- your state dir under
~/.openclaw
Important, do not do these if you want to keep workspace/memory
openclaw uninstall --allopenclaw reset --scope full- deleting
~/.openclaw
If you want a deeper clean but still keep workspace files
This wipes config/creds/sessions, but not workspace:
openclaw reset --scope config+creds+sessions --yes --non-interactive
Then reinstall/reconfigure after that.
My recommendation
Start with Option A first.
If the bug survives that, then the problem is probably in state/session/config, not the installed package.
Docs:
- https://docs.openclaw.ai/install/uninstall
- https://docs.openclaw.ai/install/updating
- https://docs.openclaw.ai/cli/backup
If you want, I can give you the exact rollback-clean-reinstall sequence next, for either latest or a pinned older version.
pnpm command not found
No problem, that just means pnpm is not installed or not on PATH.
Easiest path, skip pnpm entirely
Use the built-in updater:
openclaw update
Or if you want to roll back to a specific version:
openclaw update --tag <version>
Thatās the path Iād use first.
If you specifically want pnpm
Install/activate it with Corepack:
corepack enable
corepack prepare pnpm@latest --activate
pnpm --version
Then you can use:
pnpm add -g openclaw@latest
or
pnpm add -g openclaw@<version>
My recommendation
Since youāre debugging a broken install, Iād avoid extra moving parts and just use:
openclaw update --tag <last-known-good-version>
If you want, send me the version you want to roll back to and Iāll give you the exact one-liner.
TypeError: Cannot read properties of undefined (reading 'trim')
That error string is a very useful clue. Iām checking the source for the exact trim() failure path before I tell you to nuke anything.
Oof, that error is a strong clue.
TypeError: Cannot read properties of undefined (reading 'trim') fits stale/corrupt session-store state a lot better than āmissing soul filesā.
Safest next steps
First, back up:
openclaw backup create
Then try the built-in repair path:
openclaw doctor
openclaw status --all
If it still happens on /new and /reset
Assuming default state dir, this is the least-destructive recovery Iād try:
ts="$(date +%Y%m%d-%H%M%S)"
mkdir -p ~/.openclaw/recovery-"$ts"
openclaw gateway stop
mv ~/.openclaw/agents/main/sessions/sessions.json ~/.openclaw/recovery-"$ts"/
openclaw gateway start
That does not touch:
~/.openclaw/workspace~/.openclaw/workspace/memory
It only forces OpenClaw to rebuild the session store.
Why this helps
If a bad/stale entry in sessions.json is stuck in a weird bootstrapping/reset state, moving that file out of the way can clear it without deleting your workspace.
If you want, I can give you the same command but adapted for a non-default state dir/profile before you run it.
it gives me this error when I do onboard
Yep, that actually fits the same theory.
If onboard is also hitting Cannot read properties of undefined (reading 'trim'), then this is not just a bad chat thread anymore. Itās likely broken state on disk, and onboard is tripping over it too.
Iād do this first, before onboarding again
openclaw backup create
ts="$(date +%Y%m%d-%H%M%S)"
mkdir -p ~/.openclaw/recovery-"$ts"
openclaw gateway stop
mv ~/.openclaw/agents/main/sessions/sessions.json ~/.openclaw/recovery-"$ts"/
openclaw doctor
openclaw gateway start
Then try:
openclaw onboard
Why
onboard still touches the existing OpenClaw state.
So if sessions.json is corrupt/stale, onboarding can fail with the same trim error.
This keeps your workspace/memory intact, because it does not touch:
~/.openclaw/workspace~/.openclaw/workspace/memory
If you want, I can give you a slightly more defensive version that lists the session-store path first before moving it.
after that we still have the same error on onboard command
That means itās probably not just sessions.json. Iām tracing the onboard code path now so we can narrow which missing field is blowing up.
Got it. Since moving sessions.json didnāt fix it, Iād stop poking individual files and use the official state reset that keeps workspace.
This should preserve workspace + memory, but clear broken state
openclaw backup create
openclaw reset --scope config+creds+sessions --yes --non-interactive
openclaw onboard --workspace ~/.openclaw/workspace
This keeps:
~/.openclaw/workspace~/.openclaw/workspace/memory
But clears:
- config
- creds/auth
- sessions
Docs:
If it still throws the same trim error after that
Then we need the full stack trace, because itās no longer a normal stale-session problem.
Run this and paste the first stack frame with the file path:
NODE_OPTIONS='--trace-uncaught' openclaw onboard --workspace ~/.openclaw/workspace
At that point Iād treat it as a likely bug, and the stack trace will tell us exactly which file/field is undefined.
ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāÆ
TypeError: Cannot read properties of undefined (reading 'trim')
That output is still hiding the useful part. Iām checking the supported debug/log env knob so I can give you one command that captures the stack instead of just the final line.
That still isnāt enough, itās only showing the final exception line.
Please run this exact command and paste the output:
NODE_OPTIONS='--trace-uncaught' OPENCLAW_LOG_LEVEL=trace openclaw --log-level trace onboard --workspace ~/.openclaw/workspace 2>&1 | tee ~/openclaw-onboard-trace.txt
What I need is the first stack frame with a file path, for example something like:
at ... (/path/to/file:line:col)
Right now we know itās a trim() on undefined, but not which field is undefined. That file path is the difference between guessing and actually fixing it.
were you able to solve this in this new version of openclaw has this bug on onboard command -TypeError: Cannot read properties of undefined (reading 'trim')
check-https://github.com/openclaw/openclaw/issues/67597
Workaround: install openclaw@2026.4.12
I donāt think weāve fully solved it in-thread yet, but at this point I do think it looks like a real regression/bug, not just bad user config.
Why Iām leaning bug:
- tools config looked sane
- fresh threads showed the same behavior
onboardalso crashes with the sametrimerror- moving
sessions.jsondidnāt clear it
So yes, from the evidence so far, Iād treat this as ācurrent version is broken on this pathā until proven otherwise.
Best workaround right now
Roll back to the last known good version:
openclaw update --tag <last-known-good-version>
Best next step to get it fixed properly
Capture the full stack trace:
NODE_OPTIONS='--trace-uncaught' OPENCLAW_LOG_LEVEL=trace openclaw --log-level trace onboard --workspace ~/.openclaw/workspace 2>&1 | tee ~/openclaw-onboard-trace.txt
Then file a GitHub issue with:
- current version
- previous working version
- that full trace
- note that fresh threads and onboard both fail with
TypeError: Cannot read properties of undefined (reading 'trim')
Issue tracker:
https://github.com/openclaw/openclaw/issues
So, short version: I think itās a real bug, but we still need the stack trace to pin the exact broken field/path.
@solar delta Workaround: install openclaw@2026.4.12
Yep, that matches what we were seeing.
If 2026.4.12 is the known-good workaround, Iād use that for now:
openclaw backup create
openclaw update --tag 2026.4.12
Then retry:
openclaw onboard --workspace ~/.openclaw/workspace
If that fixes it, Iād add a comment on the GitHub issue with:
- broken version
- working version
2026.4.12 - the
trimerror ononboard
That helps pin it as a real regression.
Glad you found that lead, thatās actually really useful. š¦
Will try to do it in a bit
Sounds good.
When you do, Iād keep it to:
openclaw backup create
openclaw update --tag 2026.4.12
Then retry onboard and /context list.
If it works, paste back either way, Iām curious whether it clears both:
- the
trimcrash - the weird stale subagent / no-tools behavior
same issue.
I mean there is no more trim crash but I still get a response saying that it is gemini-cli
Annoying, but thatās useful.
If 2026.4.12 still has the same problem, then the version is probably not the root cause anymore. That points back to local state/config corruption.
Next thing Iād do
Use the official reset that keeps workspace:
openclaw backup create
openclaw reset --scope config+creds+sessions --yes --non-interactive
openclaw onboard --workspace ~/.openclaw/workspace
That should preserve:
~/.openclaw/workspace
~/.openclaw/workspace/memory
If reset itself is broken or onboard still dies after that
Then Iād do the stronger workaround, but still without deleting your workspace:
ts="$(date +%Y%m%d-%H%M%S)"
openclaw gateway stop
mv ~/.openclaw ~/.openclaw.bad-"$ts"
mkdir -p ~/.openclaw
cp -a ~/.openclaw.bad-"$ts"/workspace ~/.openclaw/
openclaw onboard --workspace ~/.openclaw/workspace
That gives you a fresh state dir while keeping your workspace files.
So, updated diagnosis:
- not just a bad version
- likely bad local state
- next step is state reset / fresh state dir, not more downgrade attempts
If you want, I can stay with you and do the āfresh state dir but keep workspaceā path step by step.
Ah, got it, thatās an important distinction.
If the trim crash is gone, thatās real progress.
At that point, the remaining āI am gemini-cliā text by itself is not enough to say the session is still broken, especially since your configured model/provider is google-gemini-cli/....
So Iād separate it like this:
Probably okay / cosmetic
If it says āgemini-cliā but:
SOUL.md/IDENTITY.mdare injected- tools are present
/context listlooks normal
then itās mostly just model self-report / provider flavor text, not a stuck subagent.
Still broken
If it says āgemini-cliā and:
- tools are still
(none) - only
AGENTS.md+TOOLS.mdshow up - identity/soul files are missing
then we still have a real context/runtime problem.
Please check one thing again
Run:
/context list
and paste just:
- the injected files section
- the
Tools:line - the
Tool schemas:line
That will tell us immediately whether the actual bug is gone and only the wording is weird, or whether the runtime is still wrong.
did a clean install and the same issue
That actually narrows it down a lot.
If a clean install still shows the same āI am gemini-cliā behavior, then this is probably not stale local state anymore.
At that point, the most likely explanation is:
- you are using the
google-gemini-cli/...provider - the model/backend is just self-identifying as Gemini CLI
- that wording alone does not prove you are stuck in a subagent
So the label is not the real signal anymore. The real signal is still:
- are
SOUL.md/IDENTITY.mdinjected? - are tools present?
- does
/context listlook normal?
Please run this after the clean install
/context list
and paste only:
- injected files
Tools:Tool schemas:
If that output is normal now, then the actual bug is basically gone and the remaining āgemini-cliā text is just cosmetic/provider self-report.
Hello. I am a Senior Software Engineer. I think I can help you resolve your issue. If you have any questions or need assistance with project development, please contact me via DM.
Iād keep this in-thread or on GitHub, not in DMs.
That way:
- other people can verify/reproduce
- maintainers can see the exact trace
- the fix stays searchable on Answer Overflow / GitHub for the next person
So if anyone has useful data, best thing is to paste it here:
/context list- full
onboardtrace - exact working vs broken version
DM debugging is a dead end for support threads like this.
/tools
Available tools
Profile: coding
Built-in tools
cron, edit, exec, process, read, sessions_history, sessions_send, session_status, sessions_list, sessions_spawn, subagents, web_fetch, write, sessions_yield
Connected tools
memory_get (memory-core), memory_search (memory-core)
Use /tools verbose for descriptions.
@steel dove are these tools the openclaw ones or gemini
Those are OpenClaw tools.
Specifically, names like:
read,write,editexec,processsessions_spawn,subagentssession_status,sessions_list,sessions_historyweb_fetch
are OpenClawās tool surface, not Gemini-native tools.
So this is actually a big clue:
- tooling is present and looks normal now
- if the model still says āI am gemini-cliā, that is most likely just provider/model self-description
- it does not mean the runtime is still missing tools
At this point the next question is the files/context side, not tools.
If you want to verify that too, paste /context list and Iāll check whether SOUL.md / IDENTITY.md are back.
ā Available Tools (Verified)
- list_directory: List files in a folder.
- read_file: Read the contents of a file.
- grep_search: Search for text patterns inside files.
- glob: Search for files by name/pattern.
- cli_help: Access documentation about this CLI.
- mcp_openclaw_*: A suite of tools for managing OpenClaw sessions and memory (though some of these fail due to a gateway pairing error).
ā Missing Tools (Attempted but "Not Found")
- run_shell_command: Cannot run mv, cp, or other terminal commands.
- write_file: Cannot create new files or copy content.
- replace: Cannot edit existing files.
Yep, this is the clearest evidence so far:
/toolsis authoritative- the pasted
list_directory / read_file / grep_search / glob / run_shell_commandblock is not the real OpenClaw tool inventory
Those names are not OpenClaw-native.
OpenClawās real equivalents are:
read_fileāreadwrite_fileāwritereplaceāeditrun_shell_commandāexec
So whatās happening now is:
- the actual runtime tools are OpenClaw tools
- the model is still describing or expecting a Gemini CLI-style tool schema
- if it tries those wrong names, thatās a model/provider prompt/tooling bug, not ātools are actually missingā
So I would trust:
/tools/context list
and not trust the modelās own āavailable toolsā paragraph.
At this point, the remaining bug looks like:
the model thinks it has Gemini-style tool names, while OpenClaw is actually exposing OpenClaw tools
Thatās a much narrower bug than where we started.
If you can, paste /context list too, because then we can confirm whether the files/context are also normal now, and the only thing left broken is the modelās fake tool self-report.
š§ Context breakdown
Workspace: /home/ubuntu/.openclaw/workspace
Bootstrap max/file: 20,000 chars
Bootstrap max/total: 150,000 chars
Sandbox: mode=off sandboxed=false
System prompt (run): 27,435 chars (6,859 tok) (Project Context 13,377 chars (3,345 tok))
Injected workspace files:
- AGENTS.md: OK | raw 7,727 chars~~ (1,932 tok) | injected 7,727 chars (1,932 tok)~~
- SOUL.md: OK | raw 1,738 chars
(435 tok) | injected 1,738 chars (435 tok) - TOOLS.md: OK | raw 850 chars
(213 tok) | injected 850 chars (213 tok) - IDENTITY.md: OK | raw 633 chars
(159 tok) | injected 633 chars (159 tok) - USER.md: OK | raw 474 chars~~ (119 tok) | injected 474 chars (119 tok)~~
- HEARTBEAT.md: OK | raw 192 chars
(48 tok) | injected 192 chars (48 tok) - BOOTSTRAP.md: OK | raw 1,450 chars~~ (363 tok) | injected 1,450 chars (363 tok)~~
Skills list (system prompt text): 4,802 chars (1,201 tok) (10 skills)
Skills: clawhub, gemini, healthcheck, mcporter, node-connect, skill-creator, taskflow, taskflow-inbox-triage, tmux, weather
Tool list (system prompt text): 0 chars (0 tok)
Tool schemas (JSON): 0 chars (~0 tok) (counts toward context; not shown as text)
Tools: (none)
Session tokens (cached): unknown / ctx=200,000
Inline shortcut: a command token inside normal text (e.g. āhey /statusā) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message.
This is the smoking gun.
Your latest output proves:
- main session bootstrap is normal
(AGENTS.md,SOUL.md,IDENTITY.md,USER.md, etc. are injected) - but the model receives zero tools
(Tool list: 0,Tool schemas: 0,Tools: (none))
So the current state is:
- not missing soul/identity files
- not just stale subagent context
- not ātools are uninstalledā in a broad sense, because
/toolsstill shows them - it is a bug where tools exist in OpenClaw, but the effective model prompt gets none
That also explains why it keeps acting like plain Gemini CLI. If OpenClaw passes zero tools, the model falls back to chatty self-description instead of acting agentic.
So the bug is now very narrow
/toolssees registered tools, but/context listshows the runtime is injecting zero effective tools into the model.
Thatās the thing to report.
One last isolating test
If you have any non-google-gemini-cli provider/model configured, switch to that temporarily and rerun /context list.
- If tools appear there, this is almost certainly a
google-gemini-clieffective-tools bug - If tools are still
(none), then itās a broader runtime/config issue
What Iād put in the GitHub issue
Paste both of these together:
/toolsoutput showing OpenClaw tools exist/context listoutput showingTools: (none)andTool schemas: 0
That combination is really the key evidence.
I've no other model
Thatās enough to call it, then.
Given:
- only
google-gemini-cliis configured /toolsshows OpenClaw tools exist/context listshows zero tools are actually injected
ā¦the most likely diagnosis is:
the
google-gemini-clipath is failing effective tool injection on your setup
So I would stop reinstalling/resetting at this point.
Youāve already narrowed it much further than that will help.
Best next move
File/update the GitHub issue with exactly these two outputs:
/tools/context list
and note:
SOUL.md/IDENTITY.mdinject correctlyTools: (none)Tool schemas: 0- model keeps self-reporting as Gemini CLI because it gets no OpenClaw tools
Practical workaround
If you need agentic behavior right now, youāll probably need to configure another provider/model temporarily, because with the current setup the model is effectively getting no tools.
So, short version: this now looks like a provider-specific tooling bug, not your install being haunted anymore.
how can I do a full clean install with a version of the month 3
You can, but a full clean install really means wiping state + workspace, so back up first.
1) Back up everything first
openclaw backup create
2) List March releases so you can pick one
npm view openclaw versions --json | node -e 'let s="";process.stdin.on("data",c=>s+=c).on("end",()=>JSON.parse(s).filter(v=>/^2026\.3\./.test(v)).forEach(v=>console.log(v)))'
3) Full clean uninstall
openclaw uninstall --all --yes --non-interactive
4) Install the March version you want
Replace 2026.3.x with the exact one from step 2:
npm i -g openclaw@2026.3.x
5) Set it up again
openclaw onboard
Docs:
- https://docs.openclaw.ai/install/uninstall
- https://docs.openclaw.ai/install/updating
- https://docs.openclaw.ai/cli/backup
Important
openclaw uninstall --all removes the workspace too, so if you want your memory/workspace back afterward, restore it from the backup instead of expecting it to survive the uninstall.
If you want, I can give you the same flow but keeping the workspace folder intact instead of doing a truly full wipe.
want to uninstall the cli too
Iām checking whether openclaw uninstall --all removes the CLI binary/package too, or whether you still need the package-manager remove step afterward.
Yep, if you want the CLI gone too, do both steps.
openclaw uninstall --all removes:
- service
- state/config
- workspace
- macOS app
ā¦but the CLI remains.
Full wipe including the CLI
openclaw backup create
openclaw uninstall --all --yes --non-interactive
npm rm -g openclaw
Then install the version you want:
npm i -g openclaw@2026.3.x
openclaw onboard
So the full sequence is basically:
openclaw backup create
openclaw uninstall --all --yes --non-interactive