Skip to content

fix: slugify returns fallback for non-ASCII input instead of empty string#433

Closed
VJ-yadav wants to merge 1 commit intoAltimateAI:mainfrom
VJ-yadav:fix/slugify-non-ascii-fallback
Closed

fix: slugify returns fallback for non-ASCII input instead of empty string#433
VJ-yadav wants to merge 1 commit intoAltimateAI:mainfrom
VJ-yadav:fix/slugify-non-ascii-fallback

Conversation

@VJ-yadav
Copy link

@VJ-yadav VJ-yadav commented Mar 24, 2026

Summary

slugify() in training-import.ts strips all non-ASCII characters, returning an empty string for non-English content like Japanese or Chinese headings. This breaks training import for those teams. Added a fallback that returns entry-{timestamp} when the slug would be empty.

Test Plan

Added test case with pure Japanese heading. All 11 tests pass.

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • CHANGELOG updated (if user-facing)

Fixes #370

…ring

When given pure non-ASCII text (Japanese, Chinese, Korean, etc.), the
regex strips all characters and returns "". This breaks training import
for non-English style guides. Now falls back to `entry-{timestamp}`.

Fixes AltimateAI#370
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@VJ-yadav has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bafc9fbb-c769-4f96-a4aa-4bedb926ee78

📥 Commits

Reviewing files that changed from the base of the PR and between 544903f and 76bfbd9.

📒 Files selected for processing (2)
  • packages/opencode/src/altimate/tools/training-import.ts
  • packages/opencode/test/altimate/training-import.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions
Copy link

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@Bharatram-altimate-ai
Copy link
Contributor

Closing this as superseded by #439, which merged on 2026-03-24.

PR #439 addresses the same empty-slug issue with a more robust implementation: NFKD normalization (handles accented/non-ASCII characters), an fallback, and correct trim ordering. The fix in this PR (using entry-${Date.now()}) would conflict with that approach and is no longer needed.

Safe to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: slugify returns empty string for non-ASCII skill/training names

3 participants