Skip to content

Fix Work Hub session inventory#2268

Open
jamesmontemagno wants to merge 1 commit into
github:mainfrom
jamesmontemagno:motz-port-hub-canvas-fixes
Open

Fix Work Hub session inventory#2268
jamesmontemagno wants to merge 1 commit into
github:mainfrom
jamesmontemagno:motz-port-hub-canvas-fixes

Conversation

@jamesmontemagno

Copy link
Copy Markdown
Contributor

Summary

  • port James Hub session inventory fixes into the generic Work Hub canvas
  • read active app workspaces from the Copilot app data DB before falling back to runtime or legacy session-store data
  • normalize Windows paths and worktree detection for cleanup/recent-session surfaces

Validation

  • npm run plugin:validate
  • node --check extensions/work-hub/data.mjs
  • node --check extensions/work-hub/extension.mjs
  • node --check extensions/work-hub/renderer.mjs

Note: npm run build could not complete locally because npm ci is blocked by npm auth (E401), leaving js-yaml unavailable.

Port the app workspace and runtime session inventory fixes from the personal James Hub canvas into the generic Work Hub extension. This lets the cleanup and recent-session surfaces read current app workspaces before falling back to the legacy session store.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 10, 2026 16:36
@github-actions github-actions Bot added the canvas-extension PR touches canvas extensions label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔴 Contributor Reputation Check: HIGH risk

Check Risk
Profile HIGH
Credential audit NONE

Maintainers: please review this contributor before merging.
See the workflow run for full details.
Automated check powered by AGT.

@github-actions github-actions Bot added the needs-review:HIGH Contributor reputation check flagged HIGH risk label Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Work Hub session discovery and cleanup across app DB, runtime, and legacy data sources.

Changes:

  • Adds Copilot app workspace inventory support.
  • Connects the live Copilot session bridge.
  • Normalizes filesystem paths and worktree detection.
Show a summary per file
File Description
extensions/work-hub/data.mjs Adds session inventory sources and path handling.
extensions/work-hub/extension.mjs Exposes the Copilot session to the data layer.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment on lines +352 to +368
const appInventory = await getAppWorkspaceInventory(repos);
if (appInventory && (appInventory.inventory.length || !appInventory.errors.length)) {
const seen = new Set();
const perRepoCounts = new Map();
const sessions = [];
for (const item of appInventory.inventory) {
if (!item.repository) continue;
if (item.ageDays !== null && item.ageDays > 14) continue;
const key = `${item.repository}|${item.branch || ""}|${item.summary || ""}`;
const count = perRepoCounts.get(item.repository) || 0;
if (seen.has(key) || count >= 3) continue;
seen.add(key);
perRepoCounts.set(item.repository, count + 1);
sessions.push(item);
}
return { sessions, errors: appInventory.errors };
}
}

function normalizeFsPath(value) {
return String(value || "").replaceAll("\\", "/").replace(/\/+$/, "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

canvas-extension PR touches canvas extensions needs-review:HIGH Contributor reputation check flagged HIGH risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants