Skip to content

Auto-install impacket at tool import time#92

Merged
mkultraWasHere merged 4 commits into
mainfrom
nops/fixes
Jul 14, 2026
Merged

Auto-install impacket at tool import time#92
mkultraWasHere merged 4 commits into
mainfrom
nops/fixes

Conversation

@mkultraWasHere

Copy link
Copy Markdown
Contributor

Runtime doesn't process dependencies.python or run dependencies.scripts — confirmed across three agent sessions where impacket tools fail with ModuleNotFoundError despite capability v2.1.1 being loaded.

Fixed

  • Impacket tools no longer fail with ModuleNotFoundError on runtimes that skip dependencies.python_ensure_impacket_installed() runs at module import and pip-installs impacket via sys.executable -m pip if import impacket fails

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a runtime fallback to ensure the network-ops Impacket-based tools can run even in environments that do not honor dependencies.python / dependencies.scripts, by attempting to install impacket when the tool module is imported.

Changes:

  • Added an import-time _ensure_impacket_installed() fallback that installs impacket via sys.executable -m pip if it is not importable.
  • Updated the provisioning script to also install impacket when missing.
  • Bumped capability version and added a checks entry to validate impacket is importable.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
capabilities/network-ops/tools/impacket.py Adds an import-time fallback installer for impacket to prevent ModuleNotFoundError at runtime.
capabilities/network-ops/scripts/install_coercion_tools.sh Ensures impacket is installed during sandbox provisioning as an additional safety net.
capabilities/network-ops/capability.yaml Bumps version and adds an impacket import check to capability validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread capabilities/network-ops/tools/impacket.py
Comment thread capabilities/network-ops/tools/impacket.py
Comment thread capabilities/network-ops/scripts/install_coercion_tools.sh
Comment thread capabilities/network-ops/tools/impacket.py
@mkultraWasHere mkultraWasHere requested a review from Copilot July 14, 2026 19:28
@mkultraWasHere mkultraWasHere marked this pull request as ready for review July 14, 2026 19:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread capabilities/network-ops/tools/impacket.py
Comment thread capabilities/network-ops/tools/impacket.py
mkultraWasHere and others added 3 commits July 14, 2026 15:54
Runtime doesn't process dependencies.python or dependencies.scripts,
so impacket is never installed into the runtime's Python. Add
_ensure_impacket_installed() that runs at module import — if
`import impacket` fails, it pip-installs it via sys.executable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 120s timeout to pip subprocess to prevent hangs on network issues
- Catch TimeoutExpired and OSError in addition to CalledProcessError
- Add DREADNODE_SKIP_AUTO_INSTALL=1 env var to disable auto-install
  in tests/CI
- Stop suppressing pip stderr in install script so failures are
  diagnosable

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mkultraWasHere mkultraWasHere merged commit dc512bb into main Jul 14, 2026
3 checks passed
@mkultraWasHere mkultraWasHere deleted the nops/fixes branch July 14, 2026 19:57
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