Skip to content

fix(settings): name saved pi extensions by package before a scan - #1291

Merged
Lampese merged 1 commit into
LodyAI:mainfrom
timonwong:fix/pi-extension-saved-names
Oct 13, 2026
Merged

Lampese merged 1 commit into
LodyAI:mainfrom
timonwong:fix/pi-extension-saved-names

Conversation

@timonwong

@timonwong timonwong commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

Closes #1290

Problem / pressure

runtimeOverrides.piExtensions saves only paths. When the Pi provider dialog is reopened, selected extensions that have not been scanned yet are named by their last path segment. Most npm-installed Pi extensions use index.ts or index.js as their entry file, so the saved selection shows up as a column of index.ts until the user scans again.

Summary

  • PiExtensionsField: an unscanned selected row is now named by savedExtensionName(path):
    • inside node_modules: the package name, including the scope (pi-smart-fetch, @ff-labs/pi-fff)
    • entry file index.*: the nearest parent folder, skipping src/dist/lib
    • otherwise: the file name, as before
  • Rows from a scan still use the name the scan returns.
  • The saved setting format and the machine protocol are unchanged.

Visual explanation

Simple change: one pure naming function used for unscanned rows in a single component; the call path does not change.

Before / after

Saved path (dialog reopened, no scan) Before After
~/.pi/agent/npm/node_modules/pi-smart-fetch/dist/index.js index.js pi-smart-fetch
~/.pi/agent/npm/node_modules/@fradser/pi-vision/index.ts index.ts @fradser/pi-vision
~/.pi/agent/npm/node_modules/@ff-labs/pi-fff/src/index.ts index.ts @ff-labs/pi-fff
C:\…\ext\my-ext\index.ts index.ts my-ext
/…/ext/single.ts single.ts single.ts

Test plan

  • packages/components/tests/agent-config-dialog.test.tsx: opens an existing Pi provider that has the five saved paths above, without scanning, and checks the name and path shown in each row.
  • Not checked in the packaged app. Without a scan, a name can still differ from the scan's name when an extension is neither an npm package nor an index.* entry. In that case the file name is shown, as before.

Context handoff

Original user prompt

image image
Show original prompt
pi 扩展这里,看图一,选择插件,如果有 index.ts 之类的,它再次打开就会显示 index.ts

首次打开或者扫描扩展之后,是图二,看起来名字没有正确保留?你看看最新解决没有这个问题,没有解决你看看怎么解决,解决之前,告诉我你的计划

Sharing refusal (verbatim)

不公开

Shared conversation

Status: user-declined
Reason: The user chose not to publish the authoring conversation.

Saved Pi extension selections persist only paths, so a reopened provider
dialog showed every unscanned row by its file name, e.g. a column of
index.ts. Derive the package (or folder) name from the path until a scan
supplies the authoritative name.

Model: claude-opus-5-5
@timonwong
timonwong force-pushed the fix/pi-extension-saved-names branch from d29c93b to cb84eb1 Compare October 7, 2026 08:10
@timonwong
timonwong marked this pull request as ready for review October 7, 2026 08:13
@Lampese
Lampese merged commit cf1afac into LodyAI:main Oct 13, 2026
15 checks passed
@timonwong
timonwong deleted the fix/pi-extension-saved-names branch October 14, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Saved Pi extensions show as index.ts until rescanned

2 participants