Handbook
CDP tab lifecycle policy
Module helpers: forge_lcdl.playwright.edge_cdp_attach (close_linkedin_cdp_tabs, list_linkedin_cdp_page_targets), forge_lcdl.playwright.connectors.lpc_linkedin_harvest (teardown_external_linkedin_cdp_tabs)
Updated
Problem
OWA LivePersonaCard See profile on LinkedIn opens a new linkedin.com/in/ tab in the operator's Edge profile. Harvest loops that only refocus the host tab (the People tab) leave every profile tab open — CDP attach slows, memory grows, and operators lose track of work tabs.
Rules
- Close external tabs after read — When harvest opens or polls a tab outside the host surface (LinkedIn profile, etc.), close it via CDP
/json/close/{targetId}after the URL or snapshot is captured. - Max one ephemeral LinkedIn profile tab per harvest step — Before clicking See profile on LinkedIn, close stale
/in/profile tabs (close_linkedin_cdp_tabs(..., profiles_only=True)). After capture, runteardown_external_linkedin_cdp_tabs(close + refocus host). - Never open per-person without teardown — Batch harnesses (e.g. org-people reingest) must not accumulate one LinkedIn tab per contact.
- Host tabs are sacred — Do not close OWA mail, People, or Teams tabs. Cockpit default remains
detach_generic_edge_cdp(..., close_owned=False)for operator sessions. - Owned vs operator tabs — Close only tabs your integration opened or ephemeral third-party tabs required for a single read. Prune
about:blankorphans withprune_about_blank_cdp_tabsbefore attach.
LinkedIn external resolve flow (LPC)
Used by Outlook People LPC LinkedIn harvest when COCKPIT_ORG_LINKEDIN_OPEN_EXTERNAL=1 or FORGE_LCDL_ORG_LINKEDIN_OPEN_EXTERNAL=1:
_prepare_external_linkedin_click— close existing/in/profile tabs.- Click See profile on LinkedIn in the LPC flyout (OWA may open one new tab).
_poll_linkedin_profile_url— read URL from CDP/json/list.teardown_external_linkedin_cdp_tabs— close profile tabs, refocus the People host tab.
Related docs
- EDGE-CDP-ATTACH.md — attach, focus emulation,
prune_about_blank_cdp_tabs - OUTLOOK-PEOPLE-READ-STRATEGIES.md — People harvest CDP policy
- forge-cockpit-web: org-people-reingest-harness.md — batch reingest harness