fix(agiloft): correct response parsing, add EWGetChoiceLineId tool#4477
fix(agiloft): correct response parsing, add EWGetChoiceLineId tool#4477waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Bug fixes & compatibility: fixes Schema/docs polish: adjusts saved-search Reviewed by Cursor Bugbot for commit 791ca00. Configure here. |
Greptile SummaryThis PR fixes several bugs in the Agiloft integration's response parsing and HTTP semantics, and adds a new
Confidence Score: 5/5Safe to merge — all changes are targeted bug fixes or additive, with no regressions to existing tool contracts. The changes correct clearly wrong behaviour (GET instead of DELETE, missing XML→JSON negotiation, wrong field names, skipped result unwrapping) and introduce a new, self-contained tool. Each fix is narrow and well-scoped; the new tool follows established patterns exactly and handles multiple response shapes defensively. No shared infrastructure is modified, and no existing output contracts change in a breaking way. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant ExecuteAgiloftRequest
participant AgiloftAPI
Client->>ExecuteAgiloftRequest: params (instanceUrl, kb, login, password, ...)
ExecuteAgiloftRequest->>AgiloftAPI: POST /ewws/EWLogin → Bearer token
AgiloftAPI-->>ExecuteAgiloftRequest: {access_token}
alt search_records / select_records
ExecuteAgiloftRequest->>AgiloftAPI: GET /ewws/EWSearch/.json or EWSelect/.json
AgiloftAPI-->>ExecuteAgiloftRequest: {result: [...]} or {EWREST_*}
Note over ExecuteAgiloftRequest: Unwrap data.result ?? data,<br/>then walk EWREST_ keys
else get_choice_line_id (new)
ExecuteAgiloftRequest->>AgiloftAPI: GET /ewws/EWGetChoiceLineId/.json?field=&value=
AgiloftAPI-->>ExecuteAgiloftRequest: number | string | {id:...} | {result:...}
Note over ExecuteAgiloftRequest: Multi-shape parse → choiceLineId
else REST CRUD (create/read/update/delete)
ExecuteAgiloftRequest->>AgiloftAPI: POST/GET/PUT/DELETE /ewws/REST/{kb}/{table} + Accept: application/json
AgiloftAPI-->>ExecuteAgiloftRequest: JSON record
else remove_attachment (fixed)
ExecuteAgiloftRequest->>AgiloftAPI: DELETE /ewws/EWRemoveAttachment (was GET)
AgiloftAPI-->>ExecuteAgiloftRequest: remaining count
end
ExecuteAgiloftRequest->>AgiloftAPI: POST /ewws/EWLogout (best-effort)
ExecuteAgiloftRequest-->>Client: ToolResponse
Reviews (2): Last reviewed commit: "fix(agiloft): address PR review feedback" | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 791ca00. Configure here.
…4477) * fix(agiloft): correct response parsing, add EWGetChoiceLineId tool * fix(agiloft): address PR review feedback
Summary
search_recordsandselect_recordsto unwrapdata.resultbefore walkingEWREST_*keys (was returning empty arrays)attachment_infoto read correct API field names (filePosition/fileName/size)Accept: application/jsonheaders to REST CRUD tools (Agiloft defaults to XML)remove_attachmentHTTP method to DELETEEWGetChoiceLineIdtool for resolving choice display values to internal IDs (needed for EWSelect WHERE clauses on choice fields)#FFFFFFto brand navy#001028Type of Change
Testing
Tested manually. Typecheck, lint, and
check:api-validationall pass.Checklist