omi icon indicating copy to clipboard operation
omi copied to clipboard

[Bounty proposal] fix(linear-app): parameterize GraphQL queries and coerce limit inputs

Open Ivansky1 opened this issue 2 months ago • 0 comments

### Symptom

  1. Unvalidated Input & Query Syntax Errors: In plugins/omi-linear-app/main.py, tool_list_my_issues and tool_list_recent_issues directly interpolated limit into GraphQL queries via raw f-string formatting (first: {limit}). When LLMs or tool callers supply formatted string tokens (e.g. "10", negative numbers, or non-numeric tokens), an unhandled GraphQL syntax error is raised.
  2. Missing Bounds Validation: Neither tool clamped or bounded the requested limit, allowing requests to specify arbitrarily large or negative limit values.
  3. Unsanitized Filter Clauses: tool_list_recent_issues inserted unescaped team strings directly into GraphQL queries, rather than using structured GraphQL variables.

Evidence

  • plugins/omi-linear-app/main.py lines 598–615 and 668–708.
  • Tested locally: string inputs and malformed limits trigger query parsing errors before reaching the data layer.

Fix

  • Implemented coerce_limit(value, default=10, min_val=1, max_val=50) to safely clamp limit values.
  • Converted tool_list_my_issues and tool_list_recent_issues to use parameterized GraphQL variables ($first: Int!, $filter: IssueFilter) and structured dictionary filter objects.
  • Added comprehensive hermetic test suite in plugins/omi-linear-app/test_list_issues_params.py (3 tests verifying clamping, coercion, variable extraction, and normalization).
  • Registered linear-list-issues-params-tests in .github/checks-manifest.yaml.

PR ready: #13919


Bounty Payout Destination (EVM / Base USDC): 0xb5aFc89b57Fa8270bB7261348179D28099BEa2a0
cc @josancamon19 @kodjima33

Ivansky1 avatar Sep 14 '26 20:09 Ivansky1