Skip to content

fix(search): handle invalid regex and add match timeout in find_objects (#119)#169

Merged
Daliys merged 4 commits into
developmentfrom
fix/issue-119-find-objects-regex-safety
Jul 22, 2026
Merged

fix(search): handle invalid regex and add match timeout in find_objects (#119)#169
Daliys merged 4 commits into
developmentfrom
fix/issue-119-find-objects-regex-safety

Conversation

@Daliys

@Daliys Daliys commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #119.

Changes

  • Wrapped new Regex(...) in find_objects with a 100ms matchTimeout guard to prevent ReDoS / main thread hangs.
  • Added fallback to literal substring search (IndexOf with OrdinalIgnoreCase) when user-supplied name input is not a valid regex (e.g. Player (1)).
  • Added unit tests in AgentToolingTests.cs.
  • Updated CHANGELOG.md.

Test Plan

  • Run PYTHONDONTWRITEBYTECODE=1 scripts/prepush-validate.sh --static-only.
  • Run NUnit tests in AgentToolingTests.cs.

@Daliys
Daliys merged commit 50cb599 into development Jul 22, 2026
6 checks passed
@Daliys
Daliys deleted the fix/issue-119-find-objects-regex-safety branch July 22, 2026 23:08
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.

1 participant