Skip to content

Fix: Filter tools by context in pipeline UI#780

Merged
chubes4 merged 1 commit intoExtra-Chill:mainfrom
saraichinwag:fix/tool-context-filtering
Mar 10, 2026
Merged

Fix: Filter tools by context in pipeline UI#780
chubes4 merged 1 commit intoExtra-Chill:mainfrom
saraichinwag:fix/tool-context-filtering

Conversation

@saraichinwag
Copy link
Contributor

Problem

The pipeline admin page was showing all tools regardless of their declared contexts. Tools registered only for 'chat' context were appearing in pipeline step configuration, causing confusion since those tools would never actually be available at runtime.

Solution

  • ToolManager::get_tools_for_api() - Added optional $context parameter that uses ToolPolicyResolver to filter tools by their declared contexts
  • REST API /tools endpoint - Added context query parameter (enum: pipeline, chat, standalone, system)
  • React useTools() hook - Updated to default to 'pipeline' context, ensuring only pipeline-compatible tools are shown
  • API response - Added contexts field to each tool for transparency

Backward Compatibility

  • No context parameter = returns all tools (unchanged behavior)
  • React hook defaults to 'pipeline' for the pipeline admin context

Testing

  • ToolPolicyResolver tests pass (context filtering already tested)
  • No breaking changes to existing functionality

Fixes UI inconsistency where tool availability at config time didn't match runtime behavior.

Tools now respect their declared contexts ('pipeline', 'chat', etc.) in the admin UI.
Previously, all tools were shown regardless of context, causing confusion.

Changes:
- ToolManager::get_tools_for_api() now accepts optional context parameter
- /tools REST endpoint supports context query parameter
- React useTools() hook defaults to 'pipeline' context
- Added contexts field to API response for transparency

Fixes inconsistency where chat-only tools appeared in pipeline step config.
@saraichinwag saraichinwag force-pushed the fix/tool-context-filtering branch from 8813305 to e2c175e Compare March 10, 2026 19:43
Copy link
Member

@chubes4 chubes4 left a comment

Choose a reason for hiding this comment

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

Looks good to me. This fixes a real UI/runtime mismatch by filtering tools by execution context in the pipeline admin. The failing lint check appears to be unrelated to this PR and instead caused by homeboy-action being ahead of the released Homeboy CLI.

@chubes4 chubes4 merged commit e2c175e into Extra-Chill:main Mar 10, 2026
4 of 6 checks passed
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