Use installed callable apps for TUI mentions (#39051)

## Why

The app directory is a discovery catalog and can include apps that are not
callable in the active thread. Using it for `$` suggestions can therefore
offer mentions that cannot be used.

## What changed

- Load mention candidates from `app/installed`, enrich callable apps through
  bounded `app/read` batches, and retain compatibility with app servers that
  do not support `app/installed`.
- Keep the mention catalog separate from the `/apps` directory cache and scope
  results to the current thread, workspace, and account.
- Refresh mentions after app notifications, enablement changes, configuration
  updates, and apps MCP readiness, while immediately removing disabled apps.

## Testing

Add coverage for batching and fallback behavior, stale scoped results,
notification refreshes, enablement changes, MCP startup races, and filtering
non-callable apps from mentions.

GitOrigin-RevId: 4d9e20794aed30cc97120170792fb555b86fe1e7
This commit is contained in:
Charlie Marsh authored and copyberry committed 2026-08-17 19:11:34 +00:00
1 parent d7d526b81d
commit fe5889928c
17 files changed
+759 -116

No files matched your search

+14
View File
@@ -510,6 +510,14 @@ pub(crate) enum AppEvent {
is_final: bool,
},
/// Thread-scoped installed applications that may actually be mentioned.
InstalledConnectorMentionsLoaded {
thread_id: Option<ThreadId>,
cwd: PathBuf,
generation: ConnectorScopeGeneration,
result: Result<ConnectorsSnapshot, String>,
},
/// Result of computing a `/diff` command.
DiffResult(PathBuf, String),
@@ -577,6 +585,12 @@ pub(crate) enum AppEvent {
generation: ConnectorScopeGeneration,
},
/// Refresh callable installed applications without loading the app directory.
FetchInstalledConnectorMentions {
force_refresh: bool,
generation: ConnectorScopeGeneration,
},
/// Fetch plugin marketplace state for the provided working directory.
FetchPluginsList {
cwd: PathBuf,