#I lose my Agent and Session

1 messages · Page 1 of 1 (latest)

mortal hazel
#

Hey, I need urgent help.

Something broke after I got a “something went wrong” error and clicked “new”.

Before that, I had a working agent (I think it was called “main”, not 100% sure). I was using it for a while and had it configured.

Now:

  • I only see 3 agents in UI (note_taker, coder, movie_manager)
  • coder and movie_manager have all core files missing
  • I cannot set any agent as default (button doesn’t work)
  • new sessions always use note_taker (which is basically useless)

But:

  • in Sessions I still see agent:main:main
  • that session has no last message and seems broken/inaccessible

Main problem:
I cannot switch the default agent or restore my previous working agent (main), including Telegram responses.

Questions:

  1. How can I restore or reattach that agent?
  2. Why is “Set Default” not working?
  3. Did my workspace files get corrupted or detached?

This is blocking my work right now.

sinful muralBOT
little glacierBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

sinful muralBOT
mortal hazel
#

Environment:

  • OS: Ubuntu (VPS)
  • Installed via: [docker / manual — вставь как есть]
  • Using: OpenClaw + Telegram integration

If needed, I can send logs.

winged hullBOT
#

This sounds more like agent config / workspace drift than total corruption.

What your symptoms usually mean:

  • agent:main:main in Sessions means the session store still exists on disk.
  • The Agents UI only shows agents that are currently in agents.list.
  • If main dropped out of agents.list, OpenClaw falls back to the first configured agent, which matches note_taker.
  • “core files missing” does not automatically mean data loss, it often means that agent now points at the wrong workspace path.

So, short answers:

  1. Restore/reattach main: probably by putting main back into config with the correct workspace.
  2. Why Set Default fails: likely because the config is out of sync, or the UI is failing to persist the change.
  3. Corrupted or detached?: detached/mispointed is more likely than corrupted.

Please paste these first, and don’t run repair yet:

#
openclaw --version
openclaw config file
openclaw config get agents.list --json
openclaw agents list --bindings --json
openclaw sessions --all-agents --json

If you want one extra fast check:

ls -la ~/.openclaw/agents/main ~/.openclaw/agents/main/sessions 2>/dev/null

What I expect:

  • If main is missing from agents.list, that explains both the broken default behavior and lost Telegram routing.
  • If main is present but the button still does nothing, then it’s likely a UI/config-write bug and I’d check logs next.
#

Yep, please send the outputs. For this kind of breakage, config/state output is more useful than raw logs first.

Please paste:

openclaw --version
openclaw config file
openclaw config get agents.list --json
openclaw agents list --bindings --json
openclaw sessions --all-agents --json

And tell me one thing clearly:

  • installed via Docker or manual?

If you can also grab logs right after clicking Set Default once, even better:

#
openclaw logs --follow

Then click Set Default, wait for the error/log line, and paste the relevant bit here.

Also, don’t run doctor --repair or setup yet, I want to see whether main is missing from config before we touch anything.

mortal hazel
#

Installed without docker
openclaw --version
OpenClaw 2026.4.15 (041266a)

winged hullBOT
#

Good, that version is current enough, so this is less likely to be an already-fixed old-version bug.

Since you installed without Docker, next please paste these:

openclaw config file
openclaw config get agents.list --json
openclaw agents list --bindings --json
openclaw sessions --all-agents --json

If main is missing from agents.list, that’s almost certainly why:

  • Set Default does nothing
  • new sessions fall back to note_taker
  • Telegram stopped behaving like before
#

If you can, also paste this quick filesystem check:

ls -la ~/.openclaw/agents/main ~/.openclaw/agents/main/sessions 2>/dev/null

Once I see that output, I can tell you whether this is:

  • a missing main config entry,
  • a bad workspace path,
  • or a UI/config-write issue.
mortal hazel
#

ill send commands in different meassages, please wait

openclaw config file

🦞 OpenClaw 2026.4.15 (041266a)
We ship features faster than Apple ships calculator updates.

~/.openclaw/openclaw.json
root@ubuntu-4gb-nbg1-3:~#

#

openclaw config get agents.list --json
[
{
"id": "note_taker",
"workspace": "/root/.openclaw/workspace/note_taker",
"systemPromptOverride": "Ты Заметчик. В Telegram ты печатаешь ТОЛЬКО текст заметки — без приветствий, без меток «Записала/Записал», без двоеточия после служебных слов, без «готово/понял/ок». Пример: на фразу пользователя про покупку арбуза ответ должен быть ровно «купить арбуз», а не «Записала: купить арбуз»."
},
{
"id": "movie_manager",
"workspace": "/root/.openclaw/workspace/movie_manager",
"systemPromptOverride": "Ты Агент-Киноман. Твоя задача — оформлять информацию о фильмах для Telegram-топика «Фильмы» (ID 10). Когда пользователь называет фильм, найди его описание, продолжительность и кратко оформи пост в следующем формате:\n\n🎬 Название (Год)\n\nПродолжительность: X минут\n\n[Краткое описание]\n\nИспользуй этот шаблон для всех записей. Печатай только текст поста, без лишних слов."
},
{
"id": "coder",
"workspace": "/root/.openclaw/workspace/coder",
"systemPromptOverride": "Ты Агент-Кодер. Твоя задача — писать чистый, стабильный код, следовать инструкциям, оформлять код в блоки и проводить ревью."
}
]
root@ubuntu-4gb-nbg1-3:~#

winged hullBOT
#

Perfect, I’ll wait.

So far that confirms the active config file is:

~/.openclaw/openclaw.json

Please send the remaining outputs one by one:

openclaw config get agents.list --json
openclaw agents list --bindings --json
openclaw sessions --all-agents --json

And if you can after that:

#
ls -la ~/.openclaw/agents/main ~/.openclaw/agents/main/sessions 2>/dev/null
#

Got it, this already explains a lot.

main is not in agents.list, so right now OpenClaw only knows about:

  • note_taker
  • movie_manager
  • coder

That is very likely why:

  • new sessions fall back to note_taker
  • your old main behavior disappeared
  • Telegram routing changed
  • “Set Default” is acting weird/useless for the agent you actually want

So this looks much more like main got dropped from config, not instant total corruption.

Please send the next two outputs, they’ll tell us how to restore it cleanly:

#
openclaw agents list --bindings --json
openclaw sessions --all-agents --json

And then:

ls -la ~/.openclaw/agents/main ~/.openclaw/agents/main/sessions 2>/dev/null

Don’t edit config yet, we’re very close to confirming the exact recovery path.

mortal hazel
#

openclaw agents list --bindings --json
[
{
"id": "note_taker",
"workspace": "/root/.openclaw/workspace/note_taker",
"agentDir": "/root/.openclaw/agents/note_taker/agent",
"model": "google/gemini-3.1-flash-lite-preview",
"bindings": 0,
"isDefault": true,
"routes": [
"default (no explicit rules)"
],
"providers": [
"Telegram default: configured"
]
},
{
"id": "movie_manager",
"workspace": "/root/.openclaw/workspace/movie_manager",
"agentDir": "/root/.openclaw/agents/movie_manager/agent",
"model": "google/gemini-3.1-flash-lite-preview",
"bindings": 0,
"isDefault": false
},
{
"id": "coder",
"workspace": "/root/.openclaw/workspace/coder",
"agentDir": "/root/.openclaw/agents/coder/agent",
"model": "google/gemini-3.1-flash-lite-preview",
"bindings": 0,
"isDefault": false
}
]

winged hullBOT
#

Nice, this confirms the routing side.

Right now:

  • note_taker is the effective default
  • Telegram is using that default agent
  • there are no explicit bindings
  • so your old Telegram behavior is gone simply because main is no longer configured

Also, since config get agents.list showed no "default": true, note_taker is almost certainly default just because it’s the first entry in the list.

So the picture now is:

  • main dropped out of config
  • Telegram fell back to the current default
  • your old main session may still exist on disk, but it is no longer attached to active config
#

Please send the last two checks:

openclaw sessions --all-agents --json
ls -la ~/.openclaw/agents/main ~/.openclaw/agents/main/sessions 2>/dev/null

If those show main still on disk, the recovery path is probably:

  1. re-add/restore main in config,
  2. make it default,
  3. point it at the correct workspace,
  4. then only fix missing bootstrap files if needed.
mortal hazel
#

openclaw sessions --all-agents --json
{
"path": null,
"stores": [
{
"agentId": "note_taker",
"path": "/root/.openclaw/agents/note_taker/sessions/sessions.json"
},
{
"agentId": "movie_manager",
"path": "/root/.openclaw/agents/movie_manager/sessions/sessions.json"
},
{
"agentId": "coder",
"path": "/root/.openclaw/agents/coder/sessions/sessions.json"
}
],
"allAgents": true,
"count": 11,
"activeMinutes": null,
"sessions": [
{
"key": "agent:note_taker:cron:541f2382-1c9b-4e37-a696-c71262fd3ad8",
"updatedAt": 1776541283685,
"ageMs": 34764719,
"sessionId": "f63dcc6e-0fde-4cf3-b399-a507b13920f7",
"systemSent": true,
"inputTokens": 5344,
"outputTokens": 119,
"totalTokens": 5344,
"totalTokensFresh": true,
"model": "gemini-3.1-flash-lite-preview",
"modelProvider": "google",
"contextTokens": 200000,
"agentId": "note_taker",
"kind": "direct"
},
{
"key": "agent:note_taker:cron:541f2382-1c9b-4e37-a696-c71262fd3ad8:run:f63dcc6e-0fde-4cf3-b399-a507b13920f7",
"updatedAt": 1776541283685,
"ageMs": 34764719,
"sessionId": "f63dcc6e-0fde-4cf3-b399-a507b13920f7",
"systemSent": true,
"inputTokens": 5344,
"outputTokens": 119,
"totalTokens": 5344,
"totalTokensFresh": true,
"model": "gemini-3.1-flash-lite-preview",
"modelProvider": "google",
"contextTokens": 200000,
"agentId": "note_taker",
"kind": "direct"
},

#

{
"key": "agent:note_taker:telegram:group:-1003565396405:topic:38",
"updatedAt": 1776499842467,
"ageMs": 76205937,
"sessionId": "f0d63cee-e8d6-4aa1-8abb-a7c4998ec510",
"systemSent": true,
"abortedLastRun": false,
"inputTokens": 7063,
"outputTokens": 4,
"totalTokens": 7063,
"totalTokensFresh": true,
"model": "gemini-3.1-flash-lite-preview",
"modelProvider": "google",
"contextTokens": 200000,
"agentId": "note_taker",
"kind": "group"
},
{
"key": "agent:note_taker:telegram:slash:261617302",
"updatedAt": 1776497481327,
"ageMs": 78567077,
"sessionId": "05ea4035-013a-4a3f-b1c2-dd97ef01f168",
"totalTokens": null,
"totalTokensFresh": false,
"model": "gemini-3.1-flash-lite-preview",
"contextTokens": 200000,
"agentId": "note_taker",
"kind": "direct"
},
{
"key": "agent:note_taker:telegram:group:-1003565396405:topic:12",
"updatedAt": 1776496570736,
"ageMs": 79477668,
"sessionId": "243cf554-1deb-4981-b453-0daa1fd706d4",
"totalTokens": null,
"totalTokensFresh": false,
"model": "gemini-3.1-flash-lite-preview",
"contextTokens": 200000,
"agentId": "note_taker",
"kind": "group"
},
{
"key": "agent:note_taker:telegram:group:-1003565396405:topic:15",
"updatedAt": 1776496439595,
"ageMs": 79608809,
"sessionId": "55be26b3-37ee-4618-9b1c-a12e09caf481",
"totalTokens": null,
"totalTokensFresh": false,
"model": "gemini-3.1-flash-lite-preview",
"contextTokens": 200000,
"agentId": "note_taker",
"kind": "group"
}
]
}
root@ubuntu-4gb-nbg1-3:~#

winged hullBOT
#

This is still consistent with the same diagnosis.

Important detail: openclaw sessions --all-agents only showed the configured agent stores, so not seeing main here does not mean it’s gone from disk.

We just need one more filesystem check to confirm whether main is still sitting there as a disk-only agent:

ls -la ~/.openclaw/agents
ls -la ~/.openclaw/agents/main ~/.openclaw/agents/main/sessions 2>&1

If /root/.openclaw/agents/main/... exists, then the likely story is:

  • main still exists on disk
  • it was removed from agents.list
  • UI sessions can still discover traces of it
  • Telegram/default routing now uses note_taker because that’s the first configured agent
#

Send that output and I should be able to give you the exact recovery steps.

mortal hazel
#

ls -la ~/.openclaw/agents/main ~/.openclaw/agents/main/sessions 2>/dev/null
/root/.openclaw/agents/main:
total 16
drwx------ 4 root root 4096 Apr 17 06:36 .
drwx------ 5 root root 4096 Apr 18 08:14 ..
drwx------ 2 root root 4096 Apr 18 16:49 agent
drwxr-xr-x 2 root root 4096 Apr 18 16:49 sessions

/root/.openclaw/agents/main/sessions:
total 3496
drwxr-xr-x 2 root root 4096 Apr 18 16:49 .
drwx------ 4 root root 4096 Apr 17 06:36 ..
-rw-r--r-- 1 root root 26972 Apr 18 02:18 236654f2-31aa-4040-8c03-04782493df60.jsonl
-rw-r--r-- 1 root root 4494 Apr 17 16:09 3656eeb1-db1e-4669-8f70-b303ab81f271.jsonl
-rw-r--r-- 1 root root 160080 Apr 18 16:49 498ba7a0-dba6-4299-93db-b82c88c83dfe.jsonl
-rw-r--r-- 1 root root 62997 Apr 17 16:30 52bdeecd-baa8-401f-8156-226394da4fd4.jsonl
-rw-r--r-- 1 root root 13824 Apr 18 04:00 5f5b7ee6-dcaa-4ed5-96c7-2161bfb5186f.jsonl
-rw-r--r-- 1 root root 1648794 Apr 18 03:59 6b577646-e71f-445b-b5b2-6c73ab9e02b0.jsonl.reset.2026-04-18T04-00-00.211Z
-rw-r--r-- 1 root root 601462 Apr 18 06:49 6c45f90a-41fa-4d5f-95b0-eee57559c5ca.jsonl
-rw-r--r-- 1 root root 10713 Apr 18 03:55 6e63d729-fa63-4bb0-892c-1641af6444c5.jsonl
-rw-r--r-- 1 root root 599858 Apr 17 16:23 a6c84449-8757-4b16-a11c-73768f861006.jsonl
-rw------- 1 root root 642 Apr 17 07:48 aef1aa4f-85a3-4d09-9ada-634e76c83004.jsonl
-rw------- 1 root root 7002 Apr 18 06:14 dcbaa8c3-c360-48b9-a9be-7eae678f0701.jsonl
-rw------- 1 root root 642 Apr 17 08:02 dea22874-2705-44de-9531-a2c944724fbb.jsonl
-rw------- 1 root root 1596 Apr 17 08:26 fa7772a8-af5d-4142-83da-9ff35231324d.jsonl
-rw-r--r-- 1 root root 10436 Apr 18 03:53 fe01e7e3-d0e7-48a2-a579-04c80f2f47af.jsonl
-rw------- 1 root root 243446 Apr 19 05:15 sessions.json
-rw------- 1 root root 115574 Apr 18 01:20 sessions.json.9da2fe2b-7f16-40f0-9b6c-93733417be04.tmp
-rw-r--r-- 1 root root 352 Apr 18 16:04 sessions.json.telegram-sent-messages.json
root@ubuntu-4gb-nbg1-3:~#

