#11296: fix: add sessionKey alias to sessions_spawn for backward compatibility
agents
stale
Cluster:
Cron Job Enhancements
## Problem
Cron jobs using spawn-worker.js were failing with 'No sessionKey in spawn result' because the sessions_spawn tool returns childSessionKey but callers expect sessionKey.
## Solution
Added sessionKey as an alias for childSessionKey in the sessions_spawn tool result. This ensures backward compatibility with existing callers while maintaining the more descriptive childSessionKey name.
## Testing
- Local testing confirmed the fix resolves cron spawn failures
- Both sessionKey and childSessionKey are now available in the result
## Related
This complements the local fix in spawn-worker.js that now accepts either field name for maximum compatibility.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds a backward-compatible `sessionKey` field to the `sessions_spawn` tool JSON response as an alias for `childSessionKey`. This restores compatibility with existing callers (e.g., cron/spawn-worker flows) that still expect `sessionKey`, while keeping the more explicit `childSessionKey` available.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a single additive field in the tool response (`sessionKey` aliasing `childSessionKey`) and does not alter control flow or behavior of session spawning; it only improves compatibility for existing consumers.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13331: feat(sessions_spawn): add sessionKey param to reuse sub-agent sessions
by Be1Human · 2026-02-10
79.7%
#20188: fix: Update sessionFile path when rolling to new session in cron jobs
by jriff · 2026-02-18
77.2%
#20072: feat(sessions_spawn): add sessionKey param to reuse sub-agent sessions
by Be1Human · 2026-02-18
74.7%
#16061: fix(sessions): tolerate invalid sessionFile metadata
by haoyifan · 2026-02-14
74.2%
#4567: Webchat: canonicalize main session key for /new (fix #4446)
by selfboot · 2026-01-30
73.8%
#23562: feat: add sessionFreshness config for isolated cron jobs (#23539)
by MunemHashmi · 2026-02-22
73.5%
#6315: fix(cron): persist isolated sessions (fixes #6217) - attempt 2
by ChaitanyaSai-Meka · 2026-02-01
73.4%
#6850: fix: support direct channel:account:peer format in session key extr...
by toboto · 2026-02-02
73.2%
#3410: fix(sessions): always compute session paths from current environment
by sakunsylvi · 2026-01-28
73.0%
#6653: fix: persist archived session entry on /new or /reset
by leicao-me · 2026-02-01
73.0%