mirror of
https://github.com/Comfy-Org/comfy-skills.git
synced 2026-11-04 23:37:45 +00:00
[PR #42] feat(comfy-sdk): a single-file skill for building apps on the Comfy SDK and Router #42
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-skills#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-skills/pull/42
Author: @mattmillerai
Created: 10/8/2026
Status: 🔄 Open
Base:
main← Head:mattmiller/be-19739-comfy-sdk-skill📝 Commits (7)
412949bfeat(comfy-sdk): a single-file skill for building apps on the Comfy SDK and Routera82feadfix(comfy-sdk): smoke-check every fenced example, don't persist checkout credsda52987chore(comfy-sdk): drop the committed .pyc and ignore Python bytecode06e67d0fix(comfy-sdk): TypeScript run errors are ComfyError, and a 429 is not retried2f6a5b1fix(comfy-sdk): queued TypeScript client failures are ComfyError, not RouterError675527ffix(comfy-sdk): scope the error bucket to Router responses; name transport and abort errors05fc5b1fix(comfy-sdk): TypeScript models.run reports an unreadable reply as unexpected_response📊 Changes
7 files changed (+382 additions, -3 deletions)
View changed files
📝
.claude-plugin/marketplace.json(+7 -1)➕
.github/scripts/sdk_skill_smoke.py(+69 -0)➕
.github/workflows/sdk-skill-smoke.yml(+106 -0)📝
.gitignore(+2 -0)📝
README.md(+14 -2)➕
claude-code-sdk/.claude-plugin/plugin.json(+10 -0)➕
claude-code-sdk/skills/comfy-sdk/SKILL.md(+174 -0)📄 Description
ELI5
A coding agent asked to "add image generation to my app with the Comfy SDK" had nothing telling it how the SDK and Comfy Router actually behave, so it would guess: put the API key in the browser, retry a generation itself (and pay twice), pick the wrong client, or catch the wrong kind of error. This adds a one-file skill that teaches the agent the stable rules and tells it to look up anything that changes (models, schemas, prices, timeout defaults) at run time.
What changed
claude-code-sdk/— newcomfy-sdkplugin:.claude-plugin/plugin.json(metadata only, nomcpServers) and oneskills/comfy-sdk/SKILL.md. Noreferences/directory, socomfy skills install --skill <path>and copy-it-raw users (Cursor rules,AGENTS.md) get the whole thing..claude-plugin/marketplace.json— registerscomfy-sdknext tocomfy-cloud.README.md— install block forcomfy-sdk, an "Other agents" line, and the repo-layout entry. The existing authoring rule is unchanged, and the skill follows it (no model ids, prices or schemas)..github/workflows/sdk-skill-smoke.ymland.github/scripts/sdk_skill_smoke.py— run on push to main, on PRs, and weekly. They install the latestcomfy-sdk,comfy-cliand@comfyorg/sdk, pull the fencedpython/tsblocks out of the skill (CommonMark fences: backtick or tilde, any length; an unclosed fence fails), fill in the placeholders, then runast.parseandtsc --noEmit. They also confirm thatmodels.run/submit/handleandrouter_exceptionsexist in both SDKs, and type-check the TypeScript error surface the skill names (ComfyError.codefromrun,routerErrors.RouterError.errorTypefrom the queued path,retryAfteron both), and runcomfy skills validate, a grep that fails on a model id or price, andclaude plugin validate ./claude-code-sdk. Both checkouts setpersist-credentials: false. Nothing calls the network.Judgment calls
RouterErrorsubclasses (exc.error_type) everywhere. TypeScriptcomfy.models.runthrowsComfyErrorsubclasses read viaerr.code. On the queued path (submit/handle/subscribe), a Router error response throwsrouterErrors.*witherr.errorType, and TS callers catchComfyErroron both paths.ComfyError(an unreadable reply isinvalid_responsein Python and on the TS queued path butunexpected_responsefrom TSrun; TS queuedrequest_timeout), a transport failure after retries are spent ishttpx.HTTPError(Python) or the nativefetchTypeError(TS), PythonsubscriberaisesTimeoutError, and a TS caller's own abort is rethrown unchanged.runretries a429that namesRetry-After; no TypeScript path does, so the skill tells TS callers to waiterr.retryAfterthemselves.comfy.models.list()/comfy.models.schema(). Python 0.4.0 has no wrapper for these, so Python users get the raw routes with a Bearer key.RouterErrorin Python and for Router responses on the TS queued path,ComfyErrorfrom TSrunand SDK-raised client-side failures).kind: "json" | "binary".submit/handle/subscribe"need 0.3.0+": confirmed.comfy-sdk==0.2.0doesn't have them; 0.3.0 does.name: comfy-sdk, which matches the directory).Provenance
claude plugin validate(plugin and marketplace) andcomfy skills validateon the skill pass, and a local marketplace install ofcomfy-sdk@comfy-skillsinstalls the skillrunmaps buckets ontoComfyErrorsubclasses; queued client timeouts throwComfyErrorrequest_timeout, an unreadable reply isunexpected_responsefrom TSrunandinvalid_responsefrom the TS queued path and Python, while transportTypeErrors and caller aborts are rethrown as-is; Python transport errors stayhttpx.HTTPErrorandsubscriberaisesTimeoutError; neither TS path retries below 500 except the409/504collectcomfy skills validatepass locally on the current headtsc --noEmitpasses, and a plantedComfyError.errorTyperead fails as intended05fc5b1:smokeandplugin-validatepass, with no merge-queue run yetResidual
/plugin install comfy-sdk@comfy-skillsacceptance against a local checkout of this branch. Installing fromComfy-Org/comfy-skillson GitHub only works after merge, so re-check it then.subscribe's best-effort cancel on timeoutCOMPLETED-with-error_typesemantics409 invalid_inputon key reuse with a different body🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.