fix: filter agent executions with a structured startTime query (#97) - #111
Open
mp-orkes wants to merge 1 commit into
Open
fix: filter agent executions with a structured startTime query (#97)#111mp-orkes wants to merge 1 commit into
mp-orkes wants to merge 1 commit into
Conversation
`agent execution --since/--window` built `freeText=startTime:[<ms> TO *]`, a range no Conductor index backend honors. SQLite turns freeText into `json_data LIKE '%…%'`, and Elasticsearch returns nothing for the range, so every time-filtered search came back empty while the unfiltered one listed rows. Search now goes through `/workflow/search` with `classifier=agent` and `topLevelOnly=true`, carrying the bounds in the structured `query` expression (`startTime><ms>`) — the same call the Conductor UI makes for its own Agent Executions view. `/agent/executions` cannot serve this: it builds its query internally and ignores a caller-supplied `query`. Notes: - Only `>` and `<` are used. `>=` is rejected by both query parsers with a 500. - Values are single-quoted, so a value containing a quote is rejected rather than silently changing what the expression means. - Results whose `classifier` is not `agent` are dropped, in case a server's index ignores the parameter and returns plain workflows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mp-orkes
force-pushed
the
fix/issue-97-agent-execution-time-filter
branch
from
August 7, 2026 17:24
3869b91 to
eb86b7d
Compare
mp-orkes
marked this pull request as ready for review
August 7, 2026 17:54
mp-orkes
requested review from
ambiorix2099,
bradyyie,
manan164,
nthmost-orkes and
v1r3n
August 7, 2026 17:56
Contributor
Author
ambiorix2099
approved these changes
Aug 7, 2026
ambiorix2099
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Left questions for your consideration as a single comment.
Comment on lines
+347
to
+353
| func (r workflowSearchResult) toExecutionPage() ExecutionPage { | ||
| page := ExecutionPage{TotalHits: r.TotalHits} | ||
| for _, w := range r.Results { | ||
| // A server that ignores the classifier param returns plain workflows too. | ||
| if w.Classifier != "" && w.Classifier != classifierAgent { | ||
| continue | ||
| } |
Contributor
There was a problem hiding this comment.
LTGM. The below are simply questions for your consideration.
TotalHits comes from the server here but Results gets filtered just below, so the %d of %d line in cmd/agent.go can end up printing something like 3 of 50.
Q1. Adjust the count when we drop rows, or not filter client-side at all?
Related: the notes say the mapper skips non-agent rows, but w.Classifier != "" keeps them when the field is absent, which is exactly the pre-classifier server case you're describing.
Q2. Intentional?
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.

Issue
Every time-filtered search was empty while the unfiltered one listed rows - #97.
What changed
agent execution --since/--windowbuiltfreeText=startTime:[<ms> TO *].freeTextintojson_data LIKE '%startTime:[…]%', which never matches.queryStringQueryand returns 0.Search now goes through
/workflow/searchwithclassifier=agent&topLevelOnly=true. Same as Conductor UI on Agent Executions view.Why not
/agent/executions? That endpoint builds its search query internally and exposes no time-range parameter. A caller-suppliedqueryis ignored.How to test
Review notes
>only.>=is rejected by both query parsers with a 500 (For input string: "=<ms>"), because neither defines the operator.field='value'. A value containing a quote would change what the expression means, so it errors instead.classifierfield ignores the filter and returns plain workflows. The mapper skips rows whoseclassifieris notagent.WorkflowResourceApiSearchOptshas noclassifierortopLevelOnly.🤖 Generated with Claude Code