Skip to content

feat(jobs): surface text/STRING node outputs in local jobs status as text_outputs (BE-3346)#550

Open
mattmillerai wants to merge 1 commit into
mainfrom
matt/be-3346-jobs-text-outputs
Open

feat(jobs): surface text/STRING node outputs in local jobs status as text_outputs (BE-3346)#550
mattmillerai wants to merge 1 commit into
mainfrom
matt/be-3346-jobs-text-outputs

Conversation

@mattmillerai

Copy link
Copy Markdown
Collaborator

ELI-5

When a ComfyUI workflow has a node that produces text — like a Gemini node describing an image, or a ShowText node — that text is stored by ComfyUI but comfy jobs status never showed it. You could only get it by manually curl-ing the server's /history endpoint. This PR makes comfy jobs status include those text outputs, so tools built on comfy-cli (like comfy-local-mcp) can read captions/descriptions/VLM tags without shelling out to curl.

What changed

  • New pure helper extract_text_outputs(record) in comfy_client.py, next to extract_output_entries. For each node_id in the history record's outputs, when node_output["text"] is a list, it keeps the str items and returns {node_id: [text, ...]}, omitting nodes with no text. Dict-shape tolerant (non-dict outputs/node → skipped, never raises).
  • Wired into the local jobs status snapshot (_snapshot) as an always-present additive key "text_outputs": extract_text_outputs(body) on the history branch, {} on the queued/running branch. All existing keys (outputs, outputs_by_node, outputs_by_item, error, status) are unchanged — additive only.
  • Pretty renderer shows a bounded per-entry preview (first line, ~120 chars, [node_id] <preview>). The --json path emits the full untruncated strings, exactly like the existing error payload.

Why

Text outputs (GeminiNode image descriptions, ShowText, anything emitting ui.text) live in GET /history/<prompt_id> under outputs[node_id]["text"] as bare strings, but the media-key flatten (images/gifs/videos/audio/files, each requiring a dict with filename) drops them. This blocks local LLM/vision workflows (captioning, VLM tagging, prompt expansion) through the comfy-cli → comfy-local-mcp toolchain.

Because comfy-local-mcp's job_status returns comfy-cli's envelope data verbatim, this additive key flows through the MCP with zero code changes there (a follow-up will just update the MCP docstring + version floor).

Scope / judgment calls

  • Out of scope (v1), per the ticket: the cloud snapshot (_cloud_status_snapshot — belongs to the cloud sibling ticket), comfy download materializing text to files, and other UI-output keys (string, etc.).
  • _wait_fetch_snapshot (jobs wait) is intentionally untouched: when the server is up it reuses _snapshot (inheriting the new key); its on-disk fallback is a minimal shape and out of scope for this jobs status ticket.
  • Empty strings under text are preserved as legitimate (empty) text outputs rather than silently dropped; only non-str items in the list are filtered out.

Testing

  • New unit tests for extract_text_outputs: text present / absent / non-list text / mixed-type items (only strings kept) / non-dict outputs & node / int node-id coercion.
  • New _snapshot tests: text_outputs grouped-by-node with full untruncated strings on the history branch; {} on the no-text history branch; {} on the queued/running branch.
  • New pretty-render test asserting the per-entry preview is truncated (first line only, marker) while the full text is not rendered in pretty mode.
  • pytest (2583 passed, 37 skipped), ruff check ., and ruff format --check . all pass (verified against the CI-pinned ruff 0.15.15).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 14a917d4-3448-44d4-8bc1-6ddd6858f438

📥 Commits

Reviewing files that changed from the base of the PR and between a732f5c and a76bb25.

📒 Files selected for processing (4)
  • comfy_cli/comfy_client.py
  • comfy_cli/command/jobs.py
  • tests/comfy_cli/command/test_transfer_download.py
  • tests/comfy_cli/jobs/test_jobs.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-3346-jobs-text-outputs
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch matt/be-3346-jobs-text-outputs

Comment @coderabbitai help to get the list of available commands.

@mattmillerai mattmillerai added cursor-review Request Cursor bot review agent-coded PR authored by the agent-work loop labels Jul 17, 2026
@mattmillerai
mattmillerai marked this pull request as ready for review July 17, 2026 20:38
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Jul 17, 2026

@github-actions github-actions 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.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

⚠️ Review failed

Judge call failed (status=parse_error): Could not parse JSON findings from output. First 500 chars:
I've verified the code and line anchors. My analysis confirms: line 733 builds `f"[{node_id}] {first}"` and line 735 adds it to a Rich table cell (markup enabled by default), the line-730 guard misfires on leading-newline text, and the preview count is unbounded despite the "bounded" comment.

[
  {
    "file": "comfy_cli/command/jobs.py",
    "line": 733,
    "side": "RIGHT",
    "severity": "high",
    "body": "`node_id` and `text` are interpolated into `f\"[{node_id}] {first}\"` and handed to

Re-trigger by removing and re-adding the cursor-review label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded PR authored by the agent-work loop cursor-review Request Cursor bot review enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant