Skip to content

Fix/create dashboard skill#101

Merged
Vunovati merged 2 commits into
mainfrom
fix/create-dashboard-skill
Mar 20, 2026
Merged

Fix/create dashboard skill#101
Vunovati merged 2 commits into
mainfrom
fix/create-dashboard-skill

Conversation

@Vunovati
Copy link
Copy Markdown
Collaborator

@Vunovati Vunovati commented Mar 20, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling for backend connection failures with clearer diagnostic messages and remediation steps.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

Version incremented to 1.0.1 in both the skill metadata and tile manifest. Auto-generated command invocations now suppress stderr and emit explicit error messages with remediation suggestions when unable to connect to the Kopai backend.

Changes

Cohort / File(s) Summary
Version and Error Handling Updates
skills/create-dashboard/SKILL.md, skills/create-dashboard/tile.json
Version bumped to 1.0.1 across both files. Dashboard schema and metrics discovery commands now suppress stderr and provide explicit error messages with remediation steps (start locally via npx @kopai/app start or verify .kopairc URL) on backend connection failures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A version bump hops along with care,
Error messages now appear with flair,
No silent fails to make us despair,
Just helpful hints floating through the air! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix/create dashboard skill' is vague and doesn't clearly specify what was fixed or what the main change is. While it references the affected component (dashboard skill), it lacks specificity about the actual modifications (version bumps and error handling improvements). Use a more descriptive title that specifies the primary change, such as 'Improve error handling in create-dashboard skill' or 'Update create-dashboard skill with better backend connection feedback'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/create-dashboard-skill
📝 Coding Plan
  • Generate coding plan for human review comments

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

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/create-dashboard/SKILL.md`:
- Around line 14-18: Remove the stderr suppression and the plain-text fallback
that breaks JSON parsing: in the `npx `@kopai/cli` dashboards schema` and `npx
`@kopai/cli` metrics discover --json` invocations, delete `2>/dev/null` and stop
echoing an error string to stdout; instead let the CLI emit its diagnostics to
stderr and on failure either exit non‑zero or emit a valid JSON error object
(e.g. {"error": "..."} ) to stdout so downstream JSON parsing of `--json`
remains valid. Ensure the changes touch the two command lines shown (`npx
`@kopai/cli` dashboards schema` and `npx `@kopai/cli` metrics discover --json`) so
errors are visible on stderr and no plain-text fallback is printed to stdout.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 821e9bf6-edfa-41d5-b4be-6aaa2df01059

📥 Commits

Reviewing files that changed from the base of the PR and between 6404aa9 and d4148dd.

📒 Files selected for processing (2)
  • skills/create-dashboard/SKILL.md
  • skills/create-dashboard/tile.json

Comment on lines +14 to +18
!`npx @kopai/cli dashboards schema 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx @kopai/app start — If using a remote backend, check the url in your .kopairc file."`

## Available Metrics

!`npx @kopai/cli metrics discover --json`
!`npx @kopai/cli metrics discover --json 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx @kopai/app start — If using a remote backend, check the url in your .kopairc file."`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify CLI command naming convention and usage patterns across repo docs/skills.
rg -n -C2 'npx (`@kopai/cli`|kopai/cli)\b'
rg -n -C2 'pnpm add (`@kopai/cli`|kopai/cli)\b'
rg -n -C2 'metrics discover --json.*2>/dev/null|dashboards schema.*2>/dev/null'

Repository: kopai-app/kopai-mono

Length of output: 24950


Avoid suppressing CLI stderr and emitting non-JSON fallback on JSON path.

On Line 14 and Line 18, 2>/dev/null discards CLI diagnostics, and Line 18 emits plain-text fallback to stdout where JSON is expected (--json), breaking downstream parsing.

Proposed fix
-!`npx `@kopai/cli` dashboards schema 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx `@kopai/app` start — If using a remote backend, check the url in your .kopairc file."`
+!`npx `@kopai/cli` dashboards schema || { echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx `@kopai/app` start. If using a remote backend, check the url in your .kopairc file." >&2; exit 1; }`

-!`npx `@kopai/cli` metrics discover --json 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx `@kopai/app` start — If using a remote backend, check the url in your .kopairc file."`
+!`npx `@kopai/cli` metrics discover --json || echo '{"error":{"message":"Cannot connect to Kopai backend","remediation":["If running locally, start it with: npx `@kopai/app` start","If using a remote backend, check the url in your .kopairc file."]}}'`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/create-dashboard/SKILL.md` around lines 14 - 18, Remove the stderr
suppression and the plain-text fallback that breaks JSON parsing: in the `npx
`@kopai/cli` dashboards schema` and `npx `@kopai/cli` metrics discover --json`
invocations, delete `2>/dev/null` and stop echoing an error string to stdout;
instead let the CLI emit its diagnostics to stderr and on failure either exit
non‑zero or emit a valid JSON error object (e.g. {"error": "..."} ) to stdout so
downstream JSON parsing of `--json` remains valid. Ensure the changes touch the
two command lines shown (`npx `@kopai/cli` dashboards schema` and `npx `@kopai/cli`
metrics discover --json`) so errors are visible on stderr and no plain-text
fallback is printed to stdout.

@Vunovati Vunovati merged commit b6f1d67 into main Mar 20, 2026
2 checks passed
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