Skip to content

Fix Pi Villani UI status copy and preserve safe tool inputs#414

Merged
mmprotest merged 1 commit into
mmprotest/implement-pi-integration-as-external-adapterfrom
mmprotest/fix-pi-villani-ui-copy-and-remove-unknown-messages
Jun 29, 2026
Merged

Fix Pi Villani UI status copy and preserve safe tool inputs#414
mmprotest merged 1 commit into
mmprotest/implement-pi-integration-as-external-adapterfrom
mmprotest/fix-pi-villani-ui-copy-and-remove-unknown-messages

Conversation

@mmprotest

Copy link
Copy Markdown
Owner

Motivation

  • Prevent the Pi UI from displaying "unknown" file placeholders and preserve useful, non-sensitive tool input (paths/commands) in bridge events.
  • Make the Villani UI use characteristic Villani-style status copy that rotates deterministically and reduce noisy notifications while keeping assistant text literal.
  • Ensure approval prompts remain readable and exact and that tool widgets show real file/command details.

Description

  • Preserve safe tool input in the bridge by adding safe_tool_input and extract_tool_path and including input, path, and command fields for tool_started, tool_result, and tool_finished events in villani_code/integrations/pi_bridge.py while excluding sensitive or large fields.
  • Replace generic status lines with a Villani copy bank in integrations/pi-villani/src/render.ts, add deterministic selection via copyCounters and villaniCopy(), and export resetVillaniCopyCounters() for tests.
  • Add helpers pathFromEvent, commandFromEvent, and categoryForEvent and map runner/command/tool events to Villani copy categories (thinking, analysis, reading, writing, running, testing, debugging, review, failure, complete).
  • Update toolStartedMessage, reduceVillaniUiState, widgetForState, and renderBridgeEvent so the UI shows Villani status messages and a widget with File: or Command: details (no "unknown" placeholders) and avoids notify spam for every tool/command start while keeping assistant stream_text unchanged.
  • Keep approval title/message literal and readable via existing approvalTitle/approvalMessage behavior in integrations/pi-villani/src/index.ts (approval prompt retains exact Command:/File: lines).
  • Add and update tests: Python tests in tests/integrations/test_pi_bridge.py to assert safe input/path/command preservation and exclusion of secrets/large content, and Node tests in integrations/pi-villani/src/render.test.ts and updates to integrations/pi-villani/src/extension.test.ts to validate Villani copy selection, no-unknown-file messages, deterministic rotation, assistant text preservation, and approval message readability.

Testing

  • Ran the Python integration tests with pytest -q tests/integrations/test_pi_bridge.py, which passed (43 passed).
  • Built and ran the Pi UI tests with cd integrations/pi-villani && npm test, which ultimately passed (85 passed across the suite) after the render changes.
  • New/modified tests cover: preservation of input.path / input.file_path / command, exclusion of content/credentials from bridge events, Villani copy rotation and category mapping, no "unknown" file copy in UI, assistant stream_text rendering unchanged, and approval prompt formatting.

Codex Task

@mmprotest mmprotest merged commit c526533 into mmprotest/implement-pi-integration-as-external-adapter Jun 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant