Skip to content

fix: stabilize search/list material selection#444

Open
anthony-maio wants to merge 2 commits intopieces-app:mainfrom
anthony-maio:wt/issue-189-search-selection
Open

fix: stabilize search/list material selection#444
anthony-maio wants to merge 2 commits intopieces-app:mainfrom
anthony-maio:wt/issue-189-search-selection

Conversation

@anthony-maio
Copy link
Copy Markdown

Summary

  • build the material selection menu from a stable list of (label, asset_id) entries before rendering
  • avoid eagerly resolving the fallback asset snapshot when search results are already provided
  • add a regression test covering the menu payloads passed to the selector

Testing

  • python -m pytest tests/assets/list_assets_test.py
  • python -m pytest tests/assets/list_assets_test.py tests/list_menu_test.py

Copilot AI review requested due to automatic review settings March 25, 2026 20:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the interactive material selection menu used by list/drive and search flows by constructing a deterministic (label, payload) list up-front, while avoiding unnecessary fallback asset snapshot work when an explicit asset list is provided.

Changes:

  • Avoid eager fallback asset identifier resolution when assets are passed into ListCommand.list_assets.
  • Build a stable list of menu entries before rendering the selector (removing async add_entry updates).
  • Add a regression test asserting the selector receives (label, asset_id) payloads.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/pieces/core/list_command.py Changes list_assets to build stable menu_entries up-front and removes the background thread that used add_entry.
tests/assets/list_assets_test.py Adds a test asserting menu entries include asset_id payloads and that add_entry is no longer used.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants