Description
Two related bugs in the openclaw agents CLI commands:
Bug 1: agents list fails when Telegram botTokens use SecretRef
openclaw agents list calls buildProviderStatusIndex() which attempts to resolve Telegram botToken SecretRef entries. In CLI context (outside the gateway runtime), SecretRef resolution fails:
[openclaw] Failed to start CLI: Error: channels.telegram.accounts.claude.botToken:
unresolved SecretRef "file:filemain:/telegram/claude/botToken".
Resolve this command against an active gateway runtime snapshot before reading it.
Stack trace:
at assertSecretInputResolved (types.secrets-C9RpLzA0.js:61:8)
at normalizeResolvedSecretInputString (types.secrets-C9RpLzA0.js:66:2)
at resolveTelegramToken (token-BxA0B3me.js:41:23)
at buildProviderStatusIndex (agents-B6LfZxia.js:727:34)
at agentsListCommand (agents-B6LfZxia.js:862:31)
Expected behavior: agents list should gracefully degrade when secrets are unavailable — show agent list without Telegram status, or skip unresolvable accounts with a warning.
Bug 2: CLI process does not exit after command completion
All openclaw agents subcommands (add, delete, list, bind) complete their operations but the Node.js process never exits. Likely caused by unclosed handles/timers from plugin loading (e.g. native-tools-bridge).
This means the CLI hangs indefinitely until killed externally (SIGKILL from timeout, Ctrl-C, etc.).
For agents add and agents delete, the operations complete successfully before the hang, so the practical impact is cosmetic (process needs to be killed). For agents list, the operation fails (Bug 1) AND the process hangs.
Steps to Reproduce
Bug 1
- Configure Telegram accounts with SecretRef botTokens in
openclaw.json
- Run
openclaw agents list
- Observe the
unresolved SecretRef error
Bug 2
- Run any
openclaw agents subcommand (e.g. openclaw agents add test --workspace ~/.openclaw/workspace-test --model anthropic/claude-sonnet-4-6 --non-interactive)
- Observe the operation completes (config written, workspace created) but the process never exits
- Process must be killed externally
Environment
- OpenClaw 2026.4.14 (323493f)
- macOS 15.7.3 (Sequoia) arm64
- Node.js v25.7.0
- Secrets stored in
secrets.json with source: "file", provider: "filemain" SecretRefs
- Plugin:
native-tools-bridge (non-bundled, discovered via extensions/)
Workaround
- For
agents list: read openclaw.json directly with python3 -c "import json; ..."
- For
agents add/delete/bind: the operations succeed despite the hang; just kill the process after seeing the expected output
Description
Two related bugs in the
openclaw agentsCLI commands:Bug 1:
agents listfails when Telegram botTokens use SecretRefopenclaw agents listcallsbuildProviderStatusIndex()which attempts to resolve TelegrambotTokenSecretRef entries. In CLI context (outside the gateway runtime), SecretRef resolution fails:Stack trace:
Expected behavior:
agents listshould gracefully degrade when secrets are unavailable — show agent list without Telegram status, or skip unresolvable accounts with a warning.Bug 2: CLI process does not exit after command completion
All
openclaw agentssubcommands (add,delete,list,bind) complete their operations but the Node.js process never exits. Likely caused by unclosed handles/timers from plugin loading (e.g.native-tools-bridge).This means the CLI hangs indefinitely until killed externally (SIGKILL from timeout, Ctrl-C, etc.).
For
agents addandagents delete, the operations complete successfully before the hang, so the practical impact is cosmetic (process needs to be killed). Foragents list, the operation fails (Bug 1) AND the process hangs.Steps to Reproduce
Bug 1
openclaw.jsonopenclaw agents listunresolved SecretReferrorBug 2
openclaw agentssubcommand (e.g.openclaw agents add test --workspace ~/.openclaw/workspace-test --model anthropic/claude-sonnet-4-6 --non-interactive)Environment
secrets.jsonwithsource: "file", provider: "filemain"SecretRefsnative-tools-bridge(non-bundled, discovered via extensions/)Workaround
agents list: readopenclaw.jsondirectly withpython3 -c "import json; ..."agents add/delete/bind: the operations succeed despite the hang; just kill the process after seeing the expected output