Skip to content

fix(plugin-sdk): restore shipped createSessionHeaderLink as deprecated compat export - #169746

Merged
RomneyDa merged 3 commits into
mainfrom
fix/sdk-restore-session-header-link
Oct 12, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
fix/sdk-restore-session-header-link

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Related: #158742, #165334

What Problem This Solves

Fixes: browser plugins built against stable OpenClaw 2026.10.1 or 2026.10.2 that import createSessionHeaderLink from openclaw/plugin-sdk/control-ui fail on current main, because #165334 removed this shipped Plugin SDK export with no compatibility window.

User Impact

User impact: published plugins that import createSessionHeaderLink keep compiling and loading. The helper is now @deprecated and renders nothing, because hosts no longer pass props.session to session-header accessories (the conversation-link feature stays reverted). It can be removed after 2027-01-12.

Why This Change Was Made

Per the Plugin SDK compat policy (deprecate shipped public contracts, add a named removal plan), this restores only the public SDK export. It does not bring back the Slack/Discord return-button UI.

  • src/plugin-sdk/control-ui-session-link.ts is restored byte-for-byte from v2026.10.1, plus a @deprecated JSDoc. It stays self-contained, with local types and no host imports.
  • src/plugin-sdk/control-ui.ts re-exports it again.
  • tsconfig.core.json excludes the DOM-only file from the core (non-DOM) graph again, as it did at v2026.10.1. tsconfig.ui.json still type-checks it through src/plugin-sdk/control-ui*.ts.
  • New compat record plugin-sdk-session-header-link: status deprecated, owner sdk, deprecated/warningStarts 2026-10-12, removeAfter 2027-01-12. Under evaluatePluginSdkShippedSurface, this record authorizes removal only after that date.
  • Surface budgets go up by one each (public exports, callable exports, deprecated exports, and control-ui deprecated exports), with a reason comment on each.
  • scripts/lib/plugin-sdk-shipped-surface.json is regenerated canonically. It now uses v2026.10.2, the newest stable tag, so the checker's stale-inventory warning is gone. I also generated it for v2026.10.1; the name sets are identical and only release and commit differ.
  • A docs note is added under the compatibility policy page.

No new tests: no test covered this helper at v2026.10.1. The shipped-surface check is what protects the export, and registry.test.ts validates the new record's shape.

Evidence

  • Before the fix, with the regenerated inventory: pnpm plugin-sdk:surface:check fails with Unauthorized removals from shipped Plugin SDK v2026.10.1: openclaw/plugin-sdk/control-ui: 1 unauthorized missing names (createSessionHeaderLink). I reproduced this by dropping the re-export locally.
  • After: pnpm plugin-sdk:surface:check prints shipped Plugin SDK v2026.10.2: no unauthorized removals and passes all budgets. It also passes against the v2026.10.1 inventory.
  • pnpm plugin-sdk:check-exports: passed.
  • pnpm test src/plugins/compat/registry.test.ts: 12/12 passed.
  • pnpm test test/scripts/plugin-sdk-surface-report.test.ts test/scripts/plugin-sdk-shipped-surface.test.ts: passed.
  • pnpm check:changed: formatting, the Plugin SDK export/surface gates, plugin boundaries, and every tsgo lane (core, core tests including ui-*, extensions) passed. The only failure is the dead-export scan on two files this PR does not touch (src/auto-reply/reply/memory-flush.ts: resolveEffectivePromptTokens, ui/src/pages/chat/components/chat-pane-versions-menu.tsx: ChatPaneVersionsMenu). That failure already exists on main.
  • Production LOC: +72 (the 70-line restored helper with its deprecation JSDoc, plus the re-export and tsconfig exclude). This growth is required by the shipped public SDK contract and goes away when the record expires. Tooling/metadata: +17 compat record, +5 net budgets, +9 docs, plus the regenerated inventory JSON.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review October 12, 2026 08:10
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: XL labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR restores createSessionHeaderLink as a deprecated SDK export, updates the stable-surface inventory, and protects compatibility through January 12, 2027.

Example: A browser plugin registers createSessionHeaderLink as a session-header accessory for agent:main:main.

  • Before: Current main lacks the named export, preventing the plugin from compiling or loading.
  • After: The import and accessory assignment work; current hosts supply no conversation-link metadata, so no return button appears.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused compatibility repair has no actionable findings; behavioral confidence remains limited to source inspection and supplied unit and tooling validation.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied checks cover exports and typing, and inspected historical screenshots do not demonstrate this restored export loading in a current browser plugin.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Browser plugins importing a helper shipped in stable releases cannot compile or load against current main.
Reason: The maintainer-authored direction restores a released SDK contract with a removal window while retaining the intentional feature retirement.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it repairs a verified shipped SDK compatibility break, resolves the earlier mount-type finding, and preserves the intentional feature retirement.

Priority: P2
Reviewed head: a2864c483ce59acebd5fcb1c1b1bb6ed141d4a7b

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No current browser-plugin loading run or base-fail/head-pass execution of the added consumer contract is supplied.
Agent review details

How this fits together

The browser SDK supplies accessory mount functions to Control UI; the host passes session identity and lifecycle context, and the accessory manages DOM in its container.

flowchart TD
  A[Browser plugin] --> B[Control UI SDK]
  B --> C[Deprecated accessory mount]
  D[Accessory host] --> C
  C --> E[DOM container]
  F[Stable SDK inventory] --> G[Compatibility checker]
Loading

Technical review

Best possible solution:

Retain the deprecated export with current accessory typing and dated removal protection while preserving the retired return-button behavior.

Do we have a high-confidence way to reproduce the issue?

Stable source contains a concrete importing browser plugin, while current main omits its named export; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch repairs the existing SDK boundary, preserves the intentional retirement, and uses the established compatibility registry rather than introducing another owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 35481ee222f5.

Provenance checked

  • Session-header helper and accessory signature changes intended behavior with a stated reason (51ec103: fix(ui): revert Slack and Discord session return buttons #165334 retired Slack and Discord return buttons, metadata, and the helper at the feature owner's request.)
  • Stable SDK inventory keeps the original intent (28d3760: Protect the latest stable typed SDK surface independently of export ceilings; the existing generator derives the inventory from the selected stable tag.)
  • SDK export budgets keeps the original intent (2665147: Account explicitly for retained compatibility contracts and replacement exports; this patch adds matching allowances for one deprecated callable.)
  • DOM-only typecheck exclusion changes intended behavior with a stated reason (51ec103: The exclusion was removed when the browser helper was deleted; restoring it keeps DOM code in the existing UI typecheck graph.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Raw commit 51ec103 adds src/plugin-sdk/control-ui.ts:187 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 51ec1034c8ef; files: src/plugin-sdk/control-ui.ts)

PR surface

Source +92, Tests +35, Docs +9, Config +1, Other -956. Total -819 across 8 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 92 0 +92
Tests 1 35 0 +35
Docs 1 9 0 +9
Config 1 1 0 +1
Generated 0 0 0 0
Other 2 87 1043 -956
Total 8 224 1043 -819

Review metrics

Metric Value Why it matters
Production versus test growth Production +92 lines; tests +35 lines The helper, re-export, and compatibility record retain a shipped contract; the test protects consumer assignability and mounting without retired metadata.

Root-cause cluster

Relationship: canonical
Canonical: #169746
Summary: This PR owns the shipped-export compatibility repair identified during stable release closeout.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded browser-plugin SDK compatibility break on main.
  • merge-risk: 🚨 compatibility: The public SDK export is restored with a deprecation window; the maintainer-authored direction explicitly accepts import compatibility without restoring retired rendering.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Optionally show a stable-style browser plugin importing and mounting the restored helper in current Control UI.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-12T08:17:27.278Z sha 115a4c55590bb3fe95c06e94a2aaf89cdcd48afb :: needs changes before merge. :: [P1] Make the restored mount compatible with current accessory props
  • reviewed 2026-10-12T08:29:15.683Z sha 49119f1218981e288c1eabbadb72540d9e021367 :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 5:33 AM ET / 09:33 UTC (Revision 3).

@RomneyDa
RomneyDa enabled auto-merge (squash) October 12, 2026 08:24
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
…d compat export

Stable 2026.10.1 and 2026.10.2 ship createSessionHeaderLink from
openclaw/plugin-sdk/control-ui; #165334 removed it on main without a
compat window. Restore the shipped helper verbatim as a deprecated export,
record plugin-sdk-session-header-link (removeAfter 2027-01-12), and
refresh the shipped-surface inventory to v2026.10.2.
@RomneyDa
RomneyDa force-pushed the fix/sdk-restore-session-header-link branch from 49119f1 to a2864c4 Compare October 12, 2026 09:16
@RomneyDa
RomneyDa merged commit 4d17409 into main Oct 12, 2026
117 checks passed
@RomneyDa
RomneyDa deleted the fix/sdk-restore-session-header-link branch October 12, 2026 09:35
RomneyDa added a commit that referenced this pull request Oct 13, 2026
…d compat export (#169746)

* fix(plugin-sdk): restore shipped createSessionHeaderLink as deprecated compat export

Stable 2026.10.1 and 2026.10.2 ship createSessionHeaderLink from
openclaw/plugin-sdk/control-ui; #165334 removed it on main without a
compat window. Restore the shipped helper verbatim as a deprecated export,
record plugin-sdk-session-header-link (removeAfter 2027-01-12), and
refresh the shipped-surface inventory to v2026.10.2.

* fix(plugin-sdk): type restored session header link against current accessory props

* test(plugin-sdk): name the lane that type-checks the shipped accessory shape

(cherry picked from commit 4d17409)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…d compat export (openclaw#169746)

* fix(plugin-sdk): restore shipped createSessionHeaderLink as deprecated compat export

Stable 2026.10.1 and 2026.10.2 ship createSessionHeaderLink from
openclaw/plugin-sdk/control-ui; openclaw#165334 removed it on main without a
compat window. Restore the shipped helper verbatim as a deprecated export,
record plugin-sdk-session-header-link (removeAfter 2027-01-12), and
refresh the shipped-surface inventory to v2026.10.2.

* fix(plugin-sdk): type restored session header link against current accessory props

* test(plugin-sdk): name the lane that type-checks the shipped accessory shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant