Add gojq iteration-after-error regression tests and include cached type in filter cache error - #11788
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds gojq regression coverage and improves cache type-assertion diagnostics.
Changes:
- Reports the unexpected cached value’s concrete type.
- Tests iterator behavior after invalid-path errors.
Show a summary per file
| File | Description |
|---|---|
internal/middleware/jqschema.go |
Improves cache error context. |
internal/middleware/jqschema_iter_after_error_test.go |
Adds gojq regression tests. |
internal/middleware/jqschema_gap_coverage_test.go |
Updates the expected error message. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No write leaked through in any part. The read-only guarantee held for the gVisor runtime. References: §32742125989
|
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
✅ No write leaked — all reads succeeded, no artifact was created. Run: §32742125831
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes succeeded. Result file: References: §32742125869
|
The gojq module review flagged two optional follow-ups: no dependency work is needed (already pinned to v0.12.19), but
runJqCodestructurally exercises the "continue iterating after an error value" pattern that upstream fixed in v0.12.19, and the defensive filter-cache type-assertion error is hard to debug.Changes
internal/middleware/jqschema.go— the "should never happen" cache type-assertion failure incompileToolResponseFilterInternalnow reports the actual cached type:jqschema_gap_coverage_test.goassertion updated to match.internal/middleware/jqschema_iter_after_error_test.go(new) — pins the interaction betweenrunJqCode'sCheckMultipleResultsfollow-upiter.Next()and gojq's error values:path(1), path(.a)) does not panic — direct canary for the upstream v0.12.19 fix;tool response filtererror;path(.a), path(1)) returns the "returned multiple results" contract error without panicking.No behavior change beyond the richer error message; the rest is test coverage.