fix(assistant): surface shape bugs — films scope mime hint, apps_list items wrap
Two reasons the content surface 'often doesn't surface the content':
- content.indeehub-projects items carried no mime/filename, so the UI
adapter classified every film 'excluded' and the films grid could never
render. They are films: they now declare video/mp4.
- apps_list surfaced the container-list RPC's BARE ARRAY; the broker reads
{ items: [...] }, so the apps grid was silently dropped every turn.
Wrapped at the tool boundary — the shared RPC's own shape is untouched.
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1223,6 +1223,11 @@ impl RpcHandler {
|
||||
"synopsis": p.synopsis.clone().unwrap_or_default(),
|
||||
"poster": p.poster.clone().unwrap_or_default(),
|
||||
"year": p.year_num(),
|
||||
// Films are video by definition. The UI adapter buckets
|
||||
// purely on mime/extension, so an item carrying neither
|
||||
// silently classified 'excluded' and this scope's
|
||||
// surface could never render a card.
|
||||
"mime_type": "video/mp4",
|
||||
}))
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -747,6 +747,14 @@ pub async fn dispatch(name: &str, args: &ToolArgs, handler: &RpcHandler) -> Resu
|
||||
"apps_list" => handler
|
||||
.assistant_dispatch_tool("container-list", None)
|
||||
.await
|
||||
// `container-list` answers a bare array, but surface consumers
|
||||
// read `{ items: [...] }` — a bare array is silently dropped by
|
||||
// the broker and the apps grid never renders. Wrap here, at the
|
||||
// tool boundary, so the shared RPC's own shape is untouched.
|
||||
.map(|v| match v {
|
||||
serde_json::Value::Array(_) => json!({ "items": v }),
|
||||
other => other,
|
||||
})
|
||||
.map_err(|e| format!("tool execution failed: {e}")),
|
||||
"app_logs" => {
|
||||
let ToolArgs::AppLogs(a) = args else {
|
||||
|
||||
Reference in New Issue
Block a user