Skip to content

fix(plugins): keep the standup sweep output when a CLI call prints nothing - #9386

Open
aaronrosenthal wants to merge 1 commit into
ParadevAI:mainfrom
aaronrosenthal:fix/standup-sweep-bash32
Open

aaronrosenthal wants to merge 1 commit into
ParadevAI:mainfrom
aaronrosenthal:fix/standup-sweep-bash32

Conversation

@aaronrosenthal

@aaronrosenthal aaronrosenthal commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Fixes #9196.

The headline bug in #9196 (HOST_ARGS[@]: unbound variable on macOS bash 3.2) is already fixed on main. #9257 set HOST_ARGS=(--local) as the default, so the array is never empty. I ran the current script under /bin/bash 3.2.57 and terminals come back correctly.

This PR fixes the related problem the triage found in the same loop:

  • run_json treated empty stdout as valid, because jq -c . <empty> exits 0 and prints nothing. The empty READ then failed --argjson read "". That emptied TERMINALS, and the final jq failed, so the sweep printed no JSON at all. run_json now returns null (and logs no output from: …) when stdout is empty.
  • The loop skips a terminal whose ENTRY is empty instead of passing "" to --argjson.
  • The superset plugin goes to 0.3.5 in both plugin.json files, the same way feat(cli): cloud workspace commands that work while the sandbox sleeps #9257 bumped it to 0.3.4.

How I tested it

I put a stub superset on PATH and ran sweep.sh with macOS /bin/bash 3.2.57:

  • No --host, normal output: workspaces, tasks, and terminals (with text) are all present, before and after this change.
  • terminals read prints nothing: before, jq: invalid JSON text passed to --argjson and no JSON on stdout. After, full JSON with "text": null for that terminal.
  • bun run check:plugins passes. biome check plugins/superset is clean.

There are no TS changes, so I didn't run typecheck/test.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (only shell/JSON changed; biome clean on the touched files)
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Fixes the standup sweep so it still outputs JSON when a CLI call prints nothing.

When superset terminals read produced empty stdout, run_json treated it as valid output, the empty value failed --argjson, and the sweep ended up printing no JSON at all. run_json now returns null and logs no output from: ... when stdout is empty, and the loop skips a terminal with no entry instead of passing "" to --argjson.

Also bumps the superset plugin to 0.3.5 in both plugin.json files.

Written for commit 6037a56. Summary will update on new commits.

View guided diff

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of successful commands that return no output, preventing invalid results from being treated as valid JSON.
    • Skipped empty terminal entries to avoid displaying or processing blank items.
  • Chores
    • Updated the Superset plugin version to 0.3.5 in both plugin manifests.

…thing

run_json passed an empty stdout through as valid, because jq accepts empty
input. The empty value then failed --argjson in the terminal loop, which
emptied TERMINALS and made the final jq print nothing at all. run_json now
returns null for empty output, and the loop skips a terminal with no entry.

The bash 3.2 unbound HOST_ARGS error in ParadevAI#9196 is already gone on main:
ParadevAI#9257 made HOST_ARGS default to (--local), so it is never empty.

superset plugin 0.3.5.

Closes ParadevAI#9196

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Superset plugin metadata version changed from 0.3.4 to 0.3.5. The standup sweep script now reports successful commands with no output and skips empty terminal entries.

Changes: Superset standup plugin

Layer / File(s) Summary
Plugin version metadata
plugins/superset/.claude-plugin/plugin.json, plugins/superset/plugin.json
Both plugin metadata files now specify version 0.3.5.
Sweep output and terminal entries
plugins/superset/skills/standup/scripts/sweep.sh
run_json reports an error and returns null when a successful superset command produces no output. The terminal loop skips entries that are empty.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: kitenite

Merge Risk: Minimal · up to 6037a

No merge-blocking issue is identified. The change preserves standup output when a CLI command returns nothing and consistently updates the plugin version.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title is conventional-commit formatted and names the main change: the standup sweep keeps its JSON output when a CLI call prints nothing. The changeset matches this: run_json now returns null on e…
Description check Passed The description follows the template structure with the 'What & why' and 'How I tested it' sections filled in. It names the linked issue (#9196), explains the root cause and the fix, and gives concret…
Linked Issues check Passed #9196 requires the sweep to list and read terminals on macOS Bash 3.2.57 without --host. The reviewed head sets HOST_ARGS=(--local) and passes "${HOST_ARGS[@]}" to terminal list and read command…
Out of Scope Changes check Passed The changes stay within the declared scope. sweep.sh preserves sweep output when a CLI call returns empty stdout and skips an empty terminal entry. The two superset plugin version updates identify…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title is conventional-commit formatted and names the main change: the standup sweep keeps its JSON output when a CLI call prints nothing. The changeset matches this: run_json now returns null on empty stdout, the loop skips empty ENTRY values, and the superset plugin version is bumped. The title does not mention the plugin version bump, but that is minor and expected.

Full details: Description check

Explanation

The description follows the template structure with the 'What & why' and 'How I tested it' sections filled in. It names the linked issue (#9196), explains the root cause and the fix, and gives concrete test steps with before and after results. The checklist is partly filled. Two items remain unchecked: the fork-PR maintainer-edit box and the CLA box. Both are administrative and do not block the review. The checklist also marks lint and typecheck as passing, while the body says typecheck was not run. That is a minor inconsistency. No screenshots are included, but the change is a shell script and has no user-visible UI, so this is acceptable.

Full details: Linked Issues check

Explanation

#9196 requires the sweep to list and read terminals on macOS Bash 3.2.57 without --host. The reviewed head sets HOST_ARGS=(--local) and passes "${HOST_ARGS[@]}" to terminal list and read commands. This implementation already exists at the merge base, so the requirement is satisfied without reimplementation in this pull request. The pull request also preserves that behavior while handling empty command output as JSON null.

Full details: Out of Scope Changes check

Explanation

The changes stay within the declared scope. sweep.sh preserves sweep output when a CLI call returns empty stdout and skips an empty terminal entry. The two superset plugin version updates identify the released plugin change and introduce no unrelated behavior.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (2 skipped: 2 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 717c06db-8380-4299-9eda-cdc88d4e5c83
Commits

Reviewing files that changed from the base of the PR and between bcc2455 and 6037a56.

Files selected for processing: 3

  • plugins/superset/.claude-plugin/plugin.json
  • plugins/superset/plugin.json
  • plugins/superset/skills/standup/scripts/sweep.sh

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/superset/skills/standup/scripts/sweep.sh">

<violation number="1" location="plugins/superset/skills/standup/scripts/sweep.sh:34">
P2: This check misses whitespace-only CLI output: `jq` succeeds but emits no value, so `run_json` returns an empty string and a later `--argjson` fails. Also require the parsed input to contain a value, such as by adding `jq -e -s 'length == 0'` to this condition.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant SHELL as sweep.sh
    participant CLI as superset CLI
    participant JQ as jq processor
    participant JSON as JSON Accumulator

    Note over SHELL,JSON: Standup Sweep Data Flow (Preserving JSON output on empty CLI results)

    SHELL->>SHELL: Initialize WORKSPACES via run_json

    loop For each workspace
        SHELL->>CLI: run_json workspaces list --json
        CLI-->>SHELL: Workspace JSON stdout
        SHELL->>JQ: Parse workspace JSON (jq -r '.[]?.id // empty')
        JQ-->>SHELL: Workspace IDs
    end

    loop For each workspace, for each terminal
        SHELL->>CLI: run_json terminals list --workspace WS --json
        CLI-->>SHELL: Terminal list JSON stdout
        SHELL->>JQ: Extract terminal IDs
        JQ-->>SHELL: Terminal IDs

        SHELL->>CLI: run_json terminals read --workspace WS --terminal ID --json
        CLI-->>SHELL: Terminal output (may be empty)

        alt Empty stdout from CLI
            SHELL->>SHELL: Check if output file is empty (test -s)
            SHELL->>SHELL: Log "no output from: superset ..." to stderr
            SHELL->>SHELL: Return null
        else Non-empty stdout
            SHELL->>JQ: Validate and parse JSON (jq -c .)
            alt Invalid JSON
                SHELL->>SHELL: Log "invalid JSON from: superset ..." to stderr
                SHELL->>SHELL: Return null
            else Valid JSON
                JQ-->>SHELL: Parsed JSON value
            end
        end

        SHELL->>JQ: Build terminal entry with --argjson read (null fallback)
        JQ-->>SHELL: Terminal entry JSON

        alt Entry is not empty
            SHELL->>JQ: Append entry to TERMINALS array (--argjson e)
        else Entry is empty or null
            SHELL->>SHELL: Skip terminal (continue)
        end
    end

    Note over SHELL,JSON: Final JSON output preserves workspaces, tasks, and terminals even when CLI calls return empty output
Loading

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

err=$(mktemp) || { rm -f "$out"; echo null; return; }
if superset "$@" --json >"$out" 2>"$err"; then
if ! jq -c '.' "$out" 2>/dev/null; then
if [ ! -s "$out" ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: This check misses whitespace-only CLI output: jq succeeds but emits no value, so run_json returns an empty string and a later --argjson fails. Also require the parsed input to contain a value, such as by adding jq -e -s 'length == 0' to this condition.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At plugins/superset/skills/standup/scripts/sweep.sh, line 34:

<comment>This check misses whitespace-only CLI output: `jq` succeeds but emits no value, so `run_json` returns an empty string and a later `--argjson` fails. Also require the parsed input to contain a value, such as by adding `jq -e -s 'length == 0'` to this condition.</comment>

<file context>
@@ -31,7 +31,10 @@ run_json() {
   err=$(mktemp) || { rm -f "$out"; echo null; return; }
   if superset "$@" --json >"$out" 2>"$err"; then
-    if ! jq -c '.' "$out" 2>/dev/null; then
+    if [ ! -s "$out" ]; then
+      echo "no output from: superset $*" >&2
+      echo null
</file context>
Suggested change
if [ ! -s "$out" ]; then
if [ ! -s "$out" ] || jq -e -s 'length == 0' "$out" >/dev/null 2>&1; then

This branch has not been deployed

No deployments
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.

Standup: sweep.sh fails on macOS bash 3.2 with unbound HOST_ARGS

1 participant