Skip to content

fix(jq_link): tolerate mixed-type body arrays#163

Open
howethomas wants to merge 1 commit into
mainfrom
bug/jq-link-mixed-body-arrays
Open

fix(jq_link): tolerate mixed-type body arrays#163
howethomas wants to merge 1 commit into
mainfrom
bug/jq-link-mixed-body-arrays

Conversation

@howethomas
Copy link
Copy Markdown
Contributor

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.

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>
@howethomas howethomas linked an issue May 11, 2026 that may be closed by this pull request
@howethomas howethomas requested a review from Copilot May 11, 2026 19:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_link that sanitizes body arrays 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 body arrays.
  • 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"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed throwing jq errors

2 participants