Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Linear team selector in agent block tool input not functional.

Type of Change

  • Bug fix

Testing

Manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 19, 2026 8:40pm

Request Review

@icecrasher321 icecrasher321 merged commit 72c2ba7 into staging Jan 19, 2026
7 checks passed
@icecrasher321 icecrasher321 deleted the fix/linear-toolinp branch January 19, 2026 20:40
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 19, 2026

Greptile Summary

Fixed Linear team selector in tool input by properly passing canonicalParamId through the component hierarchy. The bug occurred because the dynamically-generated subblock ID (tool-${toolIndex}-${param.id}) didn't match the expected teamId value used by the selector resolution logic.

Key changes:

  • Added canonicalParamId field to ProjectSelectorInput subblock config in tool-input.tsx
  • Updated resolveProjectSelector to use canonicalParamId ?? subBlock.id for determining selector type
  • This allows the selector to correctly identify team selectors even when wrapped in tool input contexts

Impact:
The fix ensures Linear team selectors work correctly in agent block tool inputs, resolving an issue where the selector couldn't distinguish between team and project selectors due to ID mangling.

Confidence Score: 4/5

  • This PR is safe to merge with low risk
  • The fix is targeted and addresses a specific bug with Linear team selectors. The changes follow an established pattern (canonicalParamId is already used in block definitions) and only affect the project-selector resolution logic. However, similar patterns in resolveFileSelector for microsoft-teams and webflow could benefit from the same fix for consistency.
  • No files require special attention - the changes are straightforward bug fixes

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx Added canonicalParamId to project-selector config, fixing Linear team selector identification
apps/sim/hooks/selectors/resolution.ts Updated to use canonicalParamId for Linear team/project resolution, but file-selector logic still uses subBlock.id

Sequence Diagram

sequenceDiagram
    participant User
    participant ToolInput
    participant ProjectSelector
    participant Resolution
    participant LinearAPI

    User->>ToolInput: Select Linear team
    ToolInput->>ToolInput: Create subblock with<br/>dynamic ID and canonicalParamId
    ToolInput->>ProjectSelector: Pass config with canonicalParamId
    ProjectSelector->>Resolution: resolveProjectSelector(subBlock)
    Resolution->>Resolution: Use canonicalParamId for matching
    Resolution->>Resolution: Determine selector type (team vs project)
    Resolution-->>ProjectSelector: Return linear.teams key
    ProjectSelector->>LinearAPI: Fetch teams
    LinearAPI-->>ProjectSelector: Return teams data
    ProjectSelector-->>User: Display team selector
Loading

Copy link
Contributor

@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.

Additional Comments (2)

  1. apps/sim/hooks/selectors/resolution.ts, line 89-95 (link)

    style: consider using canonicalParamId fallback for consistency with the fixed resolveProjectSelector logic

    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!

  2. apps/sim/hooks/selectors/resolution.ts, line 122-127 (link)

    style: consider checking canonicalParamId first, similar to the pattern used in resolveProjectSelector

    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!

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

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.

2 participants