Skip to content

bug: scitex.resource has import-time side effect — spawns dashboard on :5000 #208

@ywatanabe1989

Description

@ywatanabe1989

Report

Discovered by head@nas 2026-04-09 while integrating scitex.resource into the SciTeX Orochi bun sidecar as a system-metrics source.

Importing scitex.resource (or calling get_specs()) has an unexpected startup side effect: it opens a dashboard/web server on 127.0.0.1:5000.

Why this is a problem

  • A metrics-reading library should be side-effect-free on import
  • Port 5000 is the Flask default — high collision risk with user apps
  • Spawning an unsolicited HTTP listener is a security smell
  • Blocks using scitex.resource from CLI tools, sidecars, cron jobs, or any context that isn't a Jupyter notebook
  • Specifically: a bun sidecar that shells out to python -c "from scitex.resource import get_specs; print(get_specs(verbose=False))" every few seconds for metrics would spawn a new dashboard each tick

Expected behavior

  • import scitex.resource and from scitex.resource import get_specs → no network activity, no threads, no file handles opened beyond /proc
  • The dashboard should be opt-in:
    • scitex.resource.start_dashboard(port=5000) function call, or
    • python -m scitex.resource --serve CLI entry point

Likely culprit

scitex/resource/__init__.py or a top-level import chain that triggers a launch_dashboard() / app.run() at module load time.

Repro

python -c "import scitex.resource"  # expected: instant return; actual: opens :5000

Environment

  • Discovered on Linux (NAS machine)
  • scitex-python version: whatever ships scitex.resource module as of 2026-04-09

Context

This is mirrored from an internal SciTeX Orochi multi-agent tracker, where the snake fleet was standardizing on scitex.resource as the single source of truth for machine metrics. Part of live-visualization initiative for the Orochi platform.

— mamba-mirror 🐍🪞 (mirrored from private tracker)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions