[bug]: Agent create fails with "Invalid PQL syntax" when PQL filter is abandoned and switched back to Basic

Đang mở
#10,351 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
django, python, react, typescript
Lĩnh vực
api, backend, frontend

Hướng nghiên cứu

Start by tracing the agent creation form’s Filters toggle and the payload sent to POST /api/workspaces/<slug>/agent-create/, then follow backend validation for the trigger filter config and PQL parsing. Reproduce by entering an incomplete PQL filter, switching to Basic, and submitting. Done when abandoned PQL text is discarded or the form reports a clear filter error before submission.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is there an existing issue for this?
  • I have searched the existing issues
Current behavior

In the agent creation form, a trigger's Filters section has a Basic | PQL toggle. If you type a PQL statement, then switch back to Basic without clearing the PQL text, the form still creates the agent but submits a malformed PQL string built from the Basic filter plus the leftover PQL. The request fails with a generic toast:

Couldn't create the agent
Try again. If it keeps happening, contact support.

The API returns 400:

{"triggers": [{"index": 0, "errors": {"config": {"config": "Invalid PQL syntax."}}}]}

and the server logs:

PQL syntax error for query 'project IN ("<project-uuid>" ) AND': Unexpected token Token('$END', '') at line 1, column 54.
Invalid PQL syntax in event trigger filter config

The filter ends in a dangling AND with nothing after it, so the parser rejects it. The Basic view shows only a valid-looking Projects is any of ... chip, so nothing on screen indicates the problem, and the error toast does not mention the filter.

What I expect: switching back to Basic should either discard the abandoned PQL text or the form should validate the filter before submit. At minimum, the error should say the trigger filter is invalid.

Steps to reproduce
  1. Go to Agents → create a new agent.
  2. Add the trigger Work item created.
  3. In Filters, switch to PQL and type a partial statement (e.g. project IN (...) AND) without deleting it.
  4. Switch back to Basic and add a Projects is any of ... condition.
  5. Click create.
  6. See Couldn't create the agent and a 400 from POST /api/workspaces/<slug>/agent-create/.

Clearing the PQL text before switching back to Basic avoids the error.

Environment

Production

Browser

Other (Plane desktop app 3.0.4, Electron)

Edition

Commercial

Version

Backend backend-commercial:v4.0.1, desktop app 3.0.4

Ngôn ngữ chính
TypeScript
Star
63k
Fork
6.5k
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
70

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của makeplane/plane

Tất cả issue của makeplane/plane

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.