Return Pi TUI Text component for villani-result to prevent crash#412
Merged
mmprotest merged 1 commit intoJun 28, 2026
Conversation
ba816a9
into
mmprotest/implement-pi-integration-as-external-adapter
2 checks passed
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
villani-resultreturned a plain string which caused Pi to crash withchild.render is not a functionwhen Pi tried to render the final message.Description
Textfrom@earendil-works/pi-tuiand changerenderVillaniResultMessageto return aTextcomponent instead of a raw string inintegrations/pi-villani/src/render.ts.extractVillaniResultText(message)to safely extract final text from string, text-part arrays, and object shapes, and prepend a themed label whentheme.fgis provided.sendDurableVillaniMessageunchanged in payload shape so durable messages remain structured withcustomType: "villani-result"andcontent: [{type:"text", text: ...}]for Pi compatibility.@earendil-works/pi-tuias apeerDependencyand pin it as adevDependencyfor build/test resolution inintegrations/pi-villani/package.json(and update lockfile).integrations/pi-villani/src/extension.test.tsto assert the renderer returns an object with arender()method, handle string and array content shapes, and ensure final rendering does not throw.Testing
cd integrations/pi-villani && npm run buildand the TypeScript build succeeded.cd integrations/pi-villani && npm testand the test suite passed (77tests passed,0failures).renderVillaniResultMessageandsendDurableVillaniMessagepassed.Codex Task