Skip to content

Conversation

@ethanndickson
Copy link
Member

Summary

Adds explicit character limit guidance to workspace name generation prompts to prevent AI models from generating names that exceed the 20-character schema limit.

Background

AI models (especially Haiku) don't always respect JSON schema numeric constraints—they need explicit guidance in the prompt text. The schema already had .max(20) but the AI wasn't seeing this constraint, resulting in names like "workspace-integration" (21 chars) that fail validation:

AI_NoObjectGeneratedError: No object generated: response did not match schema.
...
"code": "too_big",
"maximum": 20,
"message": "Too big: expected string to have <=20 characters"

Implementation

Added "max 15 chars" to both:

  1. The schema .describe() text
  2. The prompt requirements text

The 15-char target leaves room for the -xxxx suffix that gets appended, while the 20-char schema constraint remains as a safety net.


Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high • Cost: $0.45

AI models (especially Haiku) don't always respect JSON schema numeric
constraints—they need explicit guidance in the prompt text.

Added 'max 15 chars' to both the schema description and prompt to prevent
names like 'workspace-integration' (21 chars) from exceeding the 20-char
schema limit.
@github-actions github-actions bot added the bug label Jan 29, 2026
@ethanndickson ethanndickson added this pull request to the merge queue Jan 29, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 29, 2026
@ethanndickson ethanndickson added this pull request to the merge queue Jan 29, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant