Skip to content

fix(app): unwrap store proxy before Skill Hub install IPC - #335

Merged
quickbeard merged 5 commits into
mainfrom
skillhub-install-clone
Aug 27, 2026
Merged

quickbeard merged 5 commits into
mainfrom
skillhub-install-clone

Conversation

@quickbeard

@quickbeard quickbeard commented Aug 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Installing a skill from the desktop Skill Hub hung on "Installing" forever, with Uncaught (in promise) Error: An object could not be cloned in the console.

The install dialog passed state.agents — a SolidJS store's reactive Proxy — into skillhub.install(...), which lands in ipcRenderer.invoke("skillhub-install", ...). Electron structured-clones invoke arguments, and the structured-clone algorithm rejects proxies, so the request never left the renderer. The rejection happened at the IPC layer, below the main-process controller's result-union error handling, so nothing reset the dialog phase.

Fix: copy the agents into a plain array at the call site (agents: [...state.agents]), with a comment recording the clone constraint. The browse and detail IPC calls already pass plain objects and strings, so this was the only affected path.

Follow-up commits:

  • fix(tui): declare the @codev/upload workspace dependency — packages/tui imports @codev/upload/nudge and /spawn (since feat: nudge for a fresh sign-in when session uploads stall #312) but never declared the dependency, so bun typecheck failed with TS2307 wherever hoisting didn't cover it — including the pre-push hook, which blocked pushing this branch.
  • fix(app): give Skill Hub install failures their own error messages — install failures reused the browse page's "Something went wrong loading the Skill Hub" copy. The dialog now maps error codes to install-specific copy (en/es/vi). (Found while diagnosing a separate server-side issue: the hub's GET /api/v1/skills/:id/download currently 500s for all skills; that is not addressable from this repo.)
  • feat(app): offer in-app SkillHub sign-in from the install dialog — an expired session used to surface as "run codevhub login in a terminal". The dialog now shows a Sign in button on the auth error code that runs the existing gatewaySso.startLogin() browser flow (which writes the shared ~/.codev/auth.json every hub request reads) and retries the install automatically, with a cancellable signing-in phase.

No DIVERGENCES changes — the app files are fork-only, and the tui manifest change restores a dependency the fork's own code already requires. CHANGELOG's unreleased Skill Hub entry extended with the in-app sign-in.

Testing

  • Repo-wide bun turbo typecheck passes (via the pre-push hook; previously failed in @opencode-ai/tui).
  • bun test src/skillhub in packages/app passes.

🤖 Generated with Claude Code

quickbeard and others added 5 commits August 26, 2026 15:23
The install dialog passed state.agents — a SolidJS store's reactive
Proxy — into ipcRenderer.invoke, whose structured clone rejects proxies
with "An object could not be cloned". The rejection happened at the IPC
layer, below the controller's result-union error handling, so nothing
reset the dialog and it hung on "Installing" forever.

Copy the agents into a plain array at the call site. The browse and
detail calls already pass plain objects and strings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
src/app.tsx and src/component/dialog-configure.tsx import
@codev/upload/nudge and /spawn (since #312) but the package never
declared the dependency, so bun never linked it into
packages/tui/node_modules and `bun typecheck` failed with TS2307 on any
machine where hoisting didn't happen to cover it — which also blocked
every push through the pre-push hook's repo-wide typecheck.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Install failures reused the browse page's "Something went wrong loading
the Skill Hub" copy, and an expired-session failure gave no hint that
signing in again is the remedy. Map the auth code to a re-login hint and
other failures to install-specific copy (en/es/vi).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An expired or missing SkillHub session surfaced as an error telling the
user to run `codevhub login` in a terminal, even though the desktop app
already owns a browser SSO flow (the gateway configure gate) that writes
the same shared auth file every hub request reads.

When an install fails with the auth code, the dialog now shows a Sign in
button that runs `gatewaySso.startLogin()` — silent refresh first, full
browser loopback otherwise — then retries the install automatically. A
signing-in phase shows a loader with a cancel that aborts the attempt.
The auth error copy drops the terminal hint in all three locales.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Vite's dep scanner does not crawl `?worker&url` entries, so the markdown
worker's deps (@shikijs/stream, katex, marked, marked-shiki, remend,
shiki) were only discovered on the first markdown render — a mid-session
re-optimize that full-page reloads the dev app, resetting e.g. a Skill
Hub search as its results rendered. Scan the worker as an extra
optimizeDeps entry so they are bundled at startup instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 83ccf00 into main Aug 27, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the skillhub-install-clone branch August 27, 2026 01:17
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.

1 participant