Skip to content

teich extract hangs on the last file (with --private) #28

Description

@pszemraj

Hi, thanks for creating this. It's super useful. I wanted to raise a new issue that I had found recently upon updating my pkg version to the latest: teich extract hangs on the last file, it appears there is quadratic backtracking in _generic_secret_pattern or some other re logic

Ran these two separately and both hung on the final file:

teich extract codex  --private --out codex    # stuck at 1828/1829
teich extract claude --private --out claude   # stuck at 942/943

Different file each time, remaining worker pinned at 100% CPU, no error and no timeout - it just sits there indefinitely.

Poking around, _generic_secret_pattern in src/teich/anonymize.py:289 looks like the culprit. The (?:[A-Za-z0-9]+[_-])* prefix backtracks quadratically over long hyphen-separated runs (From what I gather and having some LMs look at the code) ie what UUIDs and tool-call IDs look like

Environment: teich 0.3.1, Python 3.12.13, Ubuntu 24.04

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions