Skip to content

2391 bug filtering for active chunk on agent aggregate is not ideal - #2430

Open
novasam23 wants to merge 6 commits into
masterfrom
2391-bug-filtering-for-active-chunk-on-agent-aggregate-is-not-ideal
Open

2391 bug filtering for active chunk on agent aggregate is not ideal#2430
novasam23 wants to merge 6 commits into
masterfrom
2391-bug-filtering-for-active-chunk-on-agent-aggregate-is-not-ideal

Conversation

@novasam23

Copy link
Copy Markdown
Contributor

Fixes #2391

@novasam23 novasam23 linked an issue Aug 10, 2026 that may be closed by this pull request
@novasam23
novasam23 marked this pull request as draft August 10, 2026 13:54
@novasam23 novasam23 self-assigned this Aug 10, 2026
@novasam23
novasam23 requested a lite review from Copilot August 11, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by solveTime).
  • Updated AgentAPI and AgentAssignmentAPI to 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.

Comment thread ci/apiv2/test_agent.py Outdated
Comment thread src/inc/apiv2/model/AgentAPI.php
Comment thread src/inc/apiv2/model/AgentAssignmentAPI.php
novasam23 and others added 3 commits August 11, 2026 12:16
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
novasam23 marked this pull request as ready for review August 11, 2026 10:32
@novasam23
novasam23 requested a review from jessevz August 11, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Filtering for active chunk on agent aggregate is not ideal

2 participants