`iris_doc mode=list` fails with HTTP 400 for `category` MAC/INT/INC and for the default `ALL`: Atelier `docnames/:cat` only accepts `*`, `CLS`, `RTN`, `CSP`, `OTH`

Aperta
#140 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia da crates/iris-agentic-dev-core/src/tools/doc.rs, in particolare da fetch_docnames_for_cat, dalla mappatura delle categorie e dal ciclo ALL. Confronta queste requests con le route docnames documentate di Atelier, quindi esegui un test di regressione IRIS live per le categorie predefinite ALL e MAC/INT/INC. Il lavoro è completato quando le requests valide di tipo routine hanno esito positivo e ALL conserva o segnala chiaramente i risultati delle categorie quando una request fallisce.

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

Descrizione

Environment

  • iris-agentic-dev v1.3.0 (same code in v1.4.2 and on master at 5f38c46)
  • Windows 11, IRIS for Health 2026.1 (Build 235U), Atelier REST through the web server on port 80
  • MCP mode, connection from .iris-agentic-dev.toml

Symptom

iris_doc with mode="list" works only when category="CLS" is passed explicitly:

Call Result
{"mode":"list","pattern":"MyPkg.*","namespace":"<NS>"} (default category ALL) {"error":"failed to fetch MAC docnames: HTTP 400 Bad Request","error_code":"SERVER_ERROR","success":false}
same with "category":"MAC" / "INT" / "INC" failed to fetch MAC/INT/INC docnames: HTTP 400 Bad Request
same with "category":"CLS" OK, lists the matching classes

Because ALL is the default, any list call without an explicit category fails, and MAC/INT/INC can never work.

Root cause

fetch_docnames_for_cat builds /docnames/{cat} with cat in CLS, MAC, INT, INC
(doc.rs#L1704-L1726, and the category mapping at
#L1744-L1766).

In the Atelier API, MAC, INT and INC are types inside the RTN category, not categories. The route
is GET /api/atelier/v1/:namespace/docnames/:cat/:type, and %Api.Atelier.v1:GetDocNames (identical in v2 and
v8 on 2026.1) rejects any other :cat with 400:

Set pCat=$zcvt(pCat,"U")
If ",*,CLS,RTN,CSP,OTH,"'[(","_pCat_",") {
    Set %response.Status=..#HTTP400BADREQUEST

In addition, the ALL loop returns on the first failing category
(#L1780-L1791),
so the CLS results already fetched are discarded.

Reproduction without the tool

Plain GET with Basic auth against the same instance and namespace:

Request HTTP documents
/api/atelier/v1/<NS>/docnames/CLS 200 13610
/api/atelier/v1/<NS>/docnames/MAC 400
/api/atelier/v1/<NS>/docnames/INT 400
/api/atelier/v1/<NS>/docnames/INC 400
/api/atelier/v1/<NS>/docnames/XYZ (invalid on purpose) 400
/api/atelier/v1/<NS>/docnames/RTN/MAC 200 6
/api/atelier/v1/<NS>/docnames/RTN/INT 200 20
/api/atelier/v1/<NS>/docnames/RTN/INC 200 364
/api/atelier/v1/<NS>/docnames/RTN/MAC,INT,INC 200 390 (= 6 + 20 + 364)

Suggested fix

  1. Map MAC → /docnames/RTN/MAC, INT → /docnames/RTN/INT, INC → /docnames/RTN/INC. For ALL, one call to
    /docnames/CLS plus one to /docnames/RTN/MAC,INT,INC is enough.
  2. Do not throw away the successful categories when one fails in ALL: return what was fetched and report the
    failing category, or fail with a message that says which request was rejected.
  3. A regression test for list without category (and with MAC/INT/INC) against a live IRIS would catch it.

Workaround

Always pass "category":"CLS" for classes. For routines and include files there is currently no working list
mode.

Lingua principale
Rust
Stelle
45
Fork
17
Merge medio
2g 11h
PR unite (30g)
15

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 intersystems-community/iris-agentic-dev

Tutte le issue di intersystems-community/iris-agentic-dev

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.