#

thats it

winged hullBOT
#

That extra output is helpful too, it confirms Telegram is fully running on note_taker right now.

So at this point we know:

  • main is gone from active config
  • note_taker became the effective default
  • Telegram sessions are being created under note_taker
  • the broken Set Default button is probably a side issue, not the root problem

In other words, even if the button worked perfectly, it still would not magically restore main. The real issue is that main is missing from config.

I still need the disk/workspace check before giving you the safest recovery steps. Please run these exact ones:

ls -la ~/.openclaw/agents ~/.openclaw/agents/main 2>&1
ls -la ~/.openclaw/workspace ~/.openclaw/workspace/main 2>&1
#
ls -la ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak 2>&1

Why these three:

  • ~/.openclaw/agents/main tells us whether the old agent state still exists
  • ~/.openclaw/workspace vs ~/.openclaw/workspace/main tells us where the old main workspace lived
  • openclaw.json.bak may contain the pre-break config, which is the fastest clean restore path

If those paths exist, I can probably give you a very direct recovery plan from there.

#

Okay, we’ve got the core diagnosis now.

What happened

Your old main agent is still on disk:

  • ~/.openclaw/agents/main/agent exists
  • ~/.openclaw/agents/main/sessions/sessions.json exists
  • lots of main transcript files still exist

So this does not look like full corruption.

It looks like main got dropped from agents.list, while its agent state/session store stayed on disk.

That explains all 3 symptoms:

  1. Why you can’t restore/switch to main in UI
#

Because main is no longer a configured agent.

  1. Why “Set Default” feels broken
    Right now note_taker is the effective default because it’s the first entry in agents.list.
    The button may also be buggy, but that is secondary.

  2. Whether files were corrupted or detached
    Much more likely detached/out of config, not destroyed.

Also, this explains why:

  • UI still shows agent:main:main
  • CLI sessions --all-agents does not show main
  • Telegram is now routing to note_taker

Fastest recovery path

1. First check whether the old main workspace is the default workspace

#

Run:

ls -la ~/.openclaw/workspace

If that folder contains your usual workspace files like AGENTS.md, SOUL.md, USER.md, etc., then that is very likely the old main workspace.

2. If you have ~/.openclaw/openclaw.json.bak, use that as your source of truth

If it contains the old main entry, restoring from that is the cleanest fix.

3. Otherwise, manually put main back into ~/.openclaw/openclaw.json

openclaw agents add main will not work here, because main is reserved.

Add a main entry at the top of agents.list, like this:

#
{
  agents: {
    list: [
      {
        id: "main",
        default: true,
        workspace: "~/.openclaw/workspace",
        agentDir: "~/.openclaw/agents/main/agent"
      },

      // keep your existing entries below:
      {
        id: "note_taker",
        workspace: "/root/.openclaw/workspace/note_taker",
        systemPromptOverride: "..."
#
      },
      {
        id: "movie_manager",
        workspace: "/root/.openclaw/workspace/movie_manager",
        systemPromptOverride: "..."
      },
      {
        id: "coder",
        workspace: "/root/.openclaw/workspace/coder",
        systemPromptOverride: "..."
      }
    ]
  }
}
#

If you know the old main model, add it too. If not, you can leave model out for now.

4. Validate + restart

openclaw config validate
openclaw gateway restart
openclaw agents list --bindings --json

What you want to see after restart:

  • main appears in agents list
  • main is default
  • Telegram default routing follows main

If the workspace files are missing

#

If main comes back but the workspace is missing standard bootstrap files, then run:

openclaw setup --workspace ~/.openclaw/workspace

Per docs, that recreates the standard workspace files without overwriting existing content.

Short version

You did not lose the main agent data.
You mostly lost the config entry that points OpenClaw at it.

If you want, send:

#
ls -la ~/.openclaw/workspace ~/.openclaw/openclaw.json.bak 2>&1

and I can sanity-check the exact main snippet before you edit the config.

#

Yep, that’s enough to call it.

Root cause: main still exists on disk, but it was removed from agents.list.
So this is a config detachment, not a wipe.

What I’d do now

Ignore the Set Default button for the moment and fix the config directly.

In ~/.openclaw/openclaw.json, make your agents.list start like this:

[
  {
    id: "main",
    default: true,
    workspace: "~/.openclaw/workspace",
#
    agentDir: "~/.openclaw/agents/main/agent"
  },
  {
    id: "note_taker",
    workspace: "/root/.openclaw/workspace/note_taker",
    systemPromptOverride: "..."
  },
  {
    id: "movie_manager",
    workspace: "/root/.openclaw/workspace/movie_manager",
    systemPromptOverride: "..."
  },
  {
    id: "coder",
    workspace: "/root/.openclaw/workspace/coder",
#
    systemPromptOverride: "..."
  }
]

Then run:

openclaw config validate
openclaw gateway restart
openclaw agents list --bindings --json

What should happen

  • main shows up again in Agents
  • main becomes default
#
  • Telegram starts routing to main again
  • the old agent:main:main session should make sense again

If main comes back but workspace files are missing

Then run:

openclaw setup --workspace ~/.openclaw/workspace

That should recreate the standard bootstrap files without overwriting existing content.

Important

Do not delete note_taker, coder, or movie_manager yet.

If you want, paste the current agents: block from ~/.openclaw/openclaw.json and I’ll rewrite the exact final version for you.

mortal hazel
#

/.openclaw/agents ~/.openclaw/agents/main 2>&1
/root/.openclaw/agents:
total 24
drwx------ 5 root root 4096 Apr 18 08:14 .
drwx------ 20 root root 4096 Apr 18 16:49 ..
drwxr-xr-x 3 root root 4096 Apr 18 06:12 default
drwx------ 4 root root 4096 Apr 17 06:36 main
-rw-r--r-- 1 root root 781 Apr 18 08:14 movie_manager_config.json
drwxr-xr-x 4 root root 4096 Apr 18 06:39 note_taker

/root/.openclaw/agents/main:
total 16
drwx------ 4 root root 4096 Apr 17 06:36 .
drwx------ 5 root root 4096 Apr 18 08:14 ..
drwx------ 2 root root 4096 Apr 18 16:49 agent
drwxr-xr-x 2 root root 4096 Apr 18 16:49 sessions

#

