Skip to content

Fix direct-link ImportError with cached navigation module - #137

Merged
EvenSol merged 1 commit into
mainfrom
fix/direct-link-warm-import
Sep 7, 2026
Merged

EvenSol merged 1 commit into
mainfrom
fix/direct-link-warm-import

Conversation

@EvenSol

@EvenSol EvenSol commented Sep 7, 2026

Copy link
Copy Markdown
Owner

After merging #136, opening /CO2_mechanisticModel can fail at welcome.py line 17 if the running Streamlit process retains the pre-change app_navigation module. Current main contains the helper, but the older in-memory module does not. The provided redacted traceback is consistent with this failure; production logs were not accessible.

Reproduced the exact import failure by running welcome.py with the pre-#136 navigation API in sys.modules. Import the new URL policy from a dedicated experimental_links module, retaining the app_navigation export for compatibility. This avoids requiring the cached module to acquire a newly added attribute and does not reload modules shared with concurrent sessions.

Tests run before and after the fix:

  • Warm-import regression: 3 errors before, 3 passes after. Covers the CO2 direct route, normal home, and explicit mode-off rerun. Executes the actual welcome.py with a minimal Streamlit test double and cached old module.
  • URL-policy regression: 3 passes.
  • Python compilation: pass for router, helper, and both regression modules.
  • Full Streamlit UI and live deployment: not run locally; VALIDATION PENDING CI. Existing AppTest coverage remains in CI, and the new regressions are wired into the same workflow.

Documentation impact: README documents Manage app → Reboot app for immediate recovery from modules retained across a deployment. Browser refresh does not restart the server process.

No pre-commit configuration exists in this repository. No simulation changes.

@EvenSol
EvenSol marked this pull request as ready for review September 7, 2026 15:17
@EvenSol
EvenSol merged commit 55b9006 into main Sep 7, 2026
2 of 3 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-07T15:18:08.058353Z aa7c03a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant