Skip to content

fix(web_ui): resolve streamlit rerun compatibility (closes #630) and cross-platform handling - #654

Open
txltedxgod wants to merge 1 commit into
aahnik:mainfrom
txltedxgod:fix/streamlit-rerun-and-crossplatform-logs
Open

txltedxgod wants to merge 1 commit into
aahnik:mainfrom
txltedxgod:fix/streamlit-rerun-and-crossplatform-logs

Conversation

@txltedxgod

Copy link
Copy Markdown

Summary of Changes

Closes #630

This PR resolves compatibility issues with modern Streamlit versions and improves cross-platform robustness:

  1. Streamlit st.rerun() Support:

    • In modern Streamlit (>= 1.27), st.experimental_rerun() was deprecated and removed in recent releases, causing AttributeError: module 'streamlit' has no attribute 'experimental_rerun' when modifying connections or starting/stopping runs.
    • Added rerun_st(st) helper in tgcf.web_ui.utils that calls st.rerun() when available and cleanly falls back to st.experimental_rerun() for older Streamlit versions.
    • Updated 3_🔗_Connections.py and 5_🏃_Run.py to use rerun_st(st).
  2. Cross-Platform Process Management:

    • Replaced os.kill(CONFIG.pid, signal.SIGCONT) with os.kill(CONFIG.pid, 0) for checking process liveness. Signal 0 is the universal POSIX and Windows standard for checking if a PID is alive without delivering a resume/control signal.
    • Handled process stop signal gracefully via getattr(signal, "SIGTERM", signal.SIGINT) avoiding AttributeError on Windows where signal.SIGSTOP does not exist.
  3. Pure-Python Log Reading:

    • Replaced external shell commands (rm logs_n_lines.txt and tail -n ... logs.txt >> logs_n_lines.txt) with pure Python file slicing ("".join(log_lines[-lines:])), eliminating crashes on Windows and environments lacking POSIX rm/tail utilities.

@txltedxgod
txltedxgod requested a review from aahnik as a code owner November 7, 2026 18:01

This branch has not been deployed

No deployments
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.

AttributeError: module 'streamlit' has no attribute 'experimental_rerun'

1 participant