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

未关闭
#10,351 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
70

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

makeplane/plane 的其他 Issue

查看 makeplane/plane 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。