lang-core: excess-args is an error even when the element renders in full, and doesn't say what was dropped
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- compilers
Direzione di ricerca
Inizia in packages/lang-core/src/parser/validation.ts da pushValidationIssue, che oggi imposta severity: "warning" solo per il fallback no-root, e leggi il commento di documentazione di severity in ValidationError a cui fa riferimento. Poi trova il punto di chiamata che emette excess-args e calcola il conteggio, e verifica se i nodi degli argomenti scartati sono ancora nello scope in quel punto così da poterli allegare all'issue. Esegui i test del parser di lang-core con la riproduzione dell'issue (Stack/Table con un null finale) per confermare il caso di warning e che un argomento scartato non nullo continua a generare un errore. È completato quando entrambi i casi sono distinguibili solo da meta.errors.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When a component is called with more arguments than its signature, excess-args is reported as a plain error (no severity). The extra arguments are dropped and the element still renders in full. By the severity doc comment on ValidationError ("warning" when the program still renders), that looks like a warning. As it stands, a host that shows errors to people reports a failure under an element that rendered correctly.
The error also doesn't say what was dropped. A host can't tell a harmless trailing null apart from a real loss, such as a value the model meant for an argument that doesn't exist. Both cases give the same error.
To Reproduce
root = Stack([tbl])
tbl = Table([Col("Owner", ["Ana", "Ben"]), Col("Task", ["Draft", "Review"])], null)
Parse it with createParser(openuiLibrary.toJSONSchema(), "Stack") (@openuidev/lang-core 1.1.1, @openuidev/react-ui 0.18.9, where the signature is Table(columns: Col[])):
meta.errorsis[{ code: "excess-args", component: "Table", statementId: "tbl", message: "Table takes 1 arg(s), got 2 (1 excess dropped)" }], with noseverity.rootis not null, and the Table has both columns and all rows.
I saw this from a model writing a table in a chat reply: it added a trailing null. pushValidationIssue in packages/lang-core/src/parser/validation.ts sets severity: "warning" only for the no-root fallback, and that is the same on main today.
Expected behavior
- When every dropped argument is
null,excess-argsis markedseverity: "warning", because nothing is lost. - When a dropped argument has a value, it stays an error, because something the model wrote is not shown. It would help if the error carried the dropped arguments (or at least whether any of them was non-null), so hosts and autofix loops can tell the two cases apart without re-parsing.
Additional context
For now I work around it by re-tokenizing the statement named by statementId (tokenize, split, parseExpression, walkAST) and checking whether the dropped arguments are all Null nodes.
Thanks,
Sebastian
- Lingua principale
- TypeScript
- Stelle
- 10k
- Fork
- 698
- Merge medio
- 1g 7h
- PR unite (30g)
- 134
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di thesysdev/openui
-
lang-core: member access on a component instance reads its internal fields instead of giving nullApertabug package: lang-core
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
react-ui: OpenUI Lang ScatterChart ignores xLabel and yLabelForse già presa @udsy19 l’ha presa 7 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
lang-core: prompt signatures list z.enum keys instead of valuesForse già presa @udsy19 l’ha presa 7 giorni fa. Apertabug package: lang-core
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement package: lang-core
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
bug package: lang-core
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di thesysdev/openui
Issue simili
-
[Bug]: OpenCode v2 skips an assistant message that gains text after an earlier captureForse già presa @jianyx1 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
volcengine/OpenViking#8354 ·
I maintainer di solito rispondono entro 1 giorno
-
frontend: Job: Details do not show completed or failed indexes or the per-index backoff limitsForse già presa @arshil42 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kubernetes-sigs/headlamp#8630 ·
I maintainer di solito rispondono entro 1 giorno
-
bug from-app needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
nightly-labs/openbot#15640 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
-
comp/desktop desktop/settings P2 tool/skills type/perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NousResearch/hermes-agent#159515 ·
I maintainer di solito rispondono entro 1 giorno