-
Notifications
You must be signed in to change notification settings - Fork 149
hotfix/slash agent url #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary by CodeRabbitRelease Notes
WalkthroughThis PR updates the version from 0.1.12 to 0.1.13 and adds targeted "/" key handling in the TUI application to allow forward slash character insertion into specific text fields (AgentURL, JudgeModel, and ServerURL) without intercepting them. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/tui/internal/tui/app.go (1)
984-992: Consider using rune slicing for ConfigurationScreen ServerURL field.The "/" handling for the ServerURL field uses direct string slicing (lines 988-990), which is consistent with how other character input is handled in ConfigurationScreen (see lines 1747-1750, 1801-1803). However, this approach could corrupt the string if users enter multi-byte UTF-8 characters.
While this is consistent with the existing codebase pattern for ConfigurationScreen, consider refactoring the entire ServerURL text handling to use rune slicing (similar to NewEvaluationScreen at lines 974-980) for more robust UTF-8 support. That said, since URLs are typically ASCII-only, this is low priority.
Note: This addresses the previous review comment asking about server URL handling.
Example refactor:
// Don't intercept "/" if we're editing text in ConfigurationScreen if m.currentScreen == ConfigurationScreen && m.configState != nil && m.configState.IsEditing && m.configState.ActiveField == ConfigFieldServerURL { // Handle "/" character directly in server URL field - m.configState.ServerURL = m.configState.ServerURL[:m.configState.CursorPos] + - "/" + m.configState.ServerURL[m.configState.CursorPos:] + runes := []rune(m.configState.ServerURL) + m.configState.ServerURL = string(runes[:m.configState.CursorPos]) + + "/" + string(runes[m.configState.CursorPos:]) m.configState.CursorPos++ return m, nil }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
VERSION(1 hunks)packages/tui/internal/tui/app.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/tui/internal/tui/app.go (1)
packages/tui/internal/tui/configurations.go (1)
ConfigFieldServerURL(14-14)
🔇 Additional comments (2)
VERSION (1)
1-1: LGTM! Version bump looks appropriate for a hotfix.packages/tui/internal/tui/app.go (1)
966-983: LGTM! Forward slash handling correctly implemented for NewEvaluationScreen fields.The implementation properly uses rune slicing to handle multi-byte UTF-8 characters and correctly inserts "/" at the cursor position for both AgentURL and JudgeModel fields. This prevents the "/" key from being intercepted for command input when editing these fields.
|
fixes #105 |
Description
Motivation and Context
Type of Change
Changes Made
Screenshots/Examples (if applicable)
Checklist
uv run black .to format my codeuv run flake8 .and fixed all issuesuv run mypy --config-file .mypy.ini .and addressed type checking issuesuv run bandit -c .bandit.yaml -r .for security checksuv run pytestand all tests passTesting
Test Configuration:
Test Steps:
1.
2.
3.
Additional Notes
Related Issues/PRs
fixes #105