Skip to content

fix(server): escape ILIKE pattern in evaluator-configs list endpoint#108

Merged
lan17 merged 1 commit intoagentcontrol:mainfrom
Ritvik777:fix/escape-like-evaluator-configs
Mar 11, 2026
Merged

fix(server): escape ILIKE pattern in evaluator-configs list endpoint#108
lan17 merged 1 commit intoagentcontrol:mainfrom
Ritvik777:fix/escape-like-evaluator-configs

Conversation

@Ritvik777
Copy link
Contributor

The name filter in list_evaluator_configs used raw user input in the
ILIKE pattern, causing SQL wildcards (% and _) in search terms to be
interpreted as pattern characters instead of literals. This is
inconsistent with the agents and controls list endpoints which both
use escape_like_pattern().

Apply the same escaping already used by the other two endpoints.

Summary

  • Escape SQL LIKE wildcards (% and _) in the evaluator-configs list
    endpoint name filter, matching the existing behavior in agents and
    controls list endpoints.

Scope

  • User-facing/API changes: GET /api/v1/evaluator-configs?name=...
    now treats % and _ as literal characters instead of SQL wildcards.
  • Internal changes: Added escape_like_pattern import and applied it
    to both the results query and the total count query in
    evaluator_configs.py.
  • Out of scope: No changes to agents or controls endpoints (already
    correct).

Risk and Rollout

  • Risk level: low
  • Rollback plan: Revert the single commit.

Testing

  • Added or updated automated tests
  • Ran make check (or explained why not)
  • Manually verified behavior

Checklist

  • Linked issue/spec (if applicable)
  • Updated docs/examples for user-facing changes
  • Included any required follow-up tasks

The name filter in list_evaluator_configs used raw user input in the
ILIKE pattern, causing SQL wildcards (% and _) in search terms to be
interpreted as pattern characters instead of literals. This is
inconsistent with the agents and controls list endpoints which both
use escape_like_pattern().

Apply the same escaping already used by the other two endpoints.

Made-with: Cursor
Copy link
Contributor

@lan17 lan17 left a comment

Choose a reason for hiding this comment

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

Thank you for fixing !

@Ritvik777 can you sign your commit in this pr and then we can merge?

@lan17 lan17 changed the title fix: escape ILIKE pattern in evaluator-configs list endpoint fix(server): escape ILIKE pattern in evaluator-configs list endpoint Mar 11, 2026
@lan17 lan17 merged commit cb6e89f into agentcontrol:main Mar 11, 2026
6 of 9 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