mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #115] feat: fetch a job's execution log on demand with getLogs() #117
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
bug
cursor-review-pin
effort:medium
effort:small
effort:trivial
priority:nice-to-have
priority:recommended
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-typescript-sdk#117
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-typescript-sdk/pull/115
Author: @guill
Created: 9/1/2026
Status: 🔄 Open
Base:
main← Head:jacob/be-9479-add-devplat-execution-logs-support-to-sdk📝 Commits (1)
20c57dafeat: fetch a job's execution log on demand with getLogs()📊 Changes
12 files changed (+702 additions, -8 deletions)
View changed files
📝
CHANGELOG.md(+17 -0)📝
README.md(+52 -0)📝
spec/openapi.yaml(+159 -1)📝
src/low/generated/index.ts(+1 -1)📝
src/low/generated/types.gen.ts(+77 -0)📝
src/low/generated/zod.gen.ts(+21 -1)📝
src/low/transport.test.ts(+52 -1)📝
src/low/transport.ts(+30 -0)📝
src/sdk/index.ts(+1 -1)📝
src/sdk/jobs.ts(+76 -0)➕
src/sdk/logs.test.ts(+141 -0)📝
test/support/stub-server.ts(+75 -3)📄 Description
Summary
Adds
job.getLogs(), which fetches what a run printed and resolves to aJobLogs(text,truncated,capturedAt,complete) ornull.The log is a resource of its own rather than a field on the job, so submitting and polling never download one —
run()to terminal issues zero log requests, and a caller pays only when it asks. Nothing is cached, so an earlynullon a job that has not finished cannot mask the log it goes on to produce; call again after a terminal status.nullis an ordinary answer, not an error. It covers every reason there is nothing to read — the deployment captures no logs at all, the job has not finished, it predates capture, the run was killed before the worker could report an outcome, capture failed, or the log is withheld from anonymous callers — and the API deliberately does not distinguish them.A surface that captures no logs omits
urls.logsentirely. The SDK answers from that absence without a request, rather than building the path itself, which would 404 as though the job were missing.Consumer impact
Purely additive. No export is removed or narrowed, and existing code keeps compiling:
Job.getLogs(),ComfyLow.getJobLogs(), and the exportedJobLogstype.JobUrls.logs, optional — a server that does not send it still validates.capturedAtis resolved to aDate, matchinggetDownloadUrl'sexpiresAtand the Python twin'sdatetime.The vendored spec is synced from the canonical contract and
src/low/generatedregenerated.Testing
pnpm test— 419 passed across 24 files. New behavioural coverage: 200 yields a typed value, 204 yieldsnull, three calls make three requests,run()to terminal issues none, a missingurls.logsshort-circuits without a request, an emptyurls.logsis treated the same way, and the SDK follows the link rather than rebuilding the path.pnpm lint,pnpm format:check,pnpm typecheck— clean.pnpm check:spec-drift—src/low/generatedin sync with the vendored spec.pnpm check:sdk-parityand the public-repo hygiene check — clean.Also verified end to end by driving the real SDK against a live HTTP server, not only the test doubles.
Opened as a draft: the server side of this contract is not released yet.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.