Repository navigation
fix(cron): auto-fill agentId from session when not explicitly provided - #40571
Closed
ChanningYul wants to merge 1 commit into
Closed
ChanningYul wants to merge 1 commit into
ChanningYul wants to merge 1 commit into
Conversation
When a sub-agent creates a cron job without specifying an agentId,
the system now correctly auto-fills the agentId from the current session.
Previously, the condition `!("agentId" in job)` would fail when
`agentId: undefined` was passed (e.g., from CLI), because the key
existed but the value was undefined.
The fix changes the condition to check for a valid string value,
while preserving the special case of `agentId: null` (user explicitly
wants no agent).
Fixes: Sub-agents creating cron jobs would have empty agentId fields
instead of their own agent ID.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
Greptile SummaryThis PR correctly fixes a subtle auto-fill bug in the cron tool's
Key changes:
The logic is sound, backward-compatible, and all 35 tests pass. Confidence Score: 5/5
Last reviewed commit: 7a61030 |
|
This pull request has been automatically marked as stale due to inactivity. |
Member
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--agent, the system now correctly auto-fills theagentIdfrom the current session.!("agentId" in job)would fail whenagentId: undefinedwas passed (e.g., from CLI), because the key existed but the value was undefined.agentId: null(user explicitly wants no agent).Background
This fix addresses a design issue reported by the community:
Test plan
agentId: nullpreservation still pass🤖 Generated with Claude Code