-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Bug: partialArgs JSON duplication in agentTurn cron jobs with isolated sessionTarget #53852
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug Description
When running cron jobs with
payload.kind: "agentTurn"andsessionTarget: "isolated", the tool callpartialArgsfield contains malformed JSON due to duplicate content concatenation.Error Message
Actual vs Expected Behavior
Expected (valid JSON):
Actual (malformed JSON):
The same JSON object is being concatenated twice, creating invalid JSON.
Affected Versions
2026.1.30(confirmed)2026.3.23-2(confirmed - latest stable)Reproduction Steps
Create a cron job with:
sessionTarget: "isolated"payload.kind: "agentTurn"read,exec,sessions_history)Wait for cron to trigger
Observe the error in the response
Example Cron Job That Triggers This
{ "name": "Example research job", "schedule": {"kind": "cron", "expr": "0 9 * * *", "tz": "America/New_York"}, "sessionTarget": "isolated", "payload": { "kind": "agentTurn", "message": "Read a file: read({\"path\": \"/some/file.md\"})", "model": "openrouter/moonshotai/kimi-k2.5", "timeoutSeconds": 120 } }Observed Patterns
agentTurncron jobs withsessionTarget: "isolated"systemEventjobs or main session interactionsread,exec,sessions_history)Suspected Code Location
Based on error traces, likely in the gateway's tool call serialization for isolated sessions:
gateway-cli-Dsd9gHBa.js(minified)partialJsonis handledImpact
Workaround
Disable
agentTurncron jobs withsessionTarget: "isolated"until fixed, or convert tosystemEventtype jobs if they don't require isolated execution.