fix(agent-toolkit): read_docs resolves object_ids before ids - #484
Open
RoniLandau wants to merge 1 commit into
Open
fix(agent-toolkit): read_docs resolves object_ids before ids#484RoniLandau wants to merge 1 commit into
RoniLandau wants to merge 1 commit into
Conversation
A doc is addressable by two identifiers, id and object_id, and the number exposed in the doc URL is the object_id, so callers routinely pass an object_id while declaring type: "ids". For type "ids", object_ids is now attempted first with ids as the fallback, so a mislabeled object_id resolves on the first request. The retry is keyed on a dedicated doc_ids variable so that what to send first and whether a retry is eligible stay independent. types "object_ids" and "workspace_ids" are unchanged. Descriptions now state that the number in a doc URL is the object_id, and that results carry both identifiers. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A doc is addressable by two identifiers,
idandobject_id, and the number exposed in the doc URL (https://<account>.monday.com/docs/5097882226) is theobject_id. Callers therefore routinely pass an object_id while declaringtype: "ids".read_docspreviously triedidsfirst and only retried asobject_idsafter an empty result, so the common case paid for two round trips. This flips the order so the common case resolves on the first request.Changes
type: "ids",object_idsis attempted first andidsis the fallback.idsis renamed todoc_idsand now feeds only the fallback request; the first request sendsids: undefined. The rename is not cosmetic: the retry condition tests this variable, so while it also decided what to send first, flipping the order alone would have silently disabled the fallback. Splitting the two roles keeps "what to send first" and "is a retry eligible" independent.type: "object_ids"andtype: "workspace_ids"are unchanged — single request, no retry.getDescription()and thetypefield description now state that the number in a doc URL is theobject_idrather than theid, and that results carry both so callers can pass the matching one.Compatibility
No input schema changes. No behaviour change for correctly labelled calls, beyond one extra lookup on the
idspath.Tests
tsc --noEmitis clean and all 43 tests in the suite pass. Added coverage for the lookup order, the fallback direction, and fortype: "object_ids"/type: "workspace_ids"— neither of the latter two was previously exercised.