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

Aperta
#10,351 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
django, python, react, typescript
Ambito
api, backend, frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
63k
Fork
6.5k
Merge medio
2g 16h
PR unite (30g)
70

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di makeplane/plane

Tutte le issue di makeplane/plane

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.