ls -la ~/.openclaw/workspace ~/.openclaw/workspace/main 2>&1
/root/.openclaw/workspace:
total 112
drwxr-xr-x 16 root root 4096 Apr 18 16:46 .
drwx------ 20 root root 4096 Apr 18 16:49 ..
drwxr-xr-x 3 root root 4096 Apr 18 06:42 agents
-rw-r--r-- 1 root root 0 Apr 17 07:21 agents.md
-rw-r--r-- 1 root root 1975 Apr 18 15:27 AGENTS.md
-rw-r--r-- 1 root root 207 Apr 19 05:15 agents_registry.json
drwxr-xr-x 2 root root 4096 Apr 17 08:01 .clawhub
drwxr-xr-x 2 root root 4096 Apr 18 06:42 coder_docs
drwxr-xr-x 8 root root 4096 Apr 18 01:32 .git
-rw-r--r-- 1 root root 30 Apr 19 05:15 .gitignore
-rw-r--r-- 1 root root 193 Apr 18 13:07 HEARTBEAT.md
drwxr-xr-x 3 root root 4096 Apr 17 16:23 hooks
-rw-r--r-- 1 root root 1 Apr 17 07:21 identity.md
-rw-r--r-- 1 root root 160 Apr 17 06:53 IDENTITY.md
drwxr-xr-x 4 root root 4096 Apr 18 16:46 main
drwxr-xr-x 3 root root 4096 Apr 18 14:12 memory
drwxr-xr-x 6 root root 4096 Apr 18 15:26 note_taker
drwxr-xr-x 6 root root 4096 Apr 18 03:49 obsidian_vault
drwxr-xr-x 2 root root 4096 Apr 17 06:54 .openclaw
drwxr-xr-x 4 root root 4096 Apr 18 07:58 plugins
drwxr-xr-x 3 root root 4096 Apr 18 15:14 scripts
drwxr-xr-x 7 root root 4096 Apr 18 04:27 skills
-rw-r--r-- 1 root root 608 Apr 18 15:07 SOUL.md
drwxr-xr-x 2 root root 4096 Apr 17 06:46 state
-rw-r--r-- 1 root root 4902 Apr 18 15:53 TODO.md
-rw-r--r-- 1 root root 1498 Apr 18 04:35 TOOLS.md
-rw-r--r-- 1 root root 46 Apr 17 08:07 topics.json
-rw-r--r-- 1 root root 431 Apr 17 06:55 USER.md

#

/root/.openclaw/workspace/main:
total 48
drwxr-xr-x 4 root root 4096 Apr 18 16:46 .
drwxr-xr-x 16 root root 4096 Apr 18 16:46 ..
-rw-r--r-- 1 root root 7788 Apr 18 16:46 AGENTS.md
-rw-r--r-- 1 root root 1471 Apr 18 16:46 BOOTSTRAP.md
drwxr-xr-x 7 root root 4096 Apr 18 16:46 .git
-rw-r--r-- 1 root root 193 Apr 18 16:46 HEARTBEAT.md
-rw-r--r-- 1 root root 636 Apr 18 16:46 IDENTITY.md
drwxr-xr-x 2 root root 4096 Apr 18 16:46 .openclaw
-rw-r--r-- 1 root root 1747 Apr 18 16:46 SOUL.md
-rw-r--r-- 1 root root 860 Apr 18 16:46 TOOLS.md
-rw-r--r-- 1 root root 477 Apr 18 16:46 USER.md

#

ls -la ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak 2>&1
-rw------- 1 root root 5433 Apr 18 16:22 /root/.openclaw/openclaw.json
-rw------- 1 root root 4132 Apr 18 07:24 /root/.openclaw/openclaw.json.bak

winged hullBOT
#

Yep, this confirms it even more strongly: main is definitely still there on disk.

So I’d proceed with the config restore now.

Use this as your agents.list in ~/.openclaw/openclaw.json:

[
  {
    id: "main",
    default: true,
    workspace: "~/.openclaw/workspace",
    agentDir: "~/.openclaw/agents/main/agent",
  },
  {
    id: "note_taker",
#
    workspace: "/root/.openclaw/workspace/note_taker",
    systemPromptOverride:
      "Ты Заметчик. В Telegram ты печатаешь ТОЛЬКО текст заметки — без приветствий, без меток «Записала/Записал», без двоеточия после служебных слов, без «готово/понял/ок». Пример: на фразу пользователя про покупку арбуза ответ должен быть ровно «купить арбуз», а не «Записала: купить арбуз».",
  },
  {
    id: "movie_manager",
    workspace: "/root/.openclaw/workspace/movie_manager",
    systemPromptOverride:
      "Ты Агент-Киноман. Твоя задача — оформлять информацию о фильмах для Telegram-топика «Фильмы» (ID 10). Когда пользователь называет фильм, найди его описание, продолжительность и кратко оформи пост в следующем формате:\n\n🎬 **Название** (Год)\n\nПродолжительность: X минут\n\n[Краткое описание]\n\nИспользуй этот шаблон для всех записей. Печатай только текст поста, без лишних слов.",
  },
  {
    id: "coder",
    workspace: "/root/.openclaw/workspace/coder",
    systemPromptOverride:
      "Ты Агент-Кодер. Твоя задача — писать чистый, стабильный код, следовать инструкциям, оформлять код в блоки и проводить ревью.",
#
  },
]

Then run:

openclaw config validate
openclaw gateway restart
openclaw agents list --bindings --json

Expected result:

  • main reappears
  • main becomes default
  • Telegram stops defaulting to note_taker
#

If the UI still looks stale after restart, hard refresh the page.

If main comes back but is missing workspace bootstrap files, then run:

openclaw setup --workspace ~/.openclaw/workspace

You’re actually in decent shape here, the important data is still present.

#

Perfect, that settles it.

~/.openclaw/workspace is clearly a real populated workspace. It already has:

  • AGENTS.md
  • SOUL.md
  • IDENTITY.md
  • USER.md
  • TOOLS.md
  • HEARTBEAT.md

So for main, the correct workspace is ~/.openclaw/workspace, not some empty/detached folder.

Updated recommendation

Use the restore snippet I sent before, with:

#
{
  id: "main",
  default: true,
  workspace: "~/.openclaw/workspace",
  agentDir: "~/.openclaw/agents/main/agent"
}

and keep your other agents below it.

Important refinement

Because ~/.openclaw/workspace already has the bootstrap files, I would not run openclaw setup first.
You probably don’t need it for main.

Do this first:

#
openclaw config validate
openclaw gateway restart
openclaw agents list --bindings --json

If that works, main should come back and Telegram should stop defaulting to note_taker.

If openclaw config validate complains, paste the exact error and I’ll fix the config shape with you.

#

Ah, that’s the missing piece.

You actually have two candidate workspaces:

  1. ~/.openclaw/workspace
    This looks like the real long-lived workspace. It has lots of actual content, custom files, repos, notes, plugins, etc.

  2. ~/.openclaw/workspace/main
    This looks like a fresh scaffolded agent workspace. It mostly has bootstrap files and its timestamps line up with when things started going weird.

So I would still attach main to ~/.openclaw/workspace, not ~/.openclaw/workspace/main.

Why:

  • it matches the older, richer workspace that looks actively used
  • workspace/main looks more like a newly created clean shell
  • your old main sessions go back earlier than that new scaffold
#

So my recommendation stays:

{
  id: "main",
  default: true,
  workspace: "~/.openclaw/workspace",
  agentDir: "~/.openclaw/agents/main/agent"
}

Then:

openclaw config validate
openclaw gateway restart
#
openclaw agents list --bindings --json

Important nuance

If after restoring main it comes back but feels “blank” or not like your old agent, then the fallback test would be to switch that one field to:

workspace: "~/.openclaw/workspace/main"

But based on what you pasted, I would not start there.

If you want the safest possible move before editing, the best last check is:

#
ls -la ~/.openclaw/openclaw.json.bak 2>&1

If that backup exists, I’d compare it first. But if you want to move now, ~/.openclaw/workspace is my best recommendation.

#

Nice, that’s actually very helpful.

openclaw.json.bak is from before the breakage window, so that is probably the cleanest source of truth.

At this point, the safest move is not guessing between ~/.openclaw/workspace and ~/.openclaw/workspace/main, but checking what the backup actually had.

Please paste the agents section from the backup, or just run:

sed -n '1,220p' ~/.openclaw/openclaw.json.bak

If that’s too much, this narrower one is enough:

rg -n 'agents|id|workspace|default|bindings' ~/.openclaw/openclaw.json.bak
#

If the backup already contains the old main entry, then the best fix is simply to restore that exact shape instead of reconstructing it by hand.