omi
omi copied to clipboard
[Bounty proposal] fix(linear-app): resolve team targets and sanitize issue identifiers ($50 proposed)
Summary
Currently, plugins/omi-linear-app experiences several reliability and correctness issues when managing Linear issues, teams, and workflows:
- Silent Misrouting of Issues: When calling
tool_create_issuewithout a specifiedteam_id, if the user belongs to multiple teams and no default team is configured, it silently falls back toteams[0]. This causes issues to be created in the wrong team/project. Furthermore, if a caller supplies a team key (e.g.,ENG) or human-readable team name instead of an internal Linear UUID, the GraphQL mutation fails. - Identifier Fragility: Callers and chat tools frequently provide issue identifiers formatted with leading prefixes (e.g.,
#ENG-123,issue: #ENG-123), full Linear web URLs (https://linear.app/workspace/issue/ENG-123/slug), or untyped primitives, causingissue(id: ...)queries to fail or throw unhandled exceptions. - GraphQL Null-Field Crashes: If an issue's GraphQL response contains
nulloptional fields (such asteam: null,state: null,project: null, orlabels: null),tool_get_issueandtool_update_issue_statuscrash withAttributeErrororKeyErrorupon property access. Furthermore, ifteamsorstatesreturnnodes: null, iteration crashes withTypeError: 'NoneType' object is not iterable(causing a 500 error on the home route). - State Lookup Space-Leak: Passing whitespace-only or non-string status values to
find_state_by_nametriggers weak partial matching or crashes withAttributeError: 'int' object has no attribute 'strip'. - Tool Manifest Gap:
linear_create_issuein/.well-known/omi-tools.jsonomittedteamandstatusparameter definitions, preventing LLMs from passing team targets after ambiguity prompts.
Proposed Fix
- Tiered Team Disambiguation: Implement
resolve_team(uid, team_target)with 4 tiers (UUID exact -> simultaneous Key and Name exact match -> substring match). Ambiguous matches return candidate lists and refuse silent mutation. When no team is specified, honors default team or prompts when multiple teams exist rather than silently pickingteams[0]. - Identifier Sanitization: Implement
sanitize_issue_identifier(raw)safely handling leading hashes/prefixes, full URLs, and dirty types. - Complete Null-Safety: Short-circuit
(issue.get("field") or {}).get(...)acrosstool_get_issue,tool_update_issue_status, andtool_add_comment, and defensively extractnodeslists (((result.get("teams") or {}).get("nodes") or [])). - State Disambiguation & Alias Support: Reject empty/whitespace state targets in
find_state_by_name, support optional workflowstatus/statebinding upon issue creation, and map string numeric priorities ("1"->1). - Manifest & Models Alignment: Declare
teamandstatusin/.well-known/omi-tools.jsonandmodels.py. - Hermetic Test Suite: Add 22 hermetic unit tests in
test_team_disambiguation.pycovering all edge cases (0.2s runtime, 0 dependencies).
Bounty Proposal
- Proposed Bounty: $50 (Backend Plugin Reliability & Bug Fix)
- Preferred Payment (USDT-TRC20):
TGKmfSUmt2dggErAo8BicaCoXhkMwLetxV - Alternative Payment (BTC):
1NkUnv23H65ZYJn64pseAcWRA6sJitxh2f - Email:
[email protected]