Skip to content

09-talk-helpers: handle flat-array JSON from openclaw 2026.5.20+#1

Open
teddashh wants to merge 1 commit into
mainfrom
fix/talk-helpers-flat-array-json
Open

09-talk-helpers: handle flat-array JSON from openclaw 2026.5.20+#1
teddashh wants to merge 1 commit into
mainfrom
fix/talk-helpers-flat-array-json

Conversation

@teddashh

Copy link
Copy Markdown
Owner

Summary

scripts/09-talk-helpers.sh silently falls back to a hardcoded default agent list (main, hermes-maintainer) on OpenClaw 2026.5.20+ because openclaw agents list --json now returns a top-level JSON array rather than the older {"agents":[…]} shape. The current jq filter .agents // [] | … evaluates to empty against the new format, triggering the "Could not parse — falling back to defaults" warn path. Result: any newly registered subagent (e.g. project subagents added via openclaw agents add) gets no talk-* shortcut.

What this PR changes

One-file fix in scripts/09-talk-helpers.sh. The jq filter now accepts both shapes:

(if type == "array" then . else (.agents // []) end)
| map(.name // .id)
| .[]

Also bumps the default fallback agents_json from '{}' to '[]' so the new filter handles the no-CLI case gracefully.

How I hit this

Discovered while standing up a new peach1 install (third node alongside vnic + castle1). After running scripts/all.sh, the freshly registered project subagent peach1-network-setup had no talk- shortcut. Investigating turned up the silent jq fallback. Fix has been running on the peach1 fork (teddashh/openclaw-watcher-peach1@5259b46) — talk-peach1-network-setup now generated correctly alongside talk-main / talk-maintainer / talk-hermes.

Test plan

  • On any host running OpenClaw 2026.5.20+: register a new agent (openclaw agents add foo --workspace /tmp/foo --non-interactive), then run bash scripts/09-talk-helpers.sh, confirm ~/.local/bin/talk-foo is created instead of the warn + default fallback.
  • On hosts still pinned to an older OpenClaw where agents list --json returns the old shape: confirm the script still works (filter is backwards-compatible via the type == "array" branch).
  • Verify no behavior change when openclaw isn't on PATH (graceful fallback via the post-filter [ -z "$agent_names" ] check).

🤖 Generated with Claude Code

`openclaw agents list --json` now returns a top-level JSON array rather than
`{"agents":[...]}`. The old jq filter `.agents // [] | …` silently returned
empty on the new format, triggering the "fall back to defaults" path so only
talk-main / talk-maintainer / talk-hermes were generated — any newly added
subagent (e.g. peach1-network-setup) got no shortcut.

New filter accepts both shapes:

  (if type == "array" then . else (.agents // []) end)

Should be PR'd to upstream openclaw-hermes-watcher.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant