2391 bug filtering for active chunk on agent aggregate is not ideal - #2430
Open
novasam23 wants to merge 6 commits into
Open
2391 bug filtering for active chunk on agent aggregate is not ideal#2430novasam23 wants to merge 6 commits into
novasam23 wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #2391 by improving how the API determines an agent’s “active chunk”, ensuring completed-but-still-RUNNING chunks are not treated as active and that the most relevant chunk is selected.
Changes:
- Added
AgentUtils::getActiveChunk()to centralize active-chunk selection logic (RUNNING, recent, incomplete, ordered bysolveTime). - Updated
AgentAPIandAgentAssignmentAPIto use the shared helper instead of duplicating chunk filters. - Added an API v2 test to verify that chunks reported as RUNNING but effectively complete are not returned as active.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/inc/utils/AgentUtils.php | Adds getActiveChunk() with improved filtering and ordering for active chunk selection. |
| src/inc/apiv2/model/AgentAssignmentAPI.php | Uses AgentUtils::getActiveChunk() for currentChunkId aggregation. |
| src/inc/apiv2/model/AgentAPI.php | Uses AgentUtils::getActiveChunk() when including an agent’s active chunk in aggregates. |
| ci/apiv2/test_agent.py | Adds regression test validating active chunk reporting behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
novasam23
marked this pull request as ready for review
August 11, 2026 10:32
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.
Fixes #2391