Skip to content

fix: suppress SUBAGENT_SPAWN_ACCEPTED_NOTE for cron isolated sessions#27470

Merged
obviyus merged 2 commits intoopenclaw:mainfrom
Lukavyi:push-pumolxvryrzz
Feb 26, 2026
Merged

fix: suppress SUBAGENT_SPAWN_ACCEPTED_NOTE for cron isolated sessions#27470
obviyus merged 2 commits intoopenclaw:mainfrom
Lukavyi:push-pumolxvryrzz

Conversation

@Lukavyi
Copy link
Contributor

@Lukavyi Lukavyi commented Feb 26, 2026

Fixes #27308
Fixes #25069

Problem

The SUBAGENT_SPAWN_ACCEPTED_NOTE ("do not poll/sleep") causes cron isolated agents to immediately end their turn, because the note tells them not to wait for subagent results. In cron isolated sessions, the agent turn IS the entire run — ending early means subagent results are never collected.

Root Cause

PR #27330 attempted to fix this but used startsWith("cron:") which never matches because agentSessionKey format is agent:main:cron:... (starts with "agent:").

Fix

Detect cron sessions via includes(":cron:") in agentSessionKey and suppress the note, allowing the agent to poll/wait for subagent results naturally.

Tests

Added openclaw-tools.subagents.sessions-spawn.cron-note.test.ts with 4 tests:

  1. Suppresses note for cron isolated sessions (mode=run)
  2. Preserves note for regular sessions (mode=run)
  3. Suppresses note for any agent with :cron: in session key (not just agent:main:...)
  4. Preserves note when agentSessionKey is undefined

Verified

Tested locally on v2026.2.25 (commit c5d040bbe):

Check Duration Result
No fix (baseline) 43s ❌ "Sub-agents launched. Waiting..."
startsWith("cron:") (PR #27330) 43s ❌ Same — never matches
includes(":cron:") (this PR) 257s ✅ Full news digest delivered

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 26, 2026

Greptile Summary

Fixed cron isolated session subagent spawning by correctly detecting cron sessions via includes(":cron:") instead of the broken startsWith("cron:") approach from PR #27330. The issue was that the note "do not poll/sleep" caused cron agents to immediately end their turn before collecting subagent results, since cron sessions end when the agent produces a response.

Confidence Score: 5/5

  • This PR is safe to merge with no identified risks
  • The fix correctly addresses the root cause by using includes(":cron:") to match session keys formatted as agent:${agentId}:cron:.... Test coverage is comprehensive, covering all critical scenarios including cron sessions, regular sessions, different agent IDs, and undefined keys. The implementation is clean with clear comments and follows the repo's TypeScript style guidelines. No logical errors or edge cases identified.
  • No files require special attention

Last reviewed commit: 4fff8eb

@obviyus obviyus self-assigned this Feb 26, 2026
@arosstale

This comment was marked as spam.

Lukavyi and others added 2 commits February 26, 2026 17:54
The 'do not poll/sleep' note added to sessions_spawn tool results causes
cron isolated agents to immediately end their turn, since the note tells
them not to wait for subagent results. In cron isolated sessions, the
agent turn IS the entire run, so ending early means subagent results
are never collected.

Fix: detect cron sessions via includes(':cron:') in agentSessionKey
and suppress the note, allowing the agent to poll/wait naturally.

Note: PR openclaw#27330 used startsWith('cron:') which never matches because
the session key format is 'agent:main:cron:...' (starts with 'agent:').

Fixes openclaw#27308
Fixes openclaw#25069
@obviyus obviyus merged commit 452a8c9 into openclaw:main Feb 26, 2026
3 checks passed
@obviyus
Copy link
Contributor

obviyus commented Feb 26, 2026

Landed via temp rebase onto main.

  • Gate: skipped (manually tested per maintainer instruction)
  • Land commit: f950abd
  • Merge commit: 452a8c9

Thanks @Lukavyi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: S

Projects

None yet

3 participants