Repository navigation
Load optional startup imports through the preparation workers - #581
Merged
Merged
Conversation
ApplicationLifetime owns process naming; startup and all three CLI server consumers use its original behavior. Delete the CLI function and startup's reverse import of the command module. VersionMonitor owns its installed-version preparation and complete query. Move cold httpx, packaging and TOML imports plus installed-version parsing through the supplied existing preparation runner. App supplies its bounded PreparationRuntime.run_thread; standalone execution uses asyncio.to_thread. Client construction uses the same runner. Preserve async HTTP on the original loop, async-with closure, cancellation, failure handling and upgrade notices. Opt-in UsageReports also acquires its cold HTTP module through preparation; its policy, request and error boundary remain unchanged. NRA SourceModule/module_syntax_index before/after traced 862 production files across Toad, current Core and native Textual roots, zero parse omissions under Python 3.14. Process-title definition moves cli.py to ApplicationLifetime; startup and run --serve, acp --serve and serve callers all migrate. Version query definition moves module scope to VersionMonitor; check and standalone __main__ migrate. No former imports/calls remain. Dynamically imported outside consumers were not proved by AST; no compatibility alias retained. Verification: actual PreparationRuntime + httpx/local HTTP response verified cold imports off UI thread, upgrade notice substitution, malformed response retaining previous status, cancellation propagation and client closure. Lifecycle title invocation does not import toad.cli. Source CLI --help passes. No App/provider launch; integration owner carries installed App qualification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Process naming is now a static
ApplicationLifetime.set_process_titlethat startup and the CLI server callers share, replacing the function incli.py. Thehttpximport for usage reporting runs on a preparation thread, and the version check inversion.pyis reorganized to take the thread runner. The change touches four source files and adds an evidence note.