refactor(runtime): extract typed TUI background task bridge - #172
Merged
Merged
Conversation
commit: |
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.
The TUI bridge previously embedded background-task recovery, projection merging and message routing as long JavaScript strings in bundle patches. Move these operations into typed TypeScript modules compiled into the existing
cli-config.cjshelper; the patches now capture the active app and delegate.Preserve task restoration, error handling, routing, trace context and stop-before-send behavior. Read optional recovery metadata asynchronously and share in-flight restoration per app so concurrent sends wait for task registration. Existing patch execution tests now call the same helpers, with additional direct tests for restart, stale task fields and restoration races.
Validation:
bun run typecheckbun run test:unit(654 passed before the additional concurrency case; that case also passed)bun scripts/check-runtime.tsbun run check:tuigit diff --checkIndependent of #171; this PR changes the runtime adapter, not TUI refresh policy.