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

オープン
#10,351 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
django, python, react, typescript
領域
api, backend, frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
63k
フォーク
6.5k
平均マージ
2日 16時間
マージ済み PR(30日)
70

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

makeplane/plane のほかの issue

makeplane/plane の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。