Skip to content

fix(task): route task_list queries by status to correct table#119

Merged
xiami762 merged 3 commits intomainfrom
fix/task-list-query-routing
Apr 14, 2026
Merged

fix(task): route task_list queries by status to correct table#119
xiami762 merged 3 commits intomainfrom
fix/task-list-query-routing

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

task_list without type defaulted to querying task_executions, which returns 0 results for scheduled tasks that have not yet triggered. The LLM then mistakenly believed no tasks existed and re-created them.

  • Infer query target from status value when type is omitted: scheduler statuses (active/disabled/paused) query task_schedulers, execution statuses (running/completed/failed/…) query task_executions, no parameters defaults to schedulers.
  • Add type='execution' as the canonical value; keep 'queued' as alias.
  • Validate type and status, return ToolResult errors instead of raising uncaught ValueError.
  • Distinguish output header: "Scheduled tasks" vs "Task executions".

task_list without type defaulted to querying task_executions, which
returns 0 results for scheduled tasks that have not yet triggered.
The LLM then mistakenly believed no tasks existed and re-created them.

- Infer query target from status value when type is omitted:
  scheduler statuses (active/disabled/paused) query task_schedulers,
  execution statuses (running/completed/failed/…) query task_executions,
  no parameters defaults to schedulers.
- Add type='execution' as the canonical value; keep 'queued' as alias.
- Validate type and status, return ToolResult errors instead of raising
  uncaught ValueError.
- Distinguish output header: "Scheduled tasks" vs "Task executions".

Made-with: Cursor
@duguwanglong duguwanglong requested a review from xiami762 April 14, 2026 07:37
…d_only

When type='scheduled' is passed with an execution-only status (e.g.
'completed', 'running'), the query silently fell through to an unfiltered
scheduler listing instead of returning an error. Add explicit validation
so mismatched status values are rejected with a clear message.

Also pass scheduled_only=True on the scheduler branch so the default
no-parameter path excludes run_immediately queue templates, aligning
with CLI and dashboard semantics.

Add 18 regression tests covering the routing matrix.

Made-with: Cursor
@xiami762 xiami762 merged commit 13639b2 into main Apr 14, 2026
2 checks passed
@xiami762 xiami762 deleted the fix/task-list-query-routing branch April 14, 2026 09:38
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.

2 participants