intersystems-community / intersystems-community/iris-agentic-dev

`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`

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
40
Forks
14
Avg merge
1d 23h
Merged PRs (30d)
7

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crates/iris-agentic-dev-core/src/tools/doc.rs, especially fetch_docnames_for_cat, the category mapping, and the ALL loop. Compare those requests with the documented Atelier docnames routes, then run a live IRIS regression test for default ALL and MAC/INT/INC categories. Done means valid routine-type requests succeed and ALL preserves or clearly reports category results when a request fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.