Fix Pi approval response deadlock, widget API, and bump runtime to 0.1.4#366
Merged
Merged
Conversation
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.
Motivation
Description
handleApprovalRequired(...).catch(...)at the event boundary and deny any still-pending request on error.handleApprovalRequired(...)so all UI operations occur inside a guarded path and the function always callssendApprovalResponseIfPending(...)(which atomically deletes the pending id and responds) so eachrequest_idreceives exactly one response even on errors or aborts.ui.setWidget(key, lines, { placement: "aboveEditor" })(preserves placement semantics).safeWarn,safeInfo,safeSetVillaniStatus, andsafeSetVillaniWidgetso logging/UI warnings cannot block sending the approval response.reportRuntimeSource(...)to log whether aVILLANI_COMMANDoverride or cached/downloaded runtime is used (non-fatal diagnostics).integrations/pi-villani/src/runtimeConfig.tsfrom0.1.3to0.1.4so a new packaged runtime will be requested instead of reusing a stale cached runtime.integrations/pi-villani/src/extension.test.tswith regression tests that cover: confirmation-approve, confirmation-deny, status rendering failure, widget rendering failure, confirmation dialog failure, abort while pending, and duplicate-response prevention; the tests also validate the widget placement option and that only a single response is emitted per request.integrations/pi-villani/src/index.ts,integrations/pi-villani/src/runtimeConfig.ts, andintegrations/pi-villani/src/extension.test.ts.Testing
cd integrations/pi-villani && npm ciwhich completed successfully (environment Node warnings about engines only).cd integrations/pi-villani && npm run typecheckwhich completed successfully.cd integrations/pi-villani && npm testwhich builds and runs the extension tests and produced all passing tests (TAP output:# pass 42).pytest tests/integrations/test_pi_bridge.pywhich passed (20 passed).python -m PyInstaller --versionto verify runtime packaging but PyInstaller is not installed locally (No module named PyInstaller), so the runtime packaging step could not be performed in this environment.Note: a new release/tag and published runtime asset
pi-villani-runtime-v0.1.4must still be built and published so installed Pi users can download the updated standalone runtime; the code update only prepares the extension to request0.1.4.Codex Task