Skip to content

Include machine info in '#' status reply and add get_machine_info utility - #115

Merged
jamesoncollins merged 1 commit into
mainfrom
codex/update-#-handler-to-include-machine-info
Jun 1, 2026
Merged

Include machine info in '#' status reply and add get_machine_info utility#115
jamesoncollins merged 1 commit into
mainfrom
codex/update-#-handler-to-include-machine-info

Conversation

@jamesoncollins

Copy link
Copy Markdown
Owner

Motivation

  • Provide more useful diagnostics from the # status handler by including machine details (hostname, OS, Python version, CPU, memory, disk, load) alongside uptime and git metadata.
  • Make the command handler resilient to the raw_message being either a JSON string or already-parsed dict so tests and the installed SignalBot behavior both work.

Description

  • Update run.py to accept c.message.raw_message when it's already a dict and otherwise json.loads it, and to send a combined status_message containing uptime, get_git_info() and get_machine_info() for the # command (uses status_message variable and calls get_machine_info() in the handler).
  • Add get_machine_info() and helpers (_format_bytes, _get_memory_info) to utils/misc_utils.py, and import platform, shutil, and socket to report hostname, OS, Python version, processor, CPU count, load average, memory usage and disk usage.
  • Update tests/test_run.py to assert the # response contains machine information fields such as Machine:, Hostname:, and OS:.

Testing

  • Ran the focused tests with python -m unittest discover -s tests -p "test_run.py" and they passed.
  • Verified module syntax by compiling with python -m py_compile run.py utils/misc_utils.py tests/test_run.py, and it succeeded, and directly invoked get_machine_info() to confirm it returns Machine:, Hostname:, OS:, and Python: lines.
  • Ran the full test suite with python -m unittest discover -s tests -p "test_*.py", which produced failures unrelated to these changes due to network/proxy restrictions and missing external credentials/API access (external downloads and API calls failed), so those failures are environmental rather than caused by this PR.

Codex Task

@jamesoncollins
jamesoncollins merged commit 73dadc7 into main Jun 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant