Repository navigation
fix(linear-app): coerce search_issues limit instead of binding null to $first (#14270) - #14271
Conversation
…o $first The BasedHardware#13920 coerce-limit pass covered tool_list_my_issues and tool_list_recent_issues but left tool_search_issues on a raw `body.get("limit", 5)`. dict.get returns None -- not the default -- when the key is present and null, which is what the backend sends for an omitted optional parameter, so `first` reached Linear as null against a non-nullable `$first: Int!`. The issues(filter:) fallback binds the same value, so the tool had no recovery path and every limit-less search failed. Non-numeric and over-cap limits were forwarded unclamped too. Route the caller-supplied limit through the existing coerce_limit() helper, matching the two list tools. Adds test_search_issues_params.py: a hermetic, standard-library-only suite mirroring test_list_issues_params.py so it runs in the manifest lane. It fails 13 assertions against the previous behaviour and covers both the primary and fallback query paths. Co-Authored-By: Claude Opus 5 <[email protected]>
Git-on-my-level
left a comment
There was a problem hiding this comment.
Verified fix for #14270 — both the diagnosis and the one-line repair check out. Requesting changes only for two metadata items; the code itself needs no changes.
Code review on ed6053a:
plugins/omi-linear-app/main.py— the change routesbody.get("limit")through the module's existingcoerce_limit(line 574), exactly matching the sibling call sites at line 603 (tool_list_my_issues) and line 686 (tool_list_recent_issues). That closes the gap the #13920 pass left:dict.get("limit", 5)returnsNone— not the default — when the key is present as JSONnull(what the backend sends for an omitted optional), and thatNonewas bound against non-nullable$first: Int!on both paths — the primarysearchIssuesquery (line 893) and theissues(filter:)fallback (line 920) — so every limit-less search failed with no recovery path. I confirmed no un-coercedbody.get("limit"binding remains in the file.plugins/omi-linear-app/test_search_issues_params.py— genuinely hermetic (standard library only; the stubbedrequests.postanddbfunctions raise on unexpected use,os.environis cleared at load). I ran it three ways: on this head 3/3 pass; against the pre-fix module the same suite reproduces the reported failure with exactly the 13 failed assertions documented in the description, headlinefirst must never be null against $first: Int!; and the full plugin suite (test_graphql_errors,test_issue_lookup,test_list_issues_params, plus this file) is 22/22 green when invoked from the repo root, which is how the manifest lane runs it.
Two items before merge, both metadata:
- Blocking for the required hygiene check: the commit subject begins with
fix(, and the failure-class protocol requires exactly oneFailure-Class:declaration in the PR body. The body currently has none, so thefailure-class-protocolcheck will fail withmissing_declaration. Adding a single lineFailure-Class: noneto the PR body resolves it — no registry class matches this fix, sononeis the right form here. - Please register the new suite in
.github/checks-manifest.yamlnext tolinear-list-issues-params-tests— an entry likelinear-search-issues-params-testsrunningplugins/omi-linear-app/test_search_issues_params.pywith the sameplugins/omi-linear-app/**triggers. Without it the new regression guard never runs in CI, and the #13920 sibling suite is registered exactly this way.
Once the body trailer is added and the suite is registered, this should be ready to merge — the remaining sign-off is left to the human maintainers.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
kodjima33
left a comment
There was a problem hiding this comment.
Code fix verified correct for #14270 (reviewer confirmed diagnosis + tests), but CHANGES_REQUESTED for two metadata items (Failure-Class trailer, checks-manifest registration) are still missing — approve only, not merging until resolved.
Adds linear-search-issues-params-tests alongside the BasedHardware#13920 sibling so the new regression guard runs in the local and CI lanes on any plugins/omi-linear-app change. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Thanks for the thorough review. Both items addressed:
|
Both items from this change request are verified resolved on 8299823: the PR body now declares 'Failure-Class: none' exactly once, and linear-search-issues-params-tests is registered in .github/checks-manifest.yaml with matching triggers and lanes (the follow-up commit touches only the manifest, so the reviewed fix is unchanged). The suite was re-run on this head: 3/3 pass. Clearing this change request; nothing further is outstanding from automation.
Closes #14270
Problem
plugins/omi-linear-app/main.py:880bound the caller'slimitstraight into GraphQL:dict.getreturnsNone— not the default — when the key is present with a JSONnull, which is what the backend sends for an omitted optional parameter. The module's owncoerce_limitdocstring (line 574) documents this case.That
Noneis bound asfirstagainst a non-nullable variable on both query paths:query($term: String!, $first: Int!)query($filter: IssueFilter!, $first: Int!)Linear rejects
nullforInt!at validation, and because theissues(filter:)fallback binds the same value it fails identically — no recovery path. Every search where the model omitslimitreturnedSearch failed: .... Non-numeric and over-cap limits ("7",999,-4,{"n": 5}) were forwarded unclamped as well.The #13920 coerce-limit pass fixed
tool_list_my_issuesandtool_list_recent_issues;tool_search_issueswas missed.Fix
One line, through the helper already in the file, matching lines 603 and 686:
Tests
New
plugins/omi-linear-app/test_search_issues_params.py— hermetic, standard library only, mirroringtest_list_issues_params.pyso it runs in the manifest lane under plainpython3.test_limit_arrives_as_bounded_int_variable— absent / null / string / over-cap / negative / zero / float / bool / list / dict / injection-shaped all arrive as a boundedinttest_fallback_query_also_binds_a_coerced_limit— forces the primary query to fail and asserts the fallback binds a coerced limit tootest_search_never_sends_null_first— direct regression guardFails 13 assertions against
main, headlinefirst must never be null against $first: Int!. Passes with the fix.test_list_issues_params.py,test_graphql_errors.pyandtest_issue_lookup.pyremain green.Failure-Class: none
🤖 Generated with Claude Code