Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR from qodo-benchmark#263

@greptile-apps
Copy link

greptile-apps bot commented Jan 15, 2026

Greptile Summary

This PR integrates @tanstack/eslint-plugin-query into the web frontend and fixes lint violations across the service layer by ensuring React Query queryKey arrays include all reactive dependencies.

Key Changes:

  • Added @tanstack/eslint-plugin-query to ESLint configuration and dependencies
  • Fixed missing dependencies in queryKey arrays across 7 service files to ensure proper cache invalidation
  • Refactored useModelInList to use primitive provider value instead of object reference for stable query keys
  • Changed goto-anything to use stable Actions object reference instead of serialized string

Issues Found:

  • Python file (api/services/model_provider_service.py) removed type annotations, violating the style guide requirement to "keep type hints on functions and attributes"

Confidence Score: 4/5

  • This PR is mostly safe to merge with one style violation that should be fixed
  • The TypeScript changes correctly fix React Query lint violations and improve cache invalidation reliability. The ESLint plugin integration is properly configured. However, the Python file removes required type annotations, violating the project's coding standards documented in AGENTS.md
  • Pay attention to api/services/model_provider_service.py - type annotations should be restored

Important Files Changed

Filename Overview
api/services/model_provider_service.py Removed type annotations from model parameter and return type, violating Python style guide
web/eslint.config.mjs Added @tanstack/eslint-plugin-query configuration properly
web/service/access-control.ts Fixed queryKey to include all reactive dependencies (systemFeatures.webapp_auth.enabled, isInstalledApp)
web/service/use-models.ts Added missing configFrom parameter to queryKey
web/service/use-plugins.ts Extracted provider to primitive and fixed queryKey to use normalizedFileName

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant ESLint as ESLint Config
    participant TQ as @tanstack/eslint-plugin-query
    participant Services as Service Layer Files
    participant Queries as React Query Hooks

    Dev->>ESLint: Add @tanstack/eslint-plugin-query
    ESLint->>TQ: Load flat/recommended config
    TQ->>Services: Scan for query hook violations
    
    Services->>TQ: Check queryKey dependencies
    TQ-->>Services: Report missing dependencies in queryKeys
    
    Dev->>Services: Fix queryKey to include all dependencies
    Note over Services: access-control.ts, use-models.ts,<br/>use-document.ts, use-segment.ts,<br/>use-pipeline.ts, use-plugins.ts,<br/>goto-anything/index.tsx
    
    Services->>Queries: Updated queryKeys with proper deps
    Note over Queries: Ensures cache invalidation<br/>works correctly when deps change
    
    Dev->>Services: Refactor useModelInList
    Note over Services: Extract primitive provider<br/>value for stable queryKey
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

10 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +234 to +235
self, tenant_id: str, provider: str, model_type: str, model, credential_id: str | None
):
Copy link

Choose a reason for hiding this comment

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

style: Type annotations removed violate the Python style guide in AGENTS.md which states "Keep type hints on functions and attributes". The model parameter should be typed as str and the return type should be -> dict | None

Suggested change
self, tenant_id: str, provider: str, model_type: str, model, credential_id: str | None
):
def get_model_credential(
self, tenant_id: str, provider: str, model_type: str, model: str, credential_id: str | None
) -> dict | None:

Context Used: Context from dashboard - CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: api/services/model_provider_service.py
Line: 234:235

Comment:
**style:** Type annotations removed violate the Python style guide in AGENTS.md which states "Keep type hints on functions and attributes". The `model` parameter should be typed as `str` and the return type should be `-> dict | None`

```suggestion
    def get_model_credential(
        self, tenant_id: str, provider: str, model_type: str, model: str, credential_id: str | None
    ) -> dict | None:
```

**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=a5f96311-5bd1-49f2-9828-2ee0c089c012))

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

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.

3 participants