Skip to content

Inject node deep instrumentation before '-' and '--' - #4845

Merged
plengauer merged 3 commits into
mainfrom
claude/wonderful-cray-1o7kj9
Dec 3, 2026
Merged

plengauer merged 3 commits into
mainfrom
claude/wonderful-cray-1o7kj9

Conversation

@plengauer

Copy link
Copy Markdown
Owner

Problem

With deep injection enabled, node - <args> (script from stdin) breaks. The wrapper treated the bare - as an ordinary option, so --require .../deep.instrument.js was inserted after it. Node passes everything after - (and --) to the script, so the script received --require as argv[2].

This failed the activation job of the Autotriage run https://github.com/plengauer/Thoth/actions/runs/46608589583/job/143769851672, where gh-aw's save_base_github_folders.sh runs node - "$WORKSPACE" "$STAGING_DIR" ... <<'NODE' and crashed with ENOENT: lstat '.../--require'.

Fix

Do not treat - and -- as options in _otel_inject_node_args, so they take the script position and the --require flags are emitted before them.

Before: node --require inject.js - --require instrument.js /ws /stage
After: node --require inject.js --require instrument.js - /ws /stage

A regression test is added to tests/auto/test_auto_injection_node.sh. I verified the generated command lines locally with stubbed helpers; I did not run the full test suite.


Generated by Claude Code

Everything after a bare '-' (script from stdin) or '--' is passed to the
script, so the injected --require flags were handed to the script as
arguments (e.g. gh-aw's 'node - $WORKSPACE ...' failed with ENOENT '--require').

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAy2NfCWCJqh1KomUcCGXZ
@plengauer plengauer self-assigned this Dec 2, 2026
@plengauer
plengauer marked this pull request as ready for review December 2, 2026 20:55
@plengauer
plengauer requested a review from moflwi as a code owner December 2, 2026 20:55
@plengauer
plengauer enabled auto-merge (squash) December 2, 2026 20:55
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ BASH shellcheck 2 0 0 0.71s
✅ BASH shfmt 2 0 0 0.12s
✅ COPYPASTE jscpd yes no no 1.0s
✅ REPOSITORY betterleaks yes no no 8.31s
✅ REPOSITORY checkov yes no no 11.94s
✅ REPOSITORY dustilock yes no no 14.69s
✅ REPOSITORY git_diff yes no no 0.15s
⚠️ REPOSITORY grype yes no 1 71.37s
✅ REPOSITORY kingfisher yes no no 7.47s
✅ REPOSITORY osv-scanner yes no no 18.99s
✅ REPOSITORY secretlint yes no no 1.89s
✅ REPOSITORY syft yes no no 3.36s
✅ REPOSITORY trivy yes no no 20.74s
✅ REPOSITORY trivy-sbom yes no no 0.39s
✅ REPOSITORY trufflehog yes no no 3.82s

Detailed Issues

⚠️ REPOSITORY / grype - 1 warning
warning: A medium vulnerability in github-action package: anthropics/claude-code-action, version v1 was found at: /.github/workflows/claude.yml

warning: 1 warnings emitted

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

moflwi
moflwi previously approved these changes Dec 2, 2026
@plengauer
plengauer merged commit 4f530c2 into main Dec 3, 2026
1265 of 1268 checks passed
@plengauer
plengauer deleted the claude/wonderful-cray-1o7kj9 branch December 3, 2026 17:46
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.

3 participants