Skip to content

fix: prevent panic when project directory name shorter than 8 chars#2

Open
KevM wants to merge 3 commits into
wethinkt:mainfrom
KevM:fix-tui
Open

fix: prevent panic when project directory name shorter than 8 chars#2
KevM wants to merge 3 commits into
wethinkt:mainfrom
KevM:fix-tui

Conversation

@KevM
Copy link
Copy Markdown
Contributor

@KevM KevM commented May 2, 2026

Summary

Fix a panic in the TUI when Gemini or Kimi project directory names are shorter than 8 characters.

Both gemini/store.go and kimi/store.go were slicing directory names with [:8] without checking length first, causing panics like:

runtime error: slice bounds out of range [:8] with length 4

This occurred when a directory name like "kevm" (4 chars) was encountered.

Changes

  • Add length checks before truncating directory names in display paths
  • Preserves all existing display behavior while preventing panics

Test plan

  • Verified TUI starts without panic when short project directory names exist
  • Verified source discovery completes successfully
  • Verified projects are still discovered and displayed correctly

🤖 Generated with Claude Code

KevM and others added 3 commits February 18, 2026 11:26
Gemini and Kimi stores were slicing directory names with [:8] without
checking length first. Short names like "kevm" (4 chars) would panic
with "slice bounds out of range [:8] with length 4".

Add length checks in both stores before truncating display strings.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@KevM
Copy link
Copy Markdown
Contributor Author

KevM commented May 2, 2026

Apparently this happened because my user directory name is only 4 characters long. 🤷🏼‍♂️

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