fix(jq_link): tolerate mixed-type body arrays#163
Open
howethomas wants to merge 1 commit into
Open
Conversation
Retry jq filters with string-only body arrays after string-function type errors so legacy tag-like attachments do not get dropped. Document the fallback and safer string-guard filter patterns for new jq configs. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the jq_link conserver link against legacy vCons that contain mixed-type values inside attachment/analysis body arrays by retrying jq evaluation with body arrays sanitized to strings when jq raises a string-input type error. It also adds documentation and a unit test covering the fallback behavior.
Changes:
- Add a retry path in
jq_linkthat sanitizesbodyarrays to string-only when a jq string-function type error occurs (plus a new retry counter metric). - Add a unit test validating that string-based jq filters tolerate mixed-type
bodyarrays. - Add/extend documentation (MkDocs reference page + README updates) describing the fallback and safer jq filter patterns.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mkdocs.yml | Adds the new jq_link reference page to the docs navigation. |
| docs/reference/links/jq.md | New reference documentation for configuring and using jq_link, including mixed-type body guidance. |
| conserver/links/jq_link/test_jq_link.py | Adds a regression test for mixed-type body arrays with string-based jq filters. |
| conserver/links/jq_link/README.md | Documents the new retry behavior and updates module references in examples. |
| conserver/links/jq_link/init.py | Implements the retry + sanitization fallback and emits a retry metric. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -101,18 +101,43 @@ The link accepts two configuration options: | |||
| - `filter` (string): A jq expression that evaluates to a boolean | |||
| module: "links.jq_filter" | ||
| module: "links.jq_link" | ||
| options: | ||
| filter: '.attributes.arc_display_type == "Cat"' |
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.
Retry jq filters with string-only body arrays after string-function type errors so legacy tag-like attachments do not get dropped. Document the fallback and safer string-guard filter patterns for new jq configs.