Skip to content

[BUG] session flag is ignored in "agent" command #1039

Description

@alielmajdaoui

Quick Summary

When starting the interactive agent with the session flag e.g picoclaw agent --session foobar, I don't see a file is created in the workspace sessions folder with the name foobar. However chatting with the agent, I see the conversation grows inside this file .../workspace/sessions/agent_main_main.json

Something interesting from the logs

2026/03/03 20:14:24 [2026-03-03T20:14:24Z] [INFO] agent: Processing message from cli:cron: what was my prev msg? {channel=cli, chat_id=direct, sender_id=cron, session_key=foobar}
2026/03/03 20:14:24 [2026-03-03T20:14:24Z] [INFO] agent: Routed message {agent_id=main, session_key=agent:main:main, matched_by=default}

The session key in first log is the one provided in the flag session_key but when routing the message, I see the session key is agent:main:main

Environment & Tools

  • PicoClaw Version: v0.2.0
  • Go Version: 1.25.7
  • AI Model & Provider: GPT-4o-mini via OpenAI
  • Operating System: macOS (picoclaw is dockerized)
  • Channels: none, just cli

📸 Steps to Reproduce

  1. run picoclaw agent --session foobar
  2. chat with the agent
  3. check if a new file created inside workspace sessions folder

❌ Actual Behavior

Sessions are shared within a single session file agent_main_main.json

✅ Expected Behavior

A new file containing session name provided should be created when running agent command with session flag

💬 Additional Context

My config file:

{
	"session": {
		"dm_scope": "per-channel-peer"
	},
	"agents": {
		"defaults": {
			"workspace": "~/.picoclaw/workspace",
			"restrict_to_workspace": true,
			"provider": "openai",
			"model": "gpt-4o-mini",
			"max_tokens": 16384,
			"max_tool_iterations": 50
		}
	},
	"channels": {
		"whatsapp": {
			"enabled": false,
			"bridge_url": "ws://localhost:3001",
			"use_native": false,
			"session_store_path": "",
			"allow_from": [],
			"reasoning_channel_id": ""
		},
		"telegram": {
			"enabled": false,
			"token": "",
			"proxy": "",
			"allow_from": [],
			"group_trigger": {},
			"typing": {
				"enabled": true
			},
			"placeholder": {
				"enabled": true,
				"text": "Thinking... 💭"
			},
			"reasoning_channel_id": ""
		}
	},
	"model_list": [
		{
			"model_name": "gpt-4o-mini",
			"model": "openai/gpt-4o-mini",
			"api_base": "https://api.openai.com/v1",
			"api_key": "🥸"
		}
	],
	"gateway": {
		"host": "127.0.0.1",
		"port": 18790
	},
	"tools": {
		"web": {
			"brave": {
				"enabled": false,
				"api_key": "",
				"max_results": 5
			},
			"tavily": {
				"enabled": false,
				"api_key": "",
				"base_url": "",
				"max_results": 0
			},
			"duckduckgo": {
				"enabled": true,
				"max_results": 5
			},
			"perplexity": {
				"enabled": false,
				"api_key": "",
				"max_results": 5
			}
		},
		"cron": {
			"exec_timeout_minutes": 5
		},
		"exec": {
			"enable_deny_patterns": true,
			"custom_deny_patterns": null
		},
		"skills": {
			"registries": {
				"clawhub": {
					"enabled": true,
					"base_url": "https://clawhub.ai",
					"auth_token": "",
					"search_path": "",
					"skills_path": "",
					"download_path": "",
					"timeout": 0,
					"max_zip_size": 0,
					"max_response_size": 0
				}
			},
			"max_concurrent_searches": 2,
			"search_cache": {
				"max_size": 50,
				"ttl_seconds": 300
			}
		},
		"media_cleanup": {
			"enabled": true,
			"max_age_minutes": 30,
			"interval_minutes": 5
		}
	},
	"heartbeat": {
		"enabled": true,
		"interval": 30
	},
	"devices": {
		"enabled": false,
		"monitor_usb": true
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions