Skip to content

feat(electron): restore plugin management and Git sidebar after 0.1.5-rc.2 - #92

Merged
cherrchen merged 3243 commits into
developfrom
chore/sync-test-0.1.5-rc.2
Sep 14, 2026
Merged

cherrchen merged 3243 commits into
developfrom
chore/sync-test-0.1.5-rc.2

Conversation

@cherrchen

Copy link
Copy Markdown
Owner

Summary

  • Land the DSH 0.1.5-rc.2 pin on Electron downstream (upstream removed the Client details slot).
  • Recover interrupted dsh plugin mutations with a pending marker, web-profile PID lock, and Main-owned recovery window instead of starting a dead Host.
  • Treat healthy hot runtime-plugins as manageable without profileManaged; keep that list as Desktop install accounting only.
  • Remount Plugin Manager on settings.plugins.tab and compose Git through sidebarRight. Details Host stays unmounted.

Test plan

  • cd apps/electron && CI=true pnpm run test
  • cd packages/dsh-electron/dsh-plugin-git && CI=true pnpm run test
  • pnpm run test:docs (Git subtree is excluded from DSH doc gates)
  • Confirm Settings → Plugins shows Installed, and Git appears in the right sidebar
  • Confirm apps/cli and packages/boot stay unmodified

fz and others added 30 commits September 8, 2026 23:31
…atalog-foundation

feat(subagent): record and observe parent-owned child catalogs
fix(web): move client dependencies to devDependencies
feat(web): declare workspace deliveries and open source files
imccyu and others added 19 commits September 10, 2026 09:13
Backport the selected changes from PR #3928 and PR #3902 onto dsh-v0.1.5-rc.1, retaining baseline session recordings and excluding newer master commits.

Refs #3927
Refs #3903

Co-authored-by: LegGasai <jyc132780208@sina.com>
…-backport-feedback-deliverables

feat(web): backport feedback and file refinements to 0.1.5
Disable the scheduled master merge so the 139-commit post-tag HEAD cannot land during the harness migration.
Pin harness packages to fb2c4b9 while keeping the Electron shell, Git plugin, and release channels.
Upstream removed the Client details slot, so composing dsh-plugin-git fails Host load and typecheck. Keep the subtree and drop it from ecosystemPlugins instead of porting to Sidebar.
Upstream rc.2 dropped the Client details slot, so mounting Details Host fails Host load. Leave both trees under runtime/plugins, drop the directory picker shellDetails inject, and keep Theme Studio plus loopback dsh web.
This fork cannot condense root AGENTS.md, so the budget gate skips it. Point leftover Agent Note links at live owners and bring the ecosystem plugin README under the Summary limit.
The 0.1.5-rc.2 pin removed the Client details slot, so this subtree injects sidebarRight instead of depending on Details Host. DSH documentation and lint gates skip the package because it owns its own bilingual docs and lint.
Write a pending marker and take the web profile PID lock around dsh plugin, then reconcile read-only at startup. Failed pending, catalog, or Host-ready paths open a Main-owned recovery window instead of loading a dead Host.
Treat a healthy runtime-plugin as manageable without profileManaged so the Installed tab can enable, disable, and remove CLI installs. Keep profileManaged as desktopInstalled source accounting only.
Mount the Installed tab on settings.plugins.tab and restore Git as an ecosystem plugin now that the client injects sidebarRight. Details Host stays unmounted because upstream still has no details slot.
…osition

Record pending/lock startup, CLI-installed runtime-plugin manageability, empty-install failure, Plugin Manager remount, and Git sidebar composition in the Electron lifecycle docs.
The host aggregate now typechecks this subtree, and matchAll capture groups are string | undefined.
Reference the Git host and client projects so source still typechecks, but exclude packages/dsh-electron/** so subtree tests are not compiled against DSH Client fakes.
…nection from root

Mirrors the standalone dsh-plugin-git fix: the nested inject(['connection'])
fiber could not see the sibling webServer row, so rpc.handle died with
'cannot get property "webServer" without inject', the /git channel never
registered, and all client requests fell through to the SPA fallback as 405.
Declare webServer in the dependency list and read the service off ctx.root.
@cherrchen

Copy link
Copy Markdown
Owner Author

@codex Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8403b497f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/electron/src/main.ts Outdated
Comment on lines +132 to +136
void stopHarness(child).then(
() => { reject(timeoutError) },
(cleanupError: unknown) => {
reject(new AggregateError(
[timeoutError, cleanupError],
`${timeoutError.message} Harness shutdown also failed.`,
))
console.error('desktop recovery: Harness shutdown after startup timeout failed', cleanupError)
reject(timeoutError)

ghost Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not retry before the timed-out Host is stopped

When stopHarness(child) rejects, this branch discards the cleanup failure and still reports a recoverable host-timeout; retryAfterPluginRecovery subsequently spawns another Host even though the first child has not been proven to exit. Preserve the shutdown failure as non-retryable, or wait for the original child to reach quiescence before offering a retry.

AGENTS.md reference: AGENTS.md:L137-L139

Useful? React with 👍 / 👎.

Comment thread apps/electron/src/main.ts
Comment on lines +525 to +528
async () => {
const repaired = await catalog.list()
await composition.apply(effectivePluginRoster(repaired, loadPluginState(overlay.pluginStatePath).state))
},

ghost Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reload lifecycle state after startup recovery

When Host startup times out and the user chooses Disable All or Reset Management, this callback reloads the repaired state only for the generated composition; the later PluginLifecycleController still receives the pre-recovery reconciled.state. Its catalog then reports the wrong desiredEnabled values, and subsequent enable/disable operations can no-op or persist the stale preferences. Reload and reconcile the state used to construct the controller after recovery succeeds.

AGENTS.md reference: AGENTS.md:L137-L139

Useful? React with 👍 / 👎.

Comment thread apps/electron/src/plugin-startup.ts Outdated
Comment on lines +103 to +105
await savePluginState(options.statePath, state)
await new DynamicIncludeCompositionBackend(options.configPath).apply(effectivePluginRoster(plugins, state))
await clearPluginPending(options.pendingPath)

ghost Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep recovery actions behind the profile lock

If startup reaches lock-timeout because an orphaned dsh plugin child is still alive, Disable All clears the pending marker here without acquiring the profile lock; Reset Management does the same below. Startup then proceeds and can launch Host while that child is still mutating the profile. These repair actions must wait for ownership or explicitly terminate and reap the live owner before clearing the marker.

AGENTS.md reference: AGENTS.md:L137-L139

Useful? React with 👍 / 👎.

Comment thread apps/electron/src/main.ts Outdated
@@ -426,12 +431,66 @@ if (!primaryInstance) {
'web',
() => loadPluginState(overlay.pluginStatePath).state,
)
const catalogPlugins = await catalog.list()
ensureWebProfileWorkspace(webProfileDir(harnessHome))

ghost Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Acquire the profile lock before rewriting workspace policy

On a restart with a pending Desktop mutation whose child is still running, this call can truncate and rewrite the same profile's pnpm-workspace.yaml before reconcilePendingPackageMutation attempts to acquire the lock. That races pnpm's active transaction and defeats the serialization added by this change; move this write until after pending reconciliation owns or releases the profile lock.

AGENTS.md reference: AGENTS.md:L137-L139

Useful? React with 👍 / 👎.

Comment on lines +49 to +53
if (!/^allowBuilds:/m.test(next)) {
next += renderAllowBuilds(WEB_PROFILE_ALLOW_BUILDS)
return next
}
return insertMissingAllowBuilds(next, WEB_PROFILE_ALLOW_BUILDS)

ghost Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Merge policy into inline allowBuilds maps

For a valid user workspace such as allowBuilds: { esbuild: true }, the first regex treats allowBuilds as present, but insertMissingAllowBuilds only replaces a line containing exactly allowBuilds: and therefore adds none of the remaining reviewed entries. With strictDepBuilds enabled, installs that need those entries are then rejected even though this function promises to merge the Desktop seed without dropping user configuration; parse and update the YAML value rather than assuming block-map formatting.

Useful? React with 👍 / 👎.

cherrchen added 4 commits September 14, 2026 00:08
Upstream 0.1.5-rc.2 removed the Client details slot and the
ILayout.openDetails/closeDetails API, so the unmounted
runtime/plugins/ui-details-host mirror no longer type-checks against
workspace types; CI fails on tsconfig.runtime-client.json while a local
nested 0.1.2-rc.1 node_modules hides the breakage. Remove the mirror,
its dedicated tests, the client path alias, Plugin Manager display name,
and every documentation reference; Theme Studio remains the only member
of the Electron-required portable UI infrastructure category. New Agent
Note consolidates and deletes the Details Host unmount note. Retarget
the automatic-JSX artifact coverage to the Plugin Manager bundle and
fix the four oxlint errors this branch had introduced behind the
typecheck failure.

Refs #92
@cherrchen

ghost commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

@codex Review

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

https://github.com/cherrchen/deepseek-harness-electron/blob/7583a3371dfab66a3c2f45836013c17546da3828/apps/electron/src/plugin-install.ts#L500
P2 Badge Hand the profile lock to the rollback subprocess

When a Git or local install resolves to a Desktop-reserved package name, this automatic rollback starts a second dsh plugin child without the onSpawn owner handoff used by the primary command. If Main crashes during that removal, the child can remain alive while the lock still names the dead Main PID, so the next Desktop instance recycles the lock and reconciles or starts Host concurrently with the rollback mutation. Record the rollback child PID for its lifetime and restore Main ownership after it closes.

AGENTS.md reference: AGENTS.md:L137-L139

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/electron/src/plugin-catalog.ts Outdated
@@ -97,11 +98,12 @@ export class ProfilePluginCatalog implements PluginCatalog {
kind,
installSource,
requestedSpec,
manageable: activationMode === 'hot' && health === 'healthy' && managedRuntime,
manageable: activationMode === 'hot' && health === 'healthy',

ghost Sep 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep plain CLI dependencies out of the runtime roster

When the web profile contains a CLI-installed plain dependency with a normal main or root exports entry, inspectProfilePackageState() classifies it as a runtime-plugin; making every such healthy entry manageable now adds it to effectivePluginRoster() at startup. Electron will therefore try to Cordis-load ordinary libraries that the CLI deliberately retained as plain dependencies, which can make Host startup fail. Require an explicit plugin discriminator or preserve an intent gate instead of treating every importable package as a hot plugin.

Useful? React with 👍 / 👎.

const loaded = loadPluginState(options.statePath).state
const disabled = [...new Set([
...loaded.disabled,
...plugins.filter(plugin => plugin.manageable).map(plugin => plugin.name),

ghost Sep 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Disable broken profile bundles during startup recovery

When an interrupted update leaves a profile bundle unloadable, the catalog marks that bundle profile-restart and manageable: false, so this filter never disables it; effectivePluginRoster() also controls only hot plugins and does not remove the bundle from dsh.profile.bundles. The action then clears the pending marker and retries Host with the same broken bundle, while Reset Management likewise preserves the bundle list, leaving both advertised recovery paths unable to restore startup. Recovery must exclude or repair affected profile bundles before clearing the marker.

AGENTS.md reference: AGENTS.md:L137-L139

Useful? React with 👍 / 👎.

@cherrchen
cherrchen merged commit f8818c9 into develop Sep 14, 2026
@cherrchen
cherrchen deleted the chore/sync-test-0.1.5-rc.2 branch September 26, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.