- _sanitize_remote_script_text: compare re-encoded BYTES against the cap, not characters — a >1MiB multibyte file truncated at the head -c byte bound decodes to fewer chars than bytes and would have scanned the truncated text instead of failing closed (the exact local/remote divergence this PR closes). - terminal_tool: replace the three hardcoded 1MiB literals with lifecycle_guard._MAX_REFERENCED_SCRIPT_BYTES so the budget cannot drift; use the redirect-safe 'head -c N < path' form from tools/image_source.py so leading-dash paths stay out of argv. - Public guard wrapper: drop the duplicate depth-0 direct scan — the walk already runs it; the except-path now falls back to the pure string scans, preserving the direct verdict when the walk crashes. |
||
|---|---|---|
| .. | ||
| scripts | ||
| __init__.py | ||
| blueprint_catalog.py | ||
| executions.py | ||
| jobs.py | ||
| lifecycle_guard.py | ||
| scheduler.py | ||
| scheduler_provider.py | ||
| suggestion_catalog.py | ||
| suggestions.py | ||