Skip to content

fix: confusing prompt name error messages#1805

Open
aditya-mitra wants to merge 1 commit intospeakeasy-api:mainfrom
aditya-mitra:prompt-name-error
Open

fix: confusing prompt name error messages#1805
aditya-mitra wants to merge 1 commit intospeakeasy-api:mainfrom
aditya-mitra:prompt-name-error

Conversation

@aditya-mitra
Copy link
Contributor

@aditya-mitra aditya-mitra commented Mar 9, 2026

body.name seems confusing as it can also mean the prompt body - updated it to show a more useful error message

Before After
image image

Open with Devin

@aditya-mitra aditya-mitra requested a review from a team as a code owner March 9, 2026 12:06
@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2026

⚠️ No Changeset found

Latest commit: 67c2464

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 9, 2026

@aditya-mitra is attempting to deploy a commit to the Speakeasy Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Member

@walker-tx walker-tx left a comment

Choose a reason for hiding this comment

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

Thank you for your PR @aditya-mitra!

It looks like the prompt name regex was modified to shorten the allowable input length. Would you explain why you've done this, or revert it back to 128 chars please?

export const TOOL_NAME_PATTERN = "^[a-zA-Z]+(?:[_][a-zA-Z0-9]+)*$";
export const TOOL_NAME_REGEX = new RegExp(TOOL_NAME_PATTERN);
export const PROMPT_NAME_PATTERN = "^[a-z0-9_-]{1,128}$";
export const PROMPT_NAME_PATTERN = "^[a-z0-9_-]{1,40}$";
Copy link
Member

Choose a reason for hiding this comment

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

Would you share a bit about why the character limit has been changed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. body.Name has validation of limit 40 here

if body.Name != nil {
if utf8.RuneCountInString(*body.Name) > 40 {
err = goa.MergeErrors(err, goa.InvalidLengthError("body.name", *body.Name, utf8.RuneCountInString(*body.Name), 40, false))
}
}

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.

2 participants