Skip to content

fix: improve publish dependency error messages#186

Merged
juhgiyo merged 3 commits intomainfrom
claude/improve-publish-dependency-error-messages
Apr 10, 2026
Merged

fix: improve publish dependency error messages#186
juhgiyo merged 3 commits intomainfrom
claude/improve-publish-dependency-error-messages

Conversation

@juhgiyo
Copy link
Copy Markdown
Contributor

@juhgiyo juhgiyo commented Apr 10, 2026

Summary

  • Improved all dependency validation error messages in both publish and publishInternal mutations to include the role being published, list missing deps as comma-separated text (not JSON arrays), and add actionable fix suggestions
  • Extracted duplicated 6-line error-building block into a shared throwIfDepErrors helper function
  • Self-dependency error now includes the role slug for consistency

Before: Dependency role(s) not found in registry: ["code-reviewer","qa-engineer"]
After: Failed to publish role 'implementer': Dependency role(s) not found in registry: code-reviewer, qa-engineer. Publish these roles first, then retry publishing 'implementer'

Test plan

  • All 266 existing tests pass
  • Error message format manually verified against before/after examples
  • Both publishInternal and publish mutations use the shared helper
  • No other files modified

🤖 Generated with Claude Code

juhgiyo and others added 3 commits April 10, 2026 10:28
…fix suggestions

Dependency validation errors during roles:publish now name the role being
published, list missing deps as comma-separated text instead of JSON arrays,
and suggest publishing missing deps first. Applied to both publish and
publishInternal mutations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
strawhub Ready Ready Preview, Comment Apr 10, 2026 5:39pm

@juhgiyo juhgiyo merged commit e9db046 into main Apr 10, 2026
7 checks passed
@juhgiyo juhgiyo deleted the claude/improve-publish-dependency-error-messages branch April 10, 2026 17:40
juhgiyo added a commit that referenced this pull request Apr 10, 2026
Convex strips plain Error messages from client-facing mutations as a
security feature. The improved error messages from PR #186 were invisible
to web UI users because throwIfDepErrors and the publish mutation used
throw new Error(). Changed to throw new ConvexError() so messages pass
through to the client. The CLI path (httpAction -> publishInternal) is
unaffected since httpAction catches e.message which works for both types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
juhgiyo added a commit that referenced this pull request Apr 10, 2026
## Summary

- **Bug fix**: Convex strips plain `Error` messages from client-facing
mutations as a security feature, so the improved error messages from PR
#186 were invisible to web UI users (they saw generic "Server Error"
instead)
- Changed 8 `throw new Error()` → `throw new ConvexError()` in
`convex/roles.ts`: the `throwIfDepErrors` helper and all error throws in
the `publish` mutation (auth, ownership, deletion, version checks)
- `publishInternal` (internal mutation) left unchanged — its errors are
caught by the httpAction which accesses `e.message` directly

## Test plan

- [x] 266/266 tests pass
- [x] TypeScript compiles cleanly (`tsc --noEmit`)
- [x] Verified `ConvexError(string).message === string` (httpAction
catch blocks still work)
- [ ] Manual: publish a role with a missing dependency via web UI →
should see the full error message instead of "Server Error"

## Follow-up (out of scope)

- `softDelete` and `restore` mutations in `convex/roles.ts` have the
same bug (plain `Error` in client-facing mutations)
- `convex/skills.ts`, `convex/agents.ts`, `convex/integrations.ts`,
`convex/memories.ts` have the same pattern

